+ eda algo: same algo than eda-sa without sa, + plotting scripts and problem functions moved to application/common
This commit is contained in:
parent
ba6770df43
commit
65191e2212
16 changed files with 595 additions and 14 deletions
|
|
@ -159,6 +159,15 @@ public:
|
|||
//-------------------------------------------------------------
|
||||
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Evaluating a first time the current solution
|
||||
//-------------------------------------------------------------
|
||||
|
||||
_evaluation( current_solution );
|
||||
|
||||
//-------------------------------------------------------------
|
||||
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Building of the sampler in current_pop
|
||||
//-------------------------------------------------------------
|
||||
|
|
@ -170,21 +179,20 @@ public:
|
|||
do
|
||||
{
|
||||
EOT candidate_solution = _sampler(distrib);
|
||||
|
||||
EOT& e1 = candidate_solution;
|
||||
_evaluation( e1 );
|
||||
EOT& e2 = current_solution;
|
||||
_evaluation( e2 );
|
||||
_evaluation( candidate_solution );
|
||||
|
||||
// TODO: verifier le critere d'acceptation
|
||||
if ( e1.fitness() < e2.fitness() ||
|
||||
rng.uniform() < exp( ::fabs(e1.fitness() - e2.fitness()) / temperature ) )
|
||||
if ( candidate_solution.fitness() < current_solution.fitness() ||
|
||||
rng.uniform() < exp( ::fabs(candidate_solution.fitness() - current_solution.fitness()) / temperature ) )
|
||||
{
|
||||
current_pop.push_back(candidate_solution);
|
||||
current_solution = candidate_solution;
|
||||
}
|
||||
}
|
||||
while ( _sa_continue( current_solution) );
|
||||
while ( _sa_continue( current_solution ) );
|
||||
|
||||
//-------------------------------------------------------------
|
||||
|
||||
|
||||
_replacor(pop, current_pop); // copy current_pop in pop
|
||||
|
||||
|
|
|
|||
Reference in a new issue