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:
jhumeau 2010-03-24 10:25:33 +00:00
commit dd66b5e4bd
105 changed files with 3950 additions and 3924 deletions

View file

@ -62,7 +62,7 @@ public:
*/ */
virtual bool operator() (EOT & _solution) { virtual bool operator() (EOT & _solution) {
if(_solution.invalid()) if (_solution.invalid())
fullEval(_solution); fullEval(_solution);
// initialization of the parameter of the search (for example fill empty the tabu list) // initialization of the parameter of the search (for example fill empty the tabu list)
@ -77,7 +77,7 @@ public:
// explore the neighborhood of the solution // explore the neighborhood of the solution
searchExplorer(_solution); searchExplorer(_solution);
// if a solution in the neighborhood can be accepted // if a solution in the neighborhood can be accepted
if (searchExplorer.accept(_solution)){ if (searchExplorer.accept(_solution)) {
searchExplorer.move(_solution); searchExplorer.move(_solution);
searchExplorer.moveApplied(true); searchExplorer.moveApplied(true);
} }

View file

@ -55,7 +55,7 @@ public :
* @param _cont a continuator * @param _cont a continuator
* @param _interval frequency to compute statistical operators * @param _interval frequency to compute statistical operators
*/ */
moCheckpoint(moContinuator<Neighborhood>& _cont, unsigned int _interval=1):interval(_interval), counter(0){ moCheckpoint(moContinuator<Neighborhood>& _cont, unsigned int _interval=1):interval(_interval), counter(0) {
continuators.push_back(&_cont); continuators.push_back(&_cont);
} }
@ -96,7 +96,7 @@ public :
* @param _sol the corresponding solution * @param _sol the corresponding solution
*/ */
virtual void init(EOT& _sol) { virtual void init(EOT& _sol) {
for(unsigned i = 0; i < continuators.size(); ++i) for (unsigned i = 0; i < continuators.size(); ++i)
continuators[i]->init(_sol); continuators[i]->init(_sol);
} }
@ -116,8 +116,8 @@ public :
unsigned i; unsigned i;
bool bContinue = true; bool bContinue = true;
for (i = 0; i < stats.size(); ++i){ for (i = 0; i < stats.size(); ++i) {
if(counter % interval == 0) if (counter % interval == 0)
(*stats[i])(_sol); (*stats[i])(_sol);
counter++; counter++;
} }
@ -139,7 +139,7 @@ public :
* last call of statistic operators, monitors and updaters * last call of statistic operators, monitors and updaters
* @param _sol reference of the solution * @param _sol reference of the solution
*/ */
void lastCall(EOT& _sol){ void lastCall(EOT& _sol) {
unsigned int i; unsigned int i;
for (i = 0; i < stats.size(); ++i) for (i = 0; i < stats.size(); ++i)
stats[i]->lastCall(_sol); stats[i]->lastCall(_sol);

View file

@ -51,13 +51,13 @@ public:
* Init Continuator parameters * Init Continuator parameters
* @param _solution the related solution * @param _solution the related solution
*/ */
virtual void init(EOT& _solution){}; virtual void init(EOT& _solution) {};
/** /**
* Last Call to terminate the checkpoint * Last Call to terminate the checkpoint
* @param _solution the related solution * @param _solution the related solution
*/ */
virtual void lastCall(EOT& _solution){}; virtual void lastCall(EOT& _solution) {};
}; };
#endif #endif

View file

@ -83,7 +83,9 @@ public :
/** /**
* @return name of the class * @return name of the class
*/ */
virtual std::string className(void) const { return "moCounterMonitorSaver"; } virtual std::string className(void) const {
return "moCounterMonitorSaver";
}
private : private :
/** interval and counter value */ /** interval and counter value */

View file

@ -54,20 +54,22 @@ public :
* @param _dist a distance * @param _dist a distance
* @param _ref the reference solution * @param _ref the reference solution
*/ */
moDistanceStat(eoDistance<EOT> & _dist, EOT & _ref): moStat<EOT, T>(0, "distance"), dist(_dist), refSolution(_ref){} moDistanceStat(eoDistance<EOT> & _dist, EOT & _ref): moStat<EOT, T>(0, "distance"), dist(_dist), refSolution(_ref) {}
/** /**
* Compute distance between a solution and the reference solution * Compute distance between a solution and the reference solution
* @param _sol a solution * @param _sol a solution
*/ */
virtual void operator()(EOT & _sol){ virtual void operator()(EOT & _sol) {
value() = dist(_sol, refSolution); value() = dist(_sol, refSolution);
} }
/** /**
* @return name of the class * @return name of the class
*/ */
virtual std::string className(void) const { return "moDistanceStat"; } virtual std::string className(void) const {
return "moDistanceStat";
}
private: private:
/** the distance */ /** the distance */

View file

@ -54,7 +54,7 @@ public :
* @param _description a description of the stat * @param _description a description of the stat
*/ */
moFitnessStat(std::string _description = "fitness"): moFitnessStat(std::string _description = "fitness"):
moStat<EOT, Fitness>(Fitness(), _description){} moStat<EOT, Fitness>(Fitness(), _description) {}
/** /**
* store fitness value * store fitness value
@ -68,7 +68,9 @@ public :
/** /**
* @return the name of the class * @return the name of the class
*/ */
virtual std::string className(void) const { return "moFitnessStat"; } virtual std::string className(void) const {
return "moFitnessStat";
}
}; };
#endif #endif

View file

@ -55,20 +55,22 @@ public :
* @param _nhStat a neighborhoodStat * @param _nhStat a neighborhoodStat
*/ */
moMaxNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat): moMaxNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat):
moStat<EOT, Fitness>(Fitness(), "min"), nhStat(_nhStat){} moStat<EOT, Fitness>(Fitness(), "min"), nhStat(_nhStat) {}
/** /**
* Set the max fitness in the neighborhood * Set the max fitness in the neighborhood
* @param _sol the corresponding solution * @param _sol the corresponding solution
*/ */
virtual void operator()(EOT & _sol){ virtual void operator()(EOT & _sol) {
value() = nhStat.getMax(); value() = nhStat.getMax();
} }
/** /**
* @return the class name * @return the class name
*/ */
virtual std::string className(void) const { return "moMaxNeighborStat"; } virtual std::string className(void) const {
return "moMaxNeighborStat";
}
private: private:
/** moNeighborhoodStat */ /** moNeighborhoodStat */

View file

@ -55,20 +55,22 @@ public :
* @param _nhStat a neighborhoodStat * @param _nhStat a neighborhoodStat
*/ */
moMinNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat): moMinNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat):
moStat<EOT, Fitness>(Fitness(), "min"), nhStat(_nhStat){} moStat<EOT, Fitness>(Fitness(), "min"), nhStat(_nhStat) {}
/** /**
* Set the worst fitness in the neighborhood * Set the worst fitness in the neighborhood
* @param _sol the corresponding solution * @param _sol the corresponding solution
*/ */
virtual void operator()(EOT & _sol){ virtual void operator()(EOT & _sol) {
value() = nhStat.getMin(); value() = nhStat.getMin();
} }
/** /**
* @return the class name * @return the class name
*/ */
virtual std::string className(void) const { return "moMinNeighborStat"; } virtual std::string className(void) const {
return "moMinNeighborStat";
}
private: private:
/** moNeighborhoodStat */ /** moNeighborhoodStat */

View file

@ -58,20 +58,22 @@ public :
* @param _nhStat a neighborhoodStat * @param _nhStat a neighborhoodStat
*/ */
moNbInfNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat): moNbInfNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat):
moStat<EOT, unsigned>(0, "nb inf"), nhStat(_nhStat){} moStat<EOT, unsigned>(0, "nb inf"), nhStat(_nhStat) {}
/** /**
* Set the number of solutions in the neighborhood with (strictly) lower fitness than the current solution * Set the number of solutions in the neighborhood with (strictly) lower fitness than the current solution
* @param _sol the corresponding solution * @param _sol the corresponding solution
*/ */
virtual void operator()(EOT & _sol){ virtual void operator()(EOT & _sol) {
value() = nhStat.getNbInf(); value() = nhStat.getNbInf();
} }
/** /**
* @return the class name * @return the class name
*/ */
virtual std::string className(void) const { return "moNbInfNeighborStat"; } virtual std::string className(void) const {
return "moNbInfNeighborStat";
}
private: private:
/** moNeighborhoodStat */ /** moNeighborhoodStat */

View file

@ -58,20 +58,22 @@ public :
* @param _nhStat a neighborhoodStat * @param _nhStat a neighborhoodStat
*/ */
moNbSupNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat): moNbSupNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat):
moStat<EOT, unsigned>(0, "nb sup"), nhStat(_nhStat){} moStat<EOT, unsigned>(0, "nb sup"), nhStat(_nhStat) {}
/** /**
* Set the number of solutions in the neighborhood with better fitness than the current solution * Set the number of solutions in the neighborhood with better fitness than the current solution
* @param _sol the corresponding solution * @param _sol the corresponding solution
*/ */
virtual void operator()(EOT & _sol){ virtual void operator()(EOT & _sol) {
value() = nhStat.getNbSup(); value() = nhStat.getNbSup();
} }
/** /**
* @return the class name * @return the class name
*/ */
virtual std::string className(void) const { return "moNbSupNeighborStat"; } virtual std::string className(void) const {
return "moNbSupNeighborStat";
}
private: private:
/** moNeighborhoodStat */ /** moNeighborhoodStat */

View file

@ -73,12 +73,12 @@ public :
* Compute classical statistics of a solution's neighborhood * Compute classical statistics of a solution's neighborhood
* @param _solution the corresponding solution * @param _solution the corresponding solution
*/ */
virtual void operator()(EOT & _solution){ virtual void operator()(EOT & _solution) {
Neighbor current ; Neighbor current ;
Neighbor best ; Neighbor best ;
Neighbor lowest ; Neighbor lowest ;
if(neighborhood.hasNeighbor(_solution)){ if (neighborhood.hasNeighbor(_solution)) {
//init the first neighbor //init the first neighbor
neighborhood.init(_solution, current); neighborhood.init(_solution, current);
@ -141,7 +141,7 @@ public :
else else
sd = 0.0; sd = 0.0;
} }
else{ else {
//if _solution hasn't neighbor, //if _solution hasn't neighbor,
value() = false; value() = false;
} }
@ -150,49 +150,49 @@ public :
/** /**
* @return the worst fitness value found in the neighborhood * @return the worst fitness value found in the neighborhood
*/ */
Fitness getMin(){ Fitness getMin() {
return min; return min;
} }
/** /**
* @return the best fitness value found in the neighborhood * @return the best fitness value found in the neighborhood
*/ */
Fitness getMax(){ Fitness getMax() {
return max; return max;
} }
/** /**
* @return the mean fitness value of the neighborhood * @return the mean fitness value of the neighborhood
*/ */
double getMean(){ double getMean() {
return mean; return mean;
} }
/** /**
* @return the standard deviation value of the neighborhood * @return the standard deviation value of the neighborhood
*/ */
double getSD(){ double getSD() {
return sd; return sd;
} }
/** /**
* @return the size of the neighborhood * @return the size of the neighborhood
*/ */
unsigned getSize(){ unsigned getSize() {
return nb; return nb;
} }
/** /**
* @return the number of neighbors having a better fitness than the current solution * @return the number of neighbors having a better fitness than the current solution
*/ */
unsigned getNbSup(){ unsigned getNbSup() {
return nbSup; return nbSup;
} }
/** /**
* @return the number of neighbors having the same fitness than the current solution * @return the number of neighbors having the same fitness than the current solution
*/ */
unsigned getNbEqual(){ unsigned getNbEqual() {
return nbEqual; return nbEqual;
} }

View file

@ -57,20 +57,22 @@ public :
* @param _nhStat a neighborhoodStat * @param _nhStat a neighborhoodStat
*/ */
moNeutralDegreeNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat): moNeutralDegreeNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat):
moStat<EOT, unsigned>(0, "neutral degree"), nhStat(_nhStat){} moStat<EOT, unsigned>(0, "neutral degree"), nhStat(_nhStat) {}
/** /**
* Set the neutral degree of the solution which is the number of solutions in the neighborhood with equals fitness * Set the neutral degree of the solution which is the number of solutions in the neighborhood with equals fitness
* @param _sol the corresponding solution * @param _sol the corresponding solution
*/ */
virtual void operator()(EOT & _sol){ virtual void operator()(EOT & _sol) {
value() = nhStat.getNbEqual(); value() = nhStat.getNbEqual();
} }
/** /**
* @return the class name * @return the class name
*/ */
virtual std::string className(void) const { return "moNeutralDegreeNeighborStat"; } virtual std::string className(void) const {
return "moNeutralDegreeNeighborStat";
}
private: private:
/** moNeighborhoodStat */ /** moNeighborhoodStat */

View file

@ -55,13 +55,13 @@ public :
* @param _nhStat a neighborhoodStat * @param _nhStat a neighborhoodStat
*/ */
moSecondMomentNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat): moSecondMomentNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat):
moStat<EOT, std::pair<double, double> >(std::make_pair(0.0,0.0), "average and stdev"), nhStat(_nhStat){} moStat<EOT, std::pair<double, double> >(std::make_pair(0.0,0.0), "average and stdev"), nhStat(_nhStat) {}
/** /**
* Set the average and the standard deviation of fitness in the neighborhood * Set the average and the standard deviation of fitness in the neighborhood
* @param _sol the corresponding solution * @param _sol the corresponding solution
*/ */
virtual void operator()(EOT & _sol){ virtual void operator()(EOT & _sol) {
value().first = nhStat.getMean(); value().first = nhStat.getMean();
value().second = nhStat.getSD(); value().second = nhStat.getSD();
} }
@ -69,7 +69,9 @@ public :
/** /**
* @return the class name * @return the class name
*/ */
virtual std::string className(void) const { return "moSecondMomentNeighborStat"; } virtual std::string className(void) const {
return "moSecondMomentNeighborStat";
}
private: private:
/** moNeighborhoodStat */ /** moNeighborhoodStat */

View file

@ -56,20 +56,22 @@ public :
* @param _nhStat a neighborhoodStat * @param _nhStat a neighborhoodStat
*/ */
moSizeNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat): moSizeNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat):
moStat<EOT, unsigned>(0, "size"), nhStat(_nhStat){} moStat<EOT, unsigned>(0, "size"), nhStat(_nhStat) {}
/** /**
* Set the number of solutions in the neighborhood * Set the number of solutions in the neighborhood
* @param _sol the corresponding solution * @param _sol the corresponding solution
*/ */
virtual void operator()(EOT & _sol){ virtual void operator()(EOT & _sol) {
value() = nhStat.getSize(); value() = nhStat.getSize();
} }
/** /**
* @return the class name * @return the class name
*/ */
virtual std::string className(void) const { return "moSizeNeighborStat"; } virtual std::string className(void) const {
return "moSizeNeighborStat";
}
private: private:
/** moNeighborhoodStat */ /** moNeighborhoodStat */

View file

@ -53,20 +53,20 @@ public :
* @param _description a description of the parameter * @param _description a description of the parameter
*/ */
moSolutionStat(std::string _description = "solution"): moSolutionStat(std::string _description = "solution"):
moStat<EOT, EOT>(EOT(), _description){} moStat<EOT, EOT>(EOT(), _description) {}
/** /**
* Set the solution by copy * Set the solution by copy
* @param _sol the corresponding solution * @param _sol the corresponding solution
*/ */
virtual void operator()(EOT & _sol){ virtual void operator()(EOT & _sol) {
value() = _sol; value() = _sol;
} }
/** /**
* @return name of the class * @return name of the class
*/ */
virtual std::string className(void) const{ virtual std::string className(void) const {
return "moSolutionStat"; return "moSolutionStat";
} }
}; };

View file

@ -53,12 +53,12 @@ public:
* @param _description a description of the parameter * @param _description a description of the parameter
*/ */
moStat(T _value, std::string _description): moStat(T _value, std::string _description):
eoValueParam<T>(_value, _description){} eoValueParam<T>(_value, _description) {}
/** /**
* @return name of the class * @return name of the class
*/ */
virtual std::string className(void) const{ virtual std::string className(void) const {
return "moStat"; return "moStat";
} }
}; };

View file

@ -57,7 +57,7 @@ public:
/** /**
* @return name of the class * @return name of the class
*/ */
virtual std::string className(void) const{ virtual std::string className(void) const {
return "moStatBase"; return "moStatBase";
} }
}; };

Some files were not shown because too many files have changed in this diff Show more