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
|
|
@ -41,92 +41,92 @@ template< class EOT >
|
|||
class moVNSexplorer : public moNeighborhoodExplorer< moNeighborhood< moNeighbor<EOT, typename EOT::Fitness> > >
|
||||
{
|
||||
public:
|
||||
typedef typename EOT::Fitness Fitness ;
|
||||
typedef moNeighbor<EOT, Fitness> Neighbor ;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
typedef typename EOT::Fitness Fitness ;
|
||||
typedef moNeighbor<EOT, Fitness> Neighbor ;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
using moNeighborhoodExplorer<Neighborhood>::neighborhood;
|
||||
using moNeighborhoodExplorer<Neighborhood>::eval;
|
||||
using moNeighborhoodExplorer<Neighborhood>::neighborhood;
|
||||
using moNeighborhoodExplorer<Neighborhood>::eval;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _eval the evaluation function
|
||||
* @param _neighborComparator a neighbor comparator
|
||||
* @param _solNeighborComparator solution vs neighbor comparator
|
||||
*/
|
||||
moVNSexplorer(Neighborhood& _neighborhood, moEval<Neighbor>& _eval, moNeighborComparator<Neighbor>& _neighborComparator, moSolNeighborComparator<Neighbor>& _solNeighborComparator) : moNeighborhoodExplorer<Neighborhood>(_neighborhood, _eval), neighborComparator(_neighborComparator), solNeighborComparator(_solNeighborComparator) {
|
||||
}
|
||||
/**
|
||||
* Constructor
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _eval the evaluation function
|
||||
* @param _neighborComparator a neighbor comparator
|
||||
* @param _solNeighborComparator solution vs neighbor comparator
|
||||
*/
|
||||
moVNSexplorer(Neighborhood& _neighborhood, moEval<Neighbor>& _eval, moNeighborComparator<Neighbor>& _neighborComparator, moSolNeighborComparator<Neighbor>& _solNeighborComparator) : moNeighborhoodExplorer<Neighborhood>(_neighborhood, _eval), neighborComparator(_neighborComparator), solNeighborComparator(_solNeighborComparator) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~moVNSexplorer() {
|
||||
}
|
||||
|
||||
/**
|
||||
* initParam: NOTHING TO DO
|
||||
*/
|
||||
virtual void initParam(EOT & solution) {};
|
||||
|
||||
/**
|
||||
* updateParam: NOTHING TO DO
|
||||
*/
|
||||
virtual void updateParam(EOT & solution) {};
|
||||
|
||||
/**
|
||||
* terminate: NOTHING TO DO
|
||||
*/
|
||||
virtual void terminate(EOT & solution) {};
|
||||
|
||||
/**
|
||||
* Explore the neighborhood of a solution
|
||||
* @param _solution
|
||||
*/
|
||||
virtual void operator()(EOT & _solution) {
|
||||
};
|
||||
|
||||
/**
|
||||
* continue if a move is accepted
|
||||
* @param _solution the solution
|
||||
* @return true if an ameliorated neighbor was be found
|
||||
*/
|
||||
virtual bool isContinue(EOT & _solution) {
|
||||
return isAccept ;
|
||||
};
|
||||
|
||||
/**
|
||||
* move the solution with the best neighbor
|
||||
* @param _solution the solution to move
|
||||
*/
|
||||
virtual void move(EOT & _solution) {
|
||||
//move the solution
|
||||
(*best).move(_solution);
|
||||
//update its fitness
|
||||
_solution.fitness((*best).fitness());
|
||||
};
|
||||
|
||||
/**
|
||||
* accept test if an amelirated neighbor was be found
|
||||
* @param _solution the solution
|
||||
* @return true if the best neighbor ameliorate the fitness
|
||||
*/
|
||||
virtual bool accept(EOT & _solution) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the class id.
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const {
|
||||
return "moVNSexplorer";
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~moVNSexplorer() {
|
||||
}
|
||||
|
||||
/**
|
||||
* initParam: NOTHING TO DO
|
||||
*/
|
||||
virtual void initParam(EOT & solution) {};
|
||||
|
||||
/**
|
||||
* updateParam: NOTHING TO DO
|
||||
*/
|
||||
virtual void updateParam(EOT & solution) {};
|
||||
|
||||
/**
|
||||
* terminate: NOTHING TO DO
|
||||
*/
|
||||
virtual void terminate(EOT & solution) {};
|
||||
|
||||
/**
|
||||
* Explore the neighborhood of a solution
|
||||
* @param _solution
|
||||
*/
|
||||
virtual void operator()(EOT & _solution) {
|
||||
};
|
||||
|
||||
/**
|
||||
* continue if a move is accepted
|
||||
* @param _solution the solution
|
||||
* @return true if an ameliorated neighbor was be found
|
||||
*/
|
||||
virtual bool isContinue(EOT & _solution) {
|
||||
return isAccept ;
|
||||
};
|
||||
|
||||
/**
|
||||
* move the solution with the best neighbor
|
||||
* @param _solution the solution to move
|
||||
*/
|
||||
virtual void move(EOT & _solution) {
|
||||
//move the solution
|
||||
(*best).move(_solution);
|
||||
//update its fitness
|
||||
_solution.fitness((*best).fitness());
|
||||
};
|
||||
|
||||
/**
|
||||
* accept test if an amelirated neighbor was be found
|
||||
* @param _solution the solution
|
||||
* @return true if the best neighbor ameliorate the fitness
|
||||
*/
|
||||
virtual bool accept(EOT & _solution) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the class id.
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const {
|
||||
return "moVNSexplorer";
|
||||
}
|
||||
|
||||
private:
|
||||
// comparator betwenn solution and neighbor or between neighbors
|
||||
moNeighborComparator<Neighbor>& neighborComparator;
|
||||
moSolNeighborComparator<Neighbor>& solNeighborComparator;
|
||||
|
||||
// comparator betwenn solution and neighbor or between neighbors
|
||||
moNeighborComparator<Neighbor>& neighborComparator;
|
||||
moSolNeighborComparator<Neighbor>& solNeighborComparator;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue