Doc and tests added
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1706 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
6cb6070df4
commit
baf31d0c30
25 changed files with 159 additions and 26 deletions
|
|
@ -35,6 +35,8 @@
|
|||
#ifndef _moMetropolisHastingExplorer_h
|
||||
#define _moMetropolisHastingExplorer_h
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include <explorer/moNeighborhoodExplorer.h>
|
||||
#include <comparator/moNeighborComparator.h>
|
||||
#include <comparator/moSolNeighborComparator.h>
|
||||
|
|
@ -67,6 +69,9 @@ public:
|
|||
moMetropolisHastingExplorer(Neighborhood& _neighborhood, moEval<Neighbor>& _eval, moNeighborComparator<Neighbor>& _neighborComparator, moSolNeighborComparator<Neighbor>& _solNeighborComparator, unsigned int _nbStep) : moNeighborhoodExplorer<Neighborhood>(_neighborhood, _eval), neighborComparator(_neighborComparator), solNeighborComparator(_solNeighborComparator), nbStep(_nbStep) {
|
||||
isAccept = false;
|
||||
current=new Neighbor();
|
||||
if(!neighborhood.isRandom()){
|
||||
std::cout << "moMetropolisHastingExplorer::Warning -> the neighborhood used is not random" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -69,6 +69,9 @@ public:
|
|||
nbStep(_nbStep) {
|
||||
isAccept = false;
|
||||
current=new Neighbor();
|
||||
if(!neighborhood.isRandom()){
|
||||
std::cout << "moRandomNeutralWalkExplorer::Warning -> the neighborhood used is not random" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -63,6 +63,9 @@ public:
|
|||
current=new Neighbor();
|
||||
// number of step done
|
||||
step = 0;
|
||||
if(!neighborhood.isRandom()){
|
||||
std::cout << "moRandomWalkExplorer::Warning -> the neighborhood used is not random" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -110,8 +110,7 @@ public:
|
|||
*/
|
||||
virtual void updateParam(EOT& _solution)
|
||||
{
|
||||
if ((*this).moveApplied())
|
||||
{
|
||||
if ((*this).moveApplied()){
|
||||
tabuList.add(_solution, *best);
|
||||
intensification.add(_solution, *best);
|
||||
diversification.add(_solution, *best);
|
||||
|
|
@ -126,10 +125,9 @@ public:
|
|||
|
||||
|
||||
/**
|
||||
* terminate : NOTHING TO DO
|
||||
* terminate : _solution becomes the best so far
|
||||
*/
|
||||
virtual void terminate(EOT & _solution)
|
||||
{
|
||||
virtual void terminate(EOT & _solution){
|
||||
_solution= bestSoFar;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue