Browse files

Updated LessThanEqualToFitness to ensure output is correct.

  • Loading branch information...
1 parent 928dd69 commit 8da84ceea556529950846ee9e1a9b2f07464b3ac @primaryobjects committed Mar 4, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 AIProgrammer.Fitness/Concrete/LessThanEqualToFitness.cs
View
6 AIProgrammer.Fitness/Concrete/LessThanEqualToFitness.cs
@@ -55,6 +55,7 @@ protected override double GetFitnessMethod(string program)
}
else
{
+ penalty += 10;
return 0;
}
},
@@ -68,6 +69,11 @@ protected override double GetFitnessMethod(string program)
}
_console.Append((char)b);
+
+ if (state != 1)
+ {
+ penalty += 10;
+ }
});
_bf.Run(_maxIterationCount);
}

0 comments on commit 8da84ce

Please sign in to comment.