53 #if !defined(LIBEVOCOSM_SCALER_H)
54 #define LIBEVOCOSM_SCALER_H
71 template <
class OrganismType>
95 virtual void scale_fitness(vector<OrganismType> & a_population) = 0;
104 template <
class OrganismType>
125 template <
class OrganismType>
134 : m_fitness_multiple(a_fitness_multiple)
154 if (stats.
getMin() > ((m_fitness_multiple * stats.
getMean() - stats.
getMax()) / (m_fitness_multiple - 1.0)))
158 slope = (m_fitness_multiple - 1.0) * stats.
getMean() / delta;
165 slope = stats.
getMean() / delta;
170 for (
int n = 0; n < a_population.size(); ++n)
171 a_population[n].fitness = slope * a_population[n].fitness + intercept;
175 double m_fitness_multiple;
184 template <
class OrganismType>
207 for (
int n = 0; n < a_population.size(); ++n)
208 a_population[n].fitness = stats.
getMin();
218 template <
class OrganismType>
246 for (
int n = 0; n < a_population.size(); ++n)
247 a_population[n].fitness = pow((m_a * a_population[n].fitness + m_b),m_power);
261 template <
class OrganismType>
270 : m_a(a_a), m_b(a_b), m_c(a_c)
283 for (
int n = 0; n < a_population.size(); ++n)
285 double f = a_population[n].fitness;
286 a_population[n].fitness = m_a * pow(f,2.0) + m_b * f + m_c;
301 template <
class OrganismType>
326 double sigma2 = 2.0 * stats.
getSigma();
331 for (
int n = 0; n < a_population.size(); ++n)
332 a_population[n].fitness = 1.0;
336 for (
int n = 0; n < a_population.size(); ++n)
339 a_population[n].fitness = (1.0 + a_population[n].fitness / stats.mean) / sigma2;
342 if (a_population[n].fitness < 0.1)
343 a_population[n].fitness = 0.1;