Init version
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#include "KolchShindyalPhenToFitnessStrategy.h"
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <cmath>
|
||||
|
||||
double KolchShindyalPhenToFitnessStrategy::calculateFitness(Phenotype *phen){
|
||||
|
||||
double X = phen->getTraitByName("X").getTraitValueCont();
|
||||
double Xopt = phen->getTraitByName("Xopt").getTraitValueCont();
|
||||
double sigmaX = phen->getTraitByName("sigmaX").getTraitValueCont();
|
||||
|
||||
double ans = 1/(sqrt(2*M_PI)) * exp(-0.5*pow((X-Xopt)/sigmaX,2.));
|
||||
|
||||
return ans;
|
||||
}
|
||||
Reference in New Issue
Block a user