public double CalculateFitness()
{
double threshold = BoxesScore.EDGE_LEN * BoxesScore.SQR_LEN;
double rmsd = Math.Sqrt(this.AccDistance / 75.0);
double fitness;
if (rmsd > threshold)
{
fitness = 0.0;
}
else
{
fitness = (((threshold - rmsd) * 100.0) / threshold) + (this.AccRange / 7.5);
}
return fitness;
}
public double CalculateScore(IMLMethod phenotype) { BoxTrialCase test = new BoxTrialCase(new Random()); TrialEvaluation eval = new TrialEvaluation(phenotype, test); for (int i = 0; i < 3; i++) { for (int j = 0; j < 25; j++) { IntPair targetPos = eval.Test.InitTestCase(i); IntPair actualPos = eval.Query(this.resolution); eval.Accumulate( CalcRealDistanceSquared(targetPos, actualPos), Math.Max(0.0, eval.MaxActivation - eval.MinActivation)); } } return(eval.CalculateFitness()); }