@@ -4,6 +4,7 @@ import eva2.optimization.population.InterfaceSolutionSet;
|
||||
import eva2.optimization.population.PopulationInterface;
|
||||
import eva2.problems.InterfaceOptimizationProblem;
|
||||
import eva2.util.annotation.Description;
|
||||
import eva2.util.annotation.Parameter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -24,8 +25,7 @@ public class GenerationTerminator implements InterfaceTerminator, Serializable {
|
||||
msg = "Not terminated.";
|
||||
}
|
||||
|
||||
public GenerationTerminator() {
|
||||
}
|
||||
public GenerationTerminator() {}
|
||||
|
||||
public GenerationTerminator(int gens) {
|
||||
maxGenerations = gens;
|
||||
@@ -37,8 +37,8 @@ public class GenerationTerminator implements InterfaceTerminator, Serializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerminated(PopulationInterface Pop) {
|
||||
if (maxGenerations < Pop.getGeneration()) {
|
||||
public boolean isTerminated(PopulationInterface pop) {
|
||||
if (maxGenerations < pop.getGeneration()) {
|
||||
msg = maxGenerations + " generations reached.";
|
||||
return true;
|
||||
}
|
||||
@@ -52,10 +52,10 @@ public class GenerationTerminator implements InterfaceTerminator, Serializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String ret = "Generations calls=" + maxGenerations;
|
||||
return ret;
|
||||
return "Generations calls = " + maxGenerations;
|
||||
}
|
||||
|
||||
@Parameter(description = "Number of generations to evaluate.")
|
||||
public void setGenerations(int x) {
|
||||
maxGenerations = x;
|
||||
}
|
||||
@@ -63,13 +63,4 @@ public class GenerationTerminator implements InterfaceTerminator, Serializable {
|
||||
public int getGenerations() {
|
||||
return maxGenerations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the tip text for this property
|
||||
*
|
||||
* @return tip text for this property
|
||||
*/
|
||||
public String generationsTipText() {
|
||||
return "number of generations to evaluate.";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user