Fix nelderMead

This commit is contained in:
Fabian Becker 2015-12-05 17:16:10 +01:00
parent c7fc9b9d67
commit 2626204579
3 changed files with 5 additions and 10 deletions

View File

@ -10,7 +10,7 @@ public interface InterfaceDataTypeInteger {
/**
* This method allows you to request a certain amount of int data
*
* @param length The lenght of the int[] that is to be optimized
* @param length The length of the int[] that is to be optimized
*/
void setIntegerDataLength(int length);

View File

@ -152,7 +152,7 @@ public class SolutionHistogram {
* This resets the arity.
*
* @param pop
* @param hist
* @param crit
*/
public void updateFrom(Population pop, int crit) {
SolutionHistogram.createFitNormHistogram(pop, this, crit);
@ -176,10 +176,6 @@ public class SolutionHistogram {
return res;
}
// public void updateFrom(Population pop, double accuracy) {
//
// }
public double getScore() {
double sc = 0;
if (sum() > 0) {

View File

@ -28,7 +28,6 @@ public class NelderMeadSimplex extends AbstractOptimizer implements Serializable
// simulating the generational cycle. Set rather small (eg 5) for use as local search, higher for global search (eg 50)
private int generationCycle = 50;
private int fitIndex = 0; // choose criterion for multi objective functions
private AbstractOptimizationProblem optimizationProblem;
private boolean checkConstraints = true;
public NelderMeadSimplex() {
@ -219,7 +218,7 @@ public class NelderMeadSimplex extends AbstractOptimizer implements Serializable
// this simulates the generational loop expected by some other modules
int evalCntStart = population.getFunctionCalls();
int evalsDone = 0;
optimizationProblem.evaluatePopulationStart(population);
((AbstractOptimizationProblem)this.optimizationProblem).evaluatePopulationStart(population);
do {
AbstractEAIndividual ind = simplexStep(population);
if (ind != null) { //Verbesserung gefunden
@ -245,7 +244,7 @@ public class NelderMeadSimplex extends AbstractOptimizer implements Serializable
}
evalsDone = population.getFunctionCalls() - evalCntStart;
} while (evalsDone < generationCycle);
optimizationProblem.evaluatePopulationEnd(population);
((AbstractOptimizationProblem)optimizationProblem).evaluatePopulationEnd(population);
this.population.incrGeneration();
}