Modification de vsn, encore à compiler...

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1927 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
verel 2010-08-28 09:17:43 +00:00
commit 1cf50233ee
4 changed files with 305 additions and 272 deletions

View file

@ -1,30 +1,30 @@
/*
<moVNSexplorer.h>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
<moVNSexplorer.h>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
This software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can ue,
modify and/ or redistribute the software under the terms of the CeCILL
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".
This software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can ue,
modify and/ or redistribute the software under the terms of the CeCILL
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms.
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
Contact: paradiseo-help@lists.gforge.inria.fr
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
Contact: paradiseo-help@lists.gforge.inria.fr
*/
#ifndef _moVNSexplorer_h
@ -37,7 +37,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
#include <algo/moDummyLS.h>
/**
* Explorer for Variiable Neighborhood Search
* Explorer for the "Variable Neighborhood Search" metaheuristic
*/
template< class Neighbor>
class moVNSexplorer : public moNeighborhoodExplorer< Neighbor >
@ -53,10 +53,9 @@ public:
* @param _neighborComparator a neighbor comparator
* @param _solNeighborComparator solution vs neighbor comparator
*/
moVNSexplorer(
moVariableNeighborhoodSelection<EOT> & _selection,
moVNSexplorer(moVariableNeighborhoodSelection<EOT> & _selection,
moAcceptanceCriterion<Neighbor>& _acceptCrit):
moNeighborhoodExplorer<Neighbor>(),dummyLS(dummyEval), selection(_selection), acceptCrit(_acceptCrit), ls(&dummyLS), shake(dummyLS), stop(false)
moNeighborhoodExplorer<Neighbor>(), selection(_selection), acceptCrit(_acceptCrit), stop(false)
{}
/**
@ -66,25 +65,26 @@ public:
}
/**
* initParam: NOTHING TO DO
* Initialization on the initial search opeartors based on the "first" neighborhood
* @param _solution the current solution
*/
virtual void initParam(EOT& _solution) {
selection.init(current, shake, ls);
};
selection.init(_solution);
}
/**
* updateParam: NOTHING TO DO
* Change the search operators on the next neighborhood search.
* @param _solution the current solution
*/
virtual void updateParam(EOT & _solution) {
if ((*this).moveApplied()) {
selection.init(current, shake, ls);
selection.init(_solution);
} else
if (selection.cont(current)) {
selection.next(_solution);
} else
stop = true;
}
else if (selection.cont(current, shake, ls)){
selection.next(current, shake, ls);
}
else
stop=true;
};
/**
* terminate: NOTHING TO DO
@ -93,16 +93,19 @@ public:
/**
* Explore the neighborhood of a solution
* @param _solution
* @param _solution the current solution
*/
virtual void operator()(EOT & _solution) {
current=_solution;
eoMonOp<EOT> & shake = selection.getShake();
eoMonOp<EOT> & ls = selection.getLocalSearch();
current = _solution;
std::cout << "current avec shake: "<< current << std::endl;
shake(current);
std::cout << "current apres shake: "<< current << std::endl;
(*ls)(current);
std::cout << "current apres ls: "<< ls->className() << " " << current << std::endl;
};
ls(current);
std::cout << "current apres ls: "<< ls.className() << " " << current << std::endl;
}
/**
* continue if a move is accepted
@ -118,11 +121,11 @@ public:
* @param _solution the solution to move
*/
virtual void move(EOT & _solution) {
_solution=current;
_solution = current;
};
/**
* accept test if an amelirated neighbor was be found
* accept test if an amelirated neighbor was be found according to acceptance criteria
* @param _solution the solution
* @return true if the best neighbor ameliorate the fitness
*/
@ -139,19 +142,21 @@ public:
}
private:
moDummyLS<Neighbor> dummyLS;
//moDummyLS<Neighbor> dummyLS;
moVariableNeighborhoodSelection<EOT>& selection;
moAcceptanceCriterion<Neighbor>& acceptCrit;
eoMonOp<EOT>* ls;
eoMonOp<EOT>& shake;
//eoMonOp<EOT>* ls;
//eoMonOp<EOT>& shake;
bool stop;
EOT current;
/*
class moDummyEval: public eoEvalFunc<EOT>{
public:
void operator()(EOT& hop){}
}dummyEval;
*/
};

View file

@ -1,30 +1,30 @@
/*
<moForwardVectorVNSelection.h>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
<moForwardVectorVNSelection.h>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
This software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can ue,
modify and/ or redistribute the software under the terms of the CeCILL
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".
This software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can ue,
modify and/ or redistribute the software under the terms of the CeCILL
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms.
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
Contact: paradiseo-help@lists.gforge.inria.fr
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
Contact: paradiseo-help@lists.gforge.inria.fr
*/
#ifndef _moForwardVectorVNSelection_h
@ -55,7 +55,7 @@ public:
* test if there is still some neighborhood to explore
* @return true if there is some neighborhood to explore
*/
virtual bool cont(EOT& _solution, eoMonOp<EOT>& _shake, eoMonOp<EOT>*& _ls){
virtual bool cont(EOT& _solution){
return (cycle || (current <= (LSvector.size()-2)));
std::cout << "current LS: " << current << std::endl;
std::cout << _solution << std::endl;
@ -65,22 +65,18 @@ public:
/**
* put the current neighborhood on the first one
*/
virtual void init(EOT& _solution, eoMonOp<EOT>& _shake, eoMonOp<EOT>*& _ls){
current=0;
_ls = LSvector[current];
_shake = *(shakeVector[current]);
std::cout << "current LS: " << _ls->className() << " " << current << std::endl;
std::cout << _solution << std::endl;
virtual void init(EOT& _solution){
current = 0;
// std::cout << "current LS: " << _ls->className() << " " << current << std::endl;
// std::cout << _solution << std::endl;
}
/**
* put the current neighborhood on the next one
*/
virtual void next(EOT& _solution, eoMonOp<EOT>& _shake, eoMonOp<EOT>*& _ls){
current = (current+1) % LSvector.size();
_ls = LSvector[current];
_shake = *(shakeVector[current]);
virtual void next(EOT& _solution){
current = (current + 1) % LSvector.size();
std::cout << "current LS: " << current << std::endl;
std::cout << _solution << std::endl;
}

View file

@ -2,7 +2,7 @@
<moVariableNeighborhoodSelection.h>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
This software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can ue,
@ -50,17 +50,31 @@ public:
* test if there is still some neighborhood to explore
* @return true if there is some neighborhood to explore
*/
virtual bool cont(EOT& _solution, eoMonOp<EOT>& _skake, eoMonOp<EOT>*& _ls) = 0;
virtual bool cont(EOT& _solution) = 0;
/**
* put the current neighborhood on the first one
*/
virtual void init(EOT& _solution, eoMonOp<EOT>& _skake, eoMonOp<EOT>*& _ls) = 0;
virtual void init(EOT& _solution) = 0;
/**
* put the current neighborhood on the next one
*/
virtual void next(EOT& _solution, eoMonOp<EOT>& _skake, eoMonOp<EOT>*& _ls) = 0;
virtual void next(EOT& _solution) = 0;
/**
* Get the current "shake" operator based on the current neighborhood
*
* @return current shake operator
*/
virtual const eoMon<EOT> & getShake() = 0;
/**
* Get the current local search based on the current neighborhood
*
* @return current local search
*/
virtual const eoMon<EOT> & getLocalSearch() = 0;
};

View file

@ -1,30 +1,30 @@
/*
<moVectorVNSelection.h>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
<moVectorVNSelection.h>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
This software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can ue,
modify and/ or redistribute the software under the terms of the CeCILL
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".
This software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can ue,
modify and/ or redistribute the software under the terms of the CeCILL
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms.
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
Contact: paradiseo-help@lists.gforge.inria.fr
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
Contact: paradiseo-help@lists.gforge.inria.fr
*/
#ifndef _moVectorVNSelection_h
@ -57,21 +57,39 @@ public:
return "moVectorVNSelection";
}
/**
* Get the current "shake" operator based on the current neighborhood
*
* @return current shake operator
*/
virtual const eoMon<EOT> & getShake() {
return *(shakeVector[current]);
}
/**
* Get the current local search based on the current neighborhood
*
* @return current local search
*/
virtual const eoMon<EOT> & getLocalSearch() {
return *(LSvector[current]);
}
/**
* test if there is still some neighborhood to explore
* @return true if there is some neighborhood to explore
*/
virtual bool cont(EOT& _solution, eoMonOp<EOT>& _shake, eoMonOp<EOT>*& _ls) = 0;
virtual bool cont(EOT& _solution) = 0;
/**
* put the current neighborhood on the first one
*/
virtual void init(EOT& _solution, eoMonOp<EOT>& _shake, eoMonOp<EOT>*& _ls) = 0;
virtual void init(EOT& _solution) = 0;
/**
* put the current neighborhood on the next one
*/
virtual void next(EOT& _solution, eoMonOp<EOT>& _shake, eoMonOp<EOT>*& _ls) = 0;
virtual void next(EOT& _solution) = 0;
protected:
std::vector<eoMonOp<EOT>* > LSvector;