DMLS intégré et testé

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1817 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
jhumeau 2010-05-20 07:49:06 +00:00
commit 6720152ff7
24 changed files with 1977 additions and 29 deletions

View file

@ -48,12 +48,11 @@
/**
* Explorer which explore all the neighborhood
*/
template < class Neighborhood >
class moeoExhaustiveNeighborhoodExplorer : public moeoPopNeighborhoodExplorer < Neighborhood >
template < class Neighbor>
class moeoExhaustiveNeighborhoodExplorer : public moeoPopNeighborhoodExplorer <Neighbor>
{
/** Alias for the type */
typedef typename Neighborhood::EOT MOEOT;
typedef typename Neighborhood::Neighbor Neighbor;
typedef typename Neighbor::EOT MOEOT;
/** Alias for the objeciveVector */
typedef typename MOEOT::ObjectiveVector ObjectiveVector;
@ -90,13 +89,21 @@ private:
*/
void explore(MOEOT & _src , eoPop < MOEOT > & _dest)
{
//if the neighborhood is not empty
if(neighborhood.hasNeighbor(_src)){
//init the neighborhood
neighborhood.init(_src, neighbor);
//copy the solution (_src) at the end of the destination (_dest)
_dest.push_back(_src);
//eval the neighbor
eval(_dest.back(),neighbor);
//move the copy
neighbor.move(_dest.back());
//affect objective vector to the copy
_dest.back().objectiveVector(neighbor.fitness());
//fix its flag to 0 (unvisited solution)
_dest.back().flag(0);
//repeat all instructions for each neighbor in the neighborhood
while (neighborhood.cont(_src)){
neighborhood.next(_src, neighbor);
_dest.push_back(_src);
@ -105,6 +112,7 @@ private:
_dest.back().objectiveVector(neighbor.fitness());
_dest.back().flag(0);
}
//fix the source flag to 1 (visited solution)
_src.flag(1);
}
}
@ -113,8 +121,6 @@ private:
Neighbor neighbor;
/** Neighborhood */
moNeighborhood<Neighbor>& neighborhood;
/** ObjectiveVector */
ObjectiveVector objVec;
/** the incremental evaluation */
moEval < Neighbor > & eval;