Minor cleanup

refs #61
This commit is contained in:
Fabian Becker 2015-12-22 15:14:04 +01:00
parent 0da8ebafdc
commit 3133652cd2
3 changed files with 7 additions and 11 deletions

View File

@ -3,6 +3,7 @@ package eva2.optimization.operator.selection;
import eva2.optimization.individuals.AbstractEAIndividual; import eva2.optimization.individuals.AbstractEAIndividual;
import eva2.optimization.population.Population; import eva2.optimization.population.Population;
import eva2.util.annotation.Description; import eva2.util.annotation.Description;
import eva2.util.annotation.Parameter;
/** /**
* Simple method to select all. * Simple method to select all.
@ -14,8 +15,7 @@ public class SelectAll implements InterfaceSelection, java.io.Serializable {
private boolean obeyDebsConstViolationPrinciple = true; private boolean obeyDebsConstViolationPrinciple = true;
public SelectAll() { public SelectAll() {}
}
public SelectAll(SelectAll a) { public SelectAll(SelectAll a) {
this.obeyDebsConstViolationPrinciple = a.obeyDebsConstViolationPrinciple; this.obeyDebsConstViolationPrinciple = a.obeyDebsConstViolationPrinciple;
@ -41,7 +41,7 @@ public class SelectAll implements InterfaceSelection, java.io.Serializable {
/** /**
* This method will select one Individual from the given * This method will select one Individual from the given
* Population in respect to the selection propability of the * Population in respect to the selection probability of the
* individual. * individual.
* *
* @param population The source population where to select from * @param population The source population where to select from
@ -105,6 +105,7 @@ public class SelectAll implements InterfaceSelection, java.io.Serializable {
* @param b The new state * @param b The new state
*/ */
@Override @Override
@Parameter(description = "Toggle the use of Deb's constraint violation principle.")
public void setObeyDebsConstViolationPrinciple(boolean b) { public void setObeyDebsConstViolationPrinciple(boolean b) {
this.obeyDebsConstViolationPrinciple = b; this.obeyDebsConstViolationPrinciple = b;
} }
@ -112,8 +113,4 @@ public class SelectAll implements InterfaceSelection, java.io.Serializable {
public boolean getObeyDebsConstViolationPrinciple() { public boolean getObeyDebsConstViolationPrinciple() {
return this.obeyDebsConstViolationPrinciple; return this.obeyDebsConstViolationPrinciple;
} }
public String obeyDebsConstViolationPrincipleToolTip() {
return "Toggle the use of Deb's coonstraint violation principle.";
}
} }

View File

@ -23,8 +23,7 @@ public class EvaluationTerminator implements InterfaceTerminator,
*/ */
protected int maxFitnessCalls = 1000; protected int maxFitnessCalls = 1000;
public EvaluationTerminator() { public EvaluationTerminator() {}
}
@Override @Override
public void initialize(InterfaceOptimizationProblem prob) { public void initialize(InterfaceOptimizationProblem prob) {

View File

@ -44,8 +44,8 @@ public class FitnessValueTerminator implements InterfaceTerminator,
} }
@Override @Override
public boolean isTerminated(PopulationInterface Pop) { public boolean isTerminated(PopulationInterface pop) {
double[] fit = Pop.getBestFitness(); double[] fit = pop.getBestFitness();
for (int i = 0; i < fit.length; i++) { for (int i = 0; i < fit.length; i++) {
if (fitnessValue[i] < fit[i]) { if (fitnessValue[i] < fit[i]) {
return false; return false;