diff --git a/trunk/paradiseo-mo/src/continuator/moBestSoFarStat.h b/trunk/paradiseo-mo/src/continuator/moBestSoFarStat.h index 04f68af38..06d835ed1 100644 --- a/trunk/paradiseo-mo/src/continuator/moBestSoFarStat.h +++ b/trunk/paradiseo-mo/src/continuator/moBestSoFarStat.h @@ -76,8 +76,6 @@ public : return "moBestSoFarStat"; } -private: - moStat & stat; }; #endif diff --git a/trunk/paradiseo-mo/src/continuator/moCounterStat.h b/trunk/paradiseo-mo/src/continuator/moCounterStat.h index 5e28549c1..b3302aa36 100644 --- a/trunk/paradiseo-mo/src/continuator/moCounterStat.h +++ b/trunk/paradiseo-mo/src/continuator/moCounterStat.h @@ -50,7 +50,6 @@ public : * Default Constructor */ moCounterStat(): moStat(0, "counter") { - counter = 0; } /** @@ -58,7 +57,6 @@ public : * @param _sol a solution */ virtual void init(EOT & _sol) { - counter = 0; value() = 0; } @@ -67,8 +65,7 @@ public : * @param _sol a solution */ virtual void operator()(EOT & _sol) { - value() = counter; - counter++; + value() = value() + 1; } /** @@ -78,8 +75,6 @@ public : return "moCounterStat"; } -private: - unsigned int counter; }; #endif diff --git a/trunk/paradiseo-mo/src/continuator/moDistanceStat.h b/trunk/paradiseo-mo/src/continuator/moDistanceStat.h index beaa79931..0b11498ab 100644 --- a/trunk/paradiseo-mo/src/continuator/moDistanceStat.h +++ b/trunk/paradiseo-mo/src/continuator/moDistanceStat.h @@ -56,6 +56,14 @@ public : */ moDistanceStat(eoDistance & _dist, EOT & _ref): moStat(0, "distance"), dist(_dist), refSolution(_ref) {} + /** + * Compute distance between the first solution and the reference solution + * @param _sol the first solution + */ + virtual void init(EOT & _sol) { + value() = dist(_sol, refSolution); + } + /** * Compute distance between a solution and the reference solution * @param _sol a solution diff --git a/trunk/paradiseo-mo/src/continuator/moFitnessStat.h b/trunk/paradiseo-mo/src/continuator/moFitnessStat.h index d3919ffab..6d8227d02 100644 --- a/trunk/paradiseo-mo/src/continuator/moFitnessStat.h +++ b/trunk/paradiseo-mo/src/continuator/moFitnessStat.h @@ -56,6 +56,15 @@ public : moFitnessStat(std::string _description = "fitness"): moStat(Fitness(), _description) {} + /** + * store the initial fitness value + * @param _sol the initial solution + */ + virtual void init(EOT & _sol) + { + value() = _sol.fitness(); + } + /** * store fitness value * @param _sol the corresponding solution diff --git a/trunk/paradiseo-mo/src/continuator/moMaxNeighborStat.h b/trunk/paradiseo-mo/src/continuator/moMaxNeighborStat.h index 586507202..b6e5b27bd 100644 --- a/trunk/paradiseo-mo/src/continuator/moMaxNeighborStat.h +++ b/trunk/paradiseo-mo/src/continuator/moMaxNeighborStat.h @@ -57,6 +57,14 @@ public : moMaxNeighborStat(moNeighborhoodStat & _nhStat): moStat(Fitness(), "min"), nhStat(_nhStat) {} + /** + * Set the max fitness in the neighborhood + * @param _sol the first solution + */ + virtual void init(EOT & _sol) { + value() = nhStat.getMax(); + } + /** * Set the max fitness in the neighborhood * @param _sol the corresponding solution diff --git a/trunk/paradiseo-mo/src/continuator/moMinNeighborStat.h b/trunk/paradiseo-mo/src/continuator/moMinNeighborStat.h index b5594bda2..f91360714 100644 --- a/trunk/paradiseo-mo/src/continuator/moMinNeighborStat.h +++ b/trunk/paradiseo-mo/src/continuator/moMinNeighborStat.h @@ -57,6 +57,14 @@ public : moMinNeighborStat(moNeighborhoodStat & _nhStat): moStat(Fitness(), "min"), nhStat(_nhStat) {} + /** + * Set the worst fitness in the neighborhood + * @param _sol the first solution + */ + virtual void init(EOT & _sol) { + value() = nhStat.getMin(); + } + /** * Set the worst fitness in the neighborhood * @param _sol the corresponding solution diff --git a/trunk/paradiseo-mo/src/continuator/moNbInfNeighborStat.h b/trunk/paradiseo-mo/src/continuator/moNbInfNeighborStat.h index 0dae01139..9910bbd99 100644 --- a/trunk/paradiseo-mo/src/continuator/moNbInfNeighborStat.h +++ b/trunk/paradiseo-mo/src/continuator/moNbInfNeighborStat.h @@ -60,6 +60,14 @@ public : moNbInfNeighborStat(moNeighborhoodStat & _nhStat): moStat(0, "nb inf"), nhStat(_nhStat) {} + /** + * Set the number of solutions in the neighborhood with (strictly) lower fitness than the current solution + * @param _sol the first solution + */ + virtual void init(EOT & _sol) { + value() = nhStat.getNbInf(); + } + /** * Set the number of solutions in the neighborhood with (strictly) lower fitness than the current solution * @param _sol the corresponding solution diff --git a/trunk/paradiseo-mo/src/continuator/moNbSupNeighborStat.h b/trunk/paradiseo-mo/src/continuator/moNbSupNeighborStat.h index 5a856c66d..b5f62a0f1 100644 --- a/trunk/paradiseo-mo/src/continuator/moNbSupNeighborStat.h +++ b/trunk/paradiseo-mo/src/continuator/moNbSupNeighborStat.h @@ -60,6 +60,14 @@ public : moNbSupNeighborStat(moNeighborhoodStat & _nhStat): moStat(0, "nb sup"), nhStat(_nhStat) {} + /** + * Set the number of solutions in the neighborhood with better fitness than the current solution + * @param _sol the first solution + */ + virtual void init(EOT & _sol) { + value() = nhStat.getNbSup(); + } + /** * Set the number of solutions in the neighborhood with better fitness than the current solution * @param _sol the corresponding solution diff --git a/trunk/paradiseo-mo/src/continuator/moNeighborhoodStat.h b/trunk/paradiseo-mo/src/continuator/moNeighborhoodStat.h index 1d6b3a0a2..ab10174fb 100644 --- a/trunk/paradiseo-mo/src/continuator/moNeighborhoodStat.h +++ b/trunk/paradiseo-mo/src/continuator/moNeighborhoodStat.h @@ -70,6 +70,14 @@ public : solNeighborComparator(_solNeighborComparator) {} + /** + * Compute classical statistics of the first solution's neighborhood + * @param _solution the first solution + */ + virtual void init(EOT & _solution) { + operator()(_solution); + } + /** * Compute classical statistics of a solution's neighborhood * @param _solution the corresponding solution diff --git a/trunk/paradiseo-mo/src/continuator/moNeutralDegreeNeighborStat.h b/trunk/paradiseo-mo/src/continuator/moNeutralDegreeNeighborStat.h index 55f260d22..ba4e5fb3b 100644 --- a/trunk/paradiseo-mo/src/continuator/moNeutralDegreeNeighborStat.h +++ b/trunk/paradiseo-mo/src/continuator/moNeutralDegreeNeighborStat.h @@ -59,6 +59,14 @@ public : moNeutralDegreeNeighborStat(moNeighborhoodStat & _nhStat): moStat(0, "neutral degree"), nhStat(_nhStat) {} + /** + * Set the neutral degree of the solution which is the number of solutions in the neighborhood with equals fitness + * @param _sol the first solution + */ + virtual void init(EOT & _sol) { + value() = nhStat.getNbEqual(); + } + /** * Set the neutral degree of the solution which is the number of solutions in the neighborhood with equals fitness * @param _sol the corresponding solution diff --git a/trunk/paradiseo-mo/src/continuator/moSecondMomentNeighborStat.h b/trunk/paradiseo-mo/src/continuator/moSecondMomentNeighborStat.h index dba14eeed..9d79ba5d1 100644 --- a/trunk/paradiseo-mo/src/continuator/moSecondMomentNeighborStat.h +++ b/trunk/paradiseo-mo/src/continuator/moSecondMomentNeighborStat.h @@ -57,6 +57,15 @@ public : moSecondMomentNeighborStat(moNeighborhoodStat & _nhStat): moStat >(std::make_pair(0.0,0.0), "average and stdev"), nhStat(_nhStat) {} + /** + * Set the average and the standard deviation of fitness in the neighborhood + * @param _sol the first solution + */ + virtual void init(EOT & _sol) { + value().first = nhStat.getMean(); + value().second = nhStat.getSD(); + } + /** * Set the average and the standard deviation of fitness in the neighborhood * @param _sol the corresponding solution diff --git a/trunk/paradiseo-mo/src/continuator/moSizeNeighborStat.h b/trunk/paradiseo-mo/src/continuator/moSizeNeighborStat.h index d246da1c9..1f17710e5 100644 --- a/trunk/paradiseo-mo/src/continuator/moSizeNeighborStat.h +++ b/trunk/paradiseo-mo/src/continuator/moSizeNeighborStat.h @@ -58,6 +58,14 @@ public : moSizeNeighborStat(moNeighborhoodStat & _nhStat): moStat(0, "size"), nhStat(_nhStat) {} + /** + * Set the number of solutions in the neighborhood + * @param _sol the first solution + */ + virtual void init(EOT & _sol) { + value() = nhStat.getSize(); + } + /** * Set the number of solutions in the neighborhood * @param _sol the corresponding solution diff --git a/trunk/paradiseo-mo/src/continuator/moSolutionStat.h b/trunk/paradiseo-mo/src/continuator/moSolutionStat.h index f8b5b9e07..2b488dcfa 100644 --- a/trunk/paradiseo-mo/src/continuator/moSolutionStat.h +++ b/trunk/paradiseo-mo/src/continuator/moSolutionStat.h @@ -55,6 +55,14 @@ public : moSolutionStat(std::string _description = "solution"): moStat(EOT(), _description) {} + /** + * Initialization the solution by copy + * @param _sol the intial solution + */ + virtual void init(EOT & _sol) { + value() = _sol; + } + /** * Set the solution by copy * @param _sol the corresponding solution diff --git a/trunk/paradiseo-mo/src/continuator/moStatFromStat.h b/trunk/paradiseo-mo/src/continuator/moStatFromStat.h index 1fad04966..f1932dde6 100644 --- a/trunk/paradiseo-mo/src/continuator/moStatFromStat.h +++ b/trunk/paradiseo-mo/src/continuator/moStatFromStat.h @@ -52,11 +52,21 @@ public : moStatFromStat(moStat & _stat): moStat(0, _stat.description()), stat(_stat) { } + /** + * The value of this stat is a copy of the value of the initial stat + * @param _sol a solution + */ + virtual void init(EOT & _sol) { + std::cout << "copy init" << stat.value() << std::endl; + value() = stat.value(); + } + /** * The value of this stat is a copy of the value of the initial stat * @param _sol a solution */ virtual void operator()(EOT & _sol) { + std::cout << "copy " << stat.value() << std::endl; value() = stat.value(); } diff --git a/trunk/paradiseo-mo/src/continuator/moVectorMonitor.h b/trunk/paradiseo-mo/src/continuator/moVectorMonitor.h index 049b8a500..13f37c8ff 100644 --- a/trunk/paradiseo-mo/src/continuator/moVectorMonitor.h +++ b/trunk/paradiseo-mo/src/continuator/moVectorMonitor.h @@ -84,6 +84,8 @@ public: * @return this monitor (sorry I don't why, but it is like this in EO) */ eoMonitor& operator()(void) { + std::cout << "je passe vector MOnitor" << std::endl; + if (doubleParam != NULL) valueVec.push_back(doubleParam->value()); else