Replace Templates NHE and Neighborhood
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1732 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
e3a9101595
commit
5f7d120a6e
48 changed files with 236 additions and 227 deletions
|
|
@ -13,7 +13,7 @@ ADD_EXECUTABLE(testMetropolisHasting testMetropolisHasting.cpp)
|
|||
#ADD_EXECUTABLE(testWithMove testWithMove.cpp)
|
||||
ADD_EXECUTABLE(testSimpleTS testSimpleTS.cpp)
|
||||
ADD_EXECUTABLE(testRandomNeutralWalk testRandomNeutralWalk.cpp)
|
||||
#ADD_EXECUTABLE(testILS testILS.cpp)
|
||||
ADD_EXECUTABLE(testILS testILS.cpp)
|
||||
ADD_EXECUTABLE(testSimulatedAnnealing testSimulatedAnnealing.cpp)
|
||||
|
||||
TARGET_LINK_LIBRARIES(testSimpleHC eoutils ga eo)
|
||||
|
|
@ -25,7 +25,7 @@ TARGET_LINK_LIBRARIES(testMetropolisHasting eoutils ga eo)
|
|||
#TARGET_LINK_LIBRARIES(testWithMove eoutils ga eo)
|
||||
TARGET_LINK_LIBRARIES(testSimpleTS eoutils ga eo)
|
||||
TARGET_LINK_LIBRARIES(testRandomNeutralWalk eoutils ga eo)
|
||||
#TARGET_LINK_LIBRARIES(testILS eoutils ga eo)
|
||||
TARGET_LINK_LIBRARIES(testILS eoutils ga eo)
|
||||
TARGET_LINK_LIBRARIES(testSimulatedAnnealing eoutils ga eo)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moFirstImprExplorer<Neighborhood> explorer(neighborhood, fulleval, comparator, solComparator);
|
||||
moFirstImprExplorer<Neighbor> explorer(neighborhood, fulleval, comparator, solComparator);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
|
|
@ -158,9 +158,9 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moTrueContinuator<Neighborhood> continuator;//always continue
|
||||
moTrueContinuator<Neighbor> continuator;//always continue
|
||||
|
||||
moLocalSearch< moFirstImprExplorer<Neighborhood> > localSearch(explorer, continuator, eval);
|
||||
moLocalSearch< Neighbor > localSearch(explorer, continuator, eval);
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moHCneutralExplorer<Neighborhood> explorer(neighborhood, fulleval, comparator, solComparator, nbStep);
|
||||
moHCneutralExplorer<Neighbor> explorer(neighborhood, fulleval, comparator, solComparator, nbStep);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
|
|
@ -162,9 +162,9 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moTrueContinuator<Neighborhood> continuator;//always continue
|
||||
moTrueContinuator<Neighbor> continuator;//always continue
|
||||
|
||||
moLocalSearch< moHCneutralExplorer<Neighborhood> > localSearch(explorer, continuator, eval);
|
||||
moLocalSearch<Neighbor> localSearch(explorer, continuator, eval);
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moSimpleHCexplorer<Neighborhood> explorer(neighborhood, fulleval, comparator, solComparator);
|
||||
moSimpleHCexplorer<Neighbor> explorer(neighborhood, fulleval, comparator, solComparator);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
|
|
@ -173,28 +173,28 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moTrueContinuator<Neighborhood> continuator;//always continue
|
||||
moTrueContinuator<Neighbor> continuator;//always continue
|
||||
|
||||
moLocalSearch< NHE > hc(explorer, continuator, eval);
|
||||
moLocalSearch< Neighbor > hc(explorer, continuator, eval);
|
||||
|
||||
eoBitMutation<Indi> monOp(1.0/vecSize);
|
||||
|
||||
//moMonOpPerturb<Neighbor> perturb(monOp, eval);
|
||||
moMonOpPerturb<Neighbor> perturb(monOp, eval);
|
||||
|
||||
//moRestartPerturb<Neighbor> perturb(random, eval, 5);
|
||||
|
||||
moNeighborhoodPerturb<Neighbor, Neighborhood2> perturb(neighborhood2, fulleval);
|
||||
//moNeighborhoodPerturb<Neighbor, Neighborhood2> perturb(neighborhood2, fulleval);
|
||||
|
||||
moSolComparator<Indi> comp;
|
||||
|
||||
//moAlwaysAcceptCrit<Neighbor> accept;
|
||||
moBetterAcceptCrit<Neighbor> accept(comp);
|
||||
|
||||
moILSexplorer< NHE > explorerILS(hc, perturb, accept);
|
||||
moILSexplorer< Neighbor > explorerILS(hc, perturb, accept);
|
||||
|
||||
moIterContinuator<Neighborhood> continuatorILS(100);
|
||||
moIterContinuator<Neighbor> continuatorILS(100);
|
||||
|
||||
moLocalSearch< moILSexplorer< moSimpleHCexplorer<Neighborhood> > >localSearch(explorerILS, continuatorILS, eval);
|
||||
moLocalSearch<Neighbor>localSearch(explorerILS, continuatorILS, eval);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moMetropolisHastingExplorer<Neighborhood> explorer(neighborhood, fulleval, comparator, solComparator, nbStep);
|
||||
moMetropolisHastingExplorer<Neighbor> explorer(neighborhood, fulleval, comparator, solComparator, nbStep);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
|
|
@ -162,9 +162,9 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moTrueContinuator<Neighborhood> continuator;//always continue
|
||||
moTrueContinuator<Neighbor> continuator;//always continue
|
||||
|
||||
moLocalSearch< moMetropolisHastingExplorer<Neighborhood> > localSearch(explorer, continuator, eval);
|
||||
moLocalSearch<Neighbor> localSearch(explorer, continuator, eval);
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moRandomNeutralWalkExplorer<Neighborhood> explorer(neighborhood, nhEval, solComparator, nbStep);
|
||||
moRandomNeutralWalkExplorer<Neighbor> explorer(neighborhood, nhEval, solComparator, nbStep);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
|
|
@ -193,9 +193,9 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moTrueContinuator<Neighborhood> continuator;//always continue
|
||||
moTrueContinuator<Neighbor> continuator;//always continue
|
||||
|
||||
moCheckpoint<Neighborhood> checkpoint(continuator);
|
||||
moCheckpoint<Neighbor> checkpoint(continuator);
|
||||
|
||||
moFitnessStat<Indi, unsigned> fStat;
|
||||
|
||||
|
|
@ -203,15 +203,15 @@ void main_function(int argc, char **argv)
|
|||
moDistanceStat<Indi, unsigned> distStat(distance, solution); // distance from the intial solution
|
||||
|
||||
moOrderNeighborhood<Neighbor> nh(vecSize);
|
||||
moNeighborhoodStat< moOrderNeighborhood<Neighbor> > neighborhoodStat(nh, nhEval, comparator, solComparator);
|
||||
moMinNeighborStat< moOrderNeighborhood<Neighbor> > minStat(neighborhoodStat);
|
||||
moSecondMomentNeighborStat< moOrderNeighborhood<Neighbor> > secondMomentStat(neighborhoodStat);
|
||||
moMaxNeighborStat< moOrderNeighborhood<Neighbor> > maxStat(neighborhoodStat);
|
||||
moNeighborhoodStat< Neighbor > neighborhoodStat(nh, nhEval, comparator, solComparator);
|
||||
moMinNeighborStat< Neighbor > minStat(neighborhoodStat);
|
||||
moSecondMomentNeighborStat< Neighbor > secondMomentStat(neighborhoodStat);
|
||||
moMaxNeighborStat< Neighbor > maxStat(neighborhoodStat);
|
||||
|
||||
moNbSupNeighborStat< moOrderNeighborhood<Neighbor> > nbSupStat(neighborhoodStat);
|
||||
moNbInfNeighborStat< moOrderNeighborhood<Neighbor> > nbInfStat(neighborhoodStat);
|
||||
moNeutralDegreeNeighborStat< moOrderNeighborhood<Neighbor> > ndStat(neighborhoodStat);
|
||||
moSizeNeighborStat< moOrderNeighborhood<Neighbor> > sizeStat(neighborhoodStat);
|
||||
moNbSupNeighborStat< Neighbor > nbSupStat(neighborhoodStat);
|
||||
moNbInfNeighborStat< Neighbor > nbInfStat(neighborhoodStat);
|
||||
moNeutralDegreeNeighborStat< Neighbor > ndStat(neighborhoodStat);
|
||||
moSizeNeighborStat< Neighbor > sizeStat(neighborhoodStat);
|
||||
|
||||
eoValueParam<unsigned int> genCounter(-1,"Gen");
|
||||
eoIncrementor<unsigned int> increm(genCounter.value());
|
||||
|
|
@ -248,7 +248,7 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moLocalSearch< moRandomNeutralWalkExplorer<Neighborhood> > localSearch(explorer, checkpoint, eval);
|
||||
moLocalSearch<Neighbor> localSearch(explorer, checkpoint, eval);
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moRandomWalkExplorer<Neighborhood> explorer(neighborhood, nhEval, nbStep);
|
||||
moRandomWalkExplorer<Neighbor> explorer(neighborhood, nhEval, nbStep);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
|
|
@ -158,9 +158,9 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moTrueContinuator<Neighborhood> continuator;//always continue
|
||||
moTrueContinuator<Neighbor> continuator;//always continue
|
||||
|
||||
moCheckpoint<Neighborhood> checkpoint(continuator);
|
||||
moCheckpoint<Neighbor> checkpoint(continuator);
|
||||
|
||||
moFitnessStat<Indi, unsigned> fStat;
|
||||
eoHammingDistance<Indi> distance;
|
||||
|
|
@ -208,7 +208,7 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moLocalSearch< moRandomWalkExplorer<Neighborhood> > localSearch(explorer, checkpoint, eval);
|
||||
moLocalSearch<Neighbor> localSearch(explorer, checkpoint, eval);
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moSimpleHCexplorer<Neighborhood> explorer(neighborhood, fulleval, comparator, solComparator);
|
||||
moSimpleHCexplorer<Neighbor> explorer(neighborhood, fulleval, comparator, solComparator);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
|
|
@ -158,9 +158,9 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moTrueContinuator<Neighborhood> continuator;//always continue
|
||||
moTrueContinuator<Neighbor> continuator;//always continue
|
||||
|
||||
moLocalSearch< moSimpleHCexplorer<Neighborhood> > localSearch(explorer, continuator, eval);
|
||||
moLocalSearch< Neighbor > localSearch(explorer, continuator, eval);
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moSimpleHCneutralExplorer<Neighborhood> explorer(neighborhood, fulleval, comparator, solComparator);
|
||||
moSimpleHCneutralExplorer<Neighbor> explorer(neighborhood, fulleval, comparator, solComparator);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
|
|
@ -158,9 +158,9 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moTrueContinuator<Neighborhood> continuator;//always continue
|
||||
moTrueContinuator<Neighbor> continuator;//always continue
|
||||
|
||||
moLocalSearch< moSimpleHCneutralExplorer<Neighborhood> > localSearch(explorer, continuator, eval);
|
||||
moLocalSearch<Neighbor> localSearch(explorer, continuator, eval);
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ void main_function(int argc, char **argv)
|
|||
moDummyIntensification<Neighbor> inten;
|
||||
moDummyDiversification<Neighbor> div;
|
||||
moBestImprAspiration<Neighbor> asp;
|
||||
moTSExplorer<Neighborhood> explorer(neighborhood, eval, comparator, solComparator, tl, inten, div, asp);
|
||||
moTSExplorer<Neighbor> explorer(neighborhood, eval, comparator, solComparator, tl, inten, div, asp);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
|
|
@ -164,9 +164,9 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moTrueContinuator<Neighborhood> continuator;//always continue
|
||||
moTrueContinuator<Neighbor> continuator;//always continue
|
||||
|
||||
moLocalSearch< moTSExplorer<Neighborhood> > localSearch(explorer, continuator, fulleval);
|
||||
moLocalSearch<Neighbor> localSearch(explorer, continuator, fulleval);
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moSAexplorer<Neighborhood> explorer(neighborhood, fulleval, solComparator, coolingSchedule);
|
||||
moSAexplorer<Neighbor> explorer(neighborhood, fulleval, solComparator, coolingSchedule);
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
@ -166,9 +166,9 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moTrueContinuator<Neighborhood> continuator;//always continue
|
||||
moTrueContinuator<Neighbor> continuator;//always continue
|
||||
|
||||
moLocalSearch< moSAexplorer<Neighborhood> > localSearch(explorer, continuator, eval);
|
||||
moLocalSearch<Neighbor> localSearch(explorer, continuator, eval);
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue