ILS v1 :)
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1727 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
6de0a60f27
commit
6bb2a4a822
21 changed files with 330 additions and 60 deletions
|
|
@ -18,6 +18,7 @@
|
|||
// the general include for eo
|
||||
#include <eo>
|
||||
#include <ga.h>
|
||||
#include <ga/eoBitOp.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
@ -37,11 +38,16 @@ using namespace std;
|
|||
#include <explorer/moSimpleHCexplorer.h>
|
||||
#include <explorer/moILSexplorer.h>
|
||||
|
||||
#include <perturb/moMonOpPerturb.h>
|
||||
#include <acceptCrit/moAlwaysAcceptCrit.h>
|
||||
#include <continuator/moIterContinuator.h>
|
||||
|
||||
// REPRESENTATION
|
||||
//-----------------------------------------------------------------------------
|
||||
typedef eoBit<unsigned> Indi;
|
||||
typedef moBitNeighbor<unsigned int> Neighbor ; // incremental evaluation
|
||||
typedef moOrderNeighborhood<Neighbor> Neighborhood ;
|
||||
typedef moSimpleHCexplorer<Neighborhood> NHE;
|
||||
|
||||
void main_function(int argc, char **argv)
|
||||
{
|
||||
|
|
@ -161,7 +167,20 @@ void main_function(int argc, char **argv)
|
|||
|
||||
moTrueContinuator<Neighborhood> continuator;//always continue
|
||||
|
||||
moLocalSearch< moSimpleHCexplorer<Neighborhood> > localSearch(explorer, continuator, eval);
|
||||
moLocalSearch< NHE > hc(explorer, continuator, eval);
|
||||
|
||||
eoBitMutation<Indi> monOp(1.0/vecSize);
|
||||
|
||||
moMonOpPerturb<Neighbor> perturb(monOp, eval);
|
||||
|
||||
moAlwaysAcceptCrit<Neighbor> accept;
|
||||
|
||||
moILSexplorer< NHE > explorerILS(hc, perturb, accept);
|
||||
|
||||
moIterContinuator<Neighborhood> continuatorILS(10);
|
||||
|
||||
moLocalSearch< moILSexplorer< moSimpleHCexplorer<Neighborhood> > >localSearch(explorerILS, continuatorILS, eval);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
|
|||
|
|
@ -66,10 +66,6 @@ void main_function(int argc, char **argv)
|
|||
parser.processParam( vecSizeParam, "Representation" );
|
||||
unsigned vecSize = vecSizeParam.value();
|
||||
|
||||
eoValueParam<unsigned int> stepParam(10, "nbStep", "Number of steps of the random walk", 'n');
|
||||
parser.processParam( stepParam, "Representation" );
|
||||
unsigned nbStep = stepParam.value();
|
||||
|
||||
// the name of the "status" file where all actual parameter values will be saved
|
||||
string str_status = parser.ProgramName() + ".status"; // default value
|
||||
eoValueParam<string> statusParam(str_status.c_str(), "status", "Status file");
|
||||
|
|
@ -154,7 +150,7 @@ void main_function(int argc, char **argv)
|
|||
* ========================================================= */
|
||||
|
||||
// initial temp, factor of decrease, number of steps without decrease, final temp.
|
||||
moSimpleCoolingSchdedule<Indi> coolingSchedule(10, 0.9, 1, 0.01);
|
||||
moSimpleCoolingSchedule<Indi> coolingSchedule(10, 0.9, 1, 0.01);
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
@ -172,7 +168,7 @@ void main_function(int argc, char **argv)
|
|||
|
||||
moTrueContinuator<Neighborhood> continuator;//always continue
|
||||
|
||||
moLocalSearch< moMetropolisHastingExplorer<Neighborhood> > localSearch(explorer, continuator, eval);
|
||||
moLocalSearch< moSAexplorer<Neighborhood> > localSearch(explorer, continuator, eval);
|
||||
|
||||
/* =========================================================
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue