passage du code dans astyle
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1713 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
d7496cafff
commit
dd66b5e4bd
105 changed files with 3950 additions and 3924 deletions
|
|
@ -11,47 +11,47 @@ class moBestImprAspiration : public moAspiration<Neighbor>
|
|||
{
|
||||
public:
|
||||
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
|
||||
/**
|
||||
* init the best solution
|
||||
* @param _sol the best solution found
|
||||
*/
|
||||
void init(EOT & _sol){
|
||||
bestFoundSoFar = _sol;
|
||||
}
|
||||
/**
|
||||
* init the best solution
|
||||
* @param _sol the best solution found
|
||||
*/
|
||||
void init(EOT & _sol) {
|
||||
bestFoundSoFar = _sol;
|
||||
}
|
||||
|
||||
/**
|
||||
* update the "bestFoundSoFar" if a best solution is found
|
||||
* @param _sol a solution
|
||||
* @param _neighbor a neighbor
|
||||
*/
|
||||
void update(EOT & _sol, Neighbor & _neighbor){
|
||||
if (bestFoundSoFar.fitness() < _sol.fitness())
|
||||
bestFoundSoFar = _sol;
|
||||
}
|
||||
/**
|
||||
* update the "bestFoundSoFar" if a best solution is found
|
||||
* @param _sol a solution
|
||||
* @param _neighbor a neighbor
|
||||
*/
|
||||
void update(EOT & _sol, Neighbor & _neighbor) {
|
||||
if (bestFoundSoFar.fitness() < _sol.fitness())
|
||||
bestFoundSoFar = _sol;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the tabu feature of the neighbor:
|
||||
* test if the neighbor's fitness is better than the "bestFoundSoFar" fitness
|
||||
* @param _sol a solution
|
||||
* @param _neighbor a neighbor
|
||||
* @return true if _neighbor fitness is better than the "bestFoundSoFar"
|
||||
*/
|
||||
bool operator()(EOT & _sol, Neighbor & _neighbor){
|
||||
return (bestFoundSoFar.fitness() < _neighbor.fitness());
|
||||
}
|
||||
/**
|
||||
* Test the tabu feature of the neighbor:
|
||||
* test if the neighbor's fitness is better than the "bestFoundSoFar" fitness
|
||||
* @param _sol a solution
|
||||
* @param _neighbor a neighbor
|
||||
* @return true if _neighbor fitness is better than the "bestFoundSoFar"
|
||||
*/
|
||||
bool operator()(EOT & _sol, Neighbor & _neighbor) {
|
||||
return (bestFoundSoFar.fitness() < _neighbor.fitness());
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter
|
||||
* @return a reference on the best found so far solution
|
||||
*/
|
||||
EOT& getBest(){
|
||||
return bestFoundSoFar;
|
||||
}
|
||||
/**
|
||||
* Getter
|
||||
* @return a reference on the best found so far solution
|
||||
*/
|
||||
EOT& getBest() {
|
||||
return bestFoundSoFar;
|
||||
}
|
||||
|
||||
private:
|
||||
EOT bestFoundSoFar;
|
||||
EOT bestFoundSoFar;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue