Passage du code dans un pretty printer
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1813 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
cc31901008
commit
3d8057ac4d
88 changed files with 2726 additions and 2720 deletions
|
|
@ -40,7 +40,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
* Metropolis-Hasting local search
|
||||
* Only the symetric case is considered when Q(x,y) = Q(y,x)
|
||||
* Fitness must be > 0
|
||||
*
|
||||
*
|
||||
* At each iteration,
|
||||
* one of the random solution in the neighborhood is selected
|
||||
* if the selected neighbor have higher or equal fitness than the current solution
|
||||
|
|
@ -53,58 +53,58 @@ template<class Neighbor>
|
|||
class moMetropolisHasting: public moLocalSearch<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
/**
|
||||
* Basic constructor of the Metropolis-Hasting
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStep maximum step to do
|
||||
*/
|
||||
moMetropolisHasting(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned int _nbStep):
|
||||
moLocalSearch<Neighbor>(explorer, trueCont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultNeighborComp, defaultSolNeighborComp, _nbStep)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Simple constructor of the Metropolis-Hasting
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStep maximum step to do
|
||||
* @param _cont an external continuator
|
||||
*/
|
||||
moMetropolisHasting(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned int _nbStep, moContinuator<Neighbor>& _cont):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultNeighborComp, defaultSolNeighborComp, _nbStep)
|
||||
{}
|
||||
|
||||
/**
|
||||
* General constructor of the Metropolis-Hasting
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStep maximum step to do
|
||||
* @param _cont an external continuator
|
||||
* @param _compN a neighbor vs neighbor comparator
|
||||
* @param _compSN a solution vs neighbor comparator
|
||||
*/
|
||||
moMetropolisHasting(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned int _nbStep, moContinuator<Neighbor>& _cont, moNeighborComparator<Neighbor>& _compN, moSolNeighborComparator<Neighbor>& _compSN):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, _compN, _compSN, _nbStep)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Basic constructor of the Metropolis-Hasting
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStep maximum step to do
|
||||
*/
|
||||
moMetropolisHasting(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned int _nbStep):
|
||||
moLocalSearch<Neighbor>(explorer, trueCont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultNeighborComp, defaultSolNeighborComp, _nbStep)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Simple constructor of the Metropolis-Hasting
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStep maximum step to do
|
||||
* @param _cont an external continuator
|
||||
*/
|
||||
moMetropolisHasting(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned int _nbStep, moContinuator<Neighbor>& _cont):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultNeighborComp, defaultSolNeighborComp, _nbStep)
|
||||
{}
|
||||
|
||||
/**
|
||||
* General constructor of the Metropolis-Hasting
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStep maximum step to do
|
||||
* @param _cont an external continuator
|
||||
* @param _compN a neighbor vs neighbor comparator
|
||||
* @param _compSN a solution vs neighbor comparator
|
||||
*/
|
||||
moMetropolisHasting(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned int _nbStep, moContinuator<Neighbor>& _cont, moNeighborComparator<Neighbor>& _compN, moSolNeighborComparator<Neighbor>& _compSN):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, _compN, _compSN, _nbStep)
|
||||
{}
|
||||
|
||||
private:
|
||||
// always true continuator
|
||||
moTrueContinuator<Neighbor> trueCont;
|
||||
// compare the fitness values of neighbors: true is strictly greater
|
||||
moNeighborComparator<Neighbor> defaultNeighborComp;
|
||||
// compare the fitness values of the solution and the neighbor: true if strictly greater
|
||||
moSolNeighborComparator<Neighbor> defaultSolNeighborComp;
|
||||
// the explorer of the HC with neutral move (equals fitness move)
|
||||
moMetropolisHastingExplorer<Neighbor> explorer;
|
||||
// always true continuator
|
||||
moTrueContinuator<Neighbor> trueCont;
|
||||
// compare the fitness values of neighbors: true is strictly greater
|
||||
moNeighborComparator<Neighbor> defaultNeighborComp;
|
||||
// compare the fitness values of the solution and the neighbor: true if strictly greater
|
||||
moSolNeighborComparator<Neighbor> defaultSolNeighborComp;
|
||||
// the explorer of the HC with neutral move (equals fitness move)
|
||||
moMetropolisHastingExplorer<Neighbor> explorer;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue