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
|
|
@ -44,8 +44,8 @@
|
|||
#include <sampling/moFitnessCloudSampling.h>
|
||||
|
||||
/**
|
||||
* To compute an estimation of the fitness cloud,
|
||||
* i.e. the scatter plot of solution fitness versus neighbor fitness:
|
||||
* To compute an estimation of the fitness cloud,
|
||||
* i.e. the scatter plot of solution fitness versus neighbor fitness:
|
||||
*
|
||||
* Here solution are sampled with Metropolis-Hasting method
|
||||
*
|
||||
|
|
@ -53,59 +53,59 @@
|
|||
* and the fitness of one random neighbor
|
||||
*
|
||||
* The values are collected during the Metropolis-Hasting walk
|
||||
*
|
||||
*
|
||||
*/
|
||||
template <class Neighbor>
|
||||
class moMHRndFitnessCloudSampling : public moFitnessCloudSampling<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT ;
|
||||
|
||||
using moSampling<Neighbor>::localSearch;
|
||||
using moSampling<Neighbor>::checkpoint;
|
||||
using moSampling<Neighbor>::monitorVec;
|
||||
using moSampling<Neighbor>::continuator;
|
||||
using moFitnessCloudSampling<Neighbor>::fitnessStat;
|
||||
typedef typename Neighbor::EOT EOT ;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _init initialisation method of the solution
|
||||
* @param _neighborhood neighborhood to get one random neighbor (supposed to be random neighborhood)
|
||||
* @param _fullEval Fitness function, full evaluation function
|
||||
* @param _eval neighbor evaluation, incremental evaluation function
|
||||
* @param _nbStep Number of step of the MH sampling
|
||||
*/
|
||||
moMHRndFitnessCloudSampling(eoInit<EOT> & _init,
|
||||
moNeighborhood<Neighbor> & _neighborhood,
|
||||
eoEvalFunc<EOT>& _fullEval,
|
||||
moEval<Neighbor>& _eval,
|
||||
unsigned int _nbStep) :
|
||||
moFitnessCloudSampling<Neighbor>(_init, _neighborhood, _fullEval, _eval, _nbStep),
|
||||
neighborFitnessStat(_neighborhood, _eval)
|
||||
{
|
||||
// delete the dummy local search
|
||||
delete localSearch;
|
||||
|
||||
// Metropolis-Hasting sampling
|
||||
localSearch = new moMetropolisHasting<Neighbor>(_neighborhood, _fullEval, _eval, _nbStep);
|
||||
using moSampling<Neighbor>::localSearch;
|
||||
using moSampling<Neighbor>::checkpoint;
|
||||
using moSampling<Neighbor>::monitorVec;
|
||||
using moSampling<Neighbor>::continuator;
|
||||
using moFitnessCloudSampling<Neighbor>::fitnessStat;
|
||||
|
||||
// delete the checkpoint with the wrong continuator
|
||||
delete checkpoint;
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _init initialisation method of the solution
|
||||
* @param _neighborhood neighborhood to get one random neighbor (supposed to be random neighborhood)
|
||||
* @param _fullEval Fitness function, full evaluation function
|
||||
* @param _eval neighbor evaluation, incremental evaluation function
|
||||
* @param _nbStep Number of step of the MH sampling
|
||||
*/
|
||||
moMHRndFitnessCloudSampling(eoInit<EOT> & _init,
|
||||
moNeighborhood<Neighbor> & _neighborhood,
|
||||
eoEvalFunc<EOT>& _fullEval,
|
||||
moEval<Neighbor>& _eval,
|
||||
unsigned int _nbStep) :
|
||||
moFitnessCloudSampling<Neighbor>(_init, _neighborhood, _fullEval, _eval, _nbStep),
|
||||
neighborFitnessStat(_neighborhood, _eval)
|
||||
{
|
||||
// delete the dummy local search
|
||||
delete localSearch;
|
||||
|
||||
// set the continuator
|
||||
continuator = localSearch->getContinuator();
|
||||
// Metropolis-Hasting sampling
|
||||
localSearch = new moMetropolisHasting<Neighbor>(_neighborhood, _fullEval, _eval, _nbStep);
|
||||
|
||||
// re-construction of the checkpoint
|
||||
checkpoint = new moCheckpoint<Neighbor>(*continuator);
|
||||
checkpoint->add(fitnessStat);
|
||||
checkpoint->add(*monitorVec[0]);
|
||||
// delete the checkpoint with the wrong continuator
|
||||
delete checkpoint;
|
||||
|
||||
// one random neighbor
|
||||
add(neighborFitnessStat);
|
||||
}
|
||||
// set the continuator
|
||||
continuator = localSearch->getContinuator();
|
||||
|
||||
// re-construction of the checkpoint
|
||||
checkpoint = new moCheckpoint<Neighbor>(*continuator);
|
||||
checkpoint->add(fitnessStat);
|
||||
checkpoint->add(*monitorVec[0]);
|
||||
|
||||
// one random neighbor
|
||||
add(neighborFitnessStat);
|
||||
}
|
||||
|
||||
protected:
|
||||
moNeighborFitnessStat< Neighbor > neighborFitnessStat;
|
||||
moNeighborFitnessStat< Neighbor > neighborFitnessStat;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue