Adjust Crossover/Selection classes to annotations
This commit is contained in:
parent
c4a3f41924
commit
c84cd9e014
@ -5,24 +5,21 @@ import eva2.optimization.individuals.InterfaceESIndividual;
|
||||
import eva2.optimization.population.Population;
|
||||
import eva2.optimization.problems.InterfaceOptimizationProblem;
|
||||
import eva2.tools.math.RNG;
|
||||
import eva2.util.annotation.Description;
|
||||
|
||||
/**
|
||||
* Default 1-point-Crossover on InterfaceESIndividual instances.
|
||||
* <p/>
|
||||
* User: streiche
|
||||
* Date: 25.03.2003
|
||||
* Time: 11:16:39
|
||||
* To change this template use Options | File Templates.
|
||||
*/
|
||||
@Description("This is a discrete one-point crossover between m ES individuals.")
|
||||
public class CrossoverESDefault implements InterfaceCrossover, java.io.Serializable {
|
||||
private InterfaceOptimizationProblem m_OptimizationProblem;
|
||||
private InterfaceOptimizationProblem optimizationProblem;
|
||||
|
||||
public CrossoverESDefault() {
|
||||
|
||||
}
|
||||
|
||||
public CrossoverESDefault(CrossoverESDefault c) {
|
||||
this.m_OptimizationProblem = c.m_OptimizationProblem;
|
||||
this.optimizationProblem = c.optimizationProblem;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -121,7 +118,7 @@ public class CrossoverESDefault implements InterfaceCrossover, java.io.Serializa
|
||||
*/
|
||||
@Override
|
||||
public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
|
||||
this.m_OptimizationProblem = opt;
|
||||
this.optimizationProblem = opt;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -129,9 +126,6 @@ public class CrossoverESDefault implements InterfaceCrossover, java.io.Serializa
|
||||
return this.getName();
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************
|
||||
* These are for GUI
|
||||
*/
|
||||
/**
|
||||
* This method allows the CommonJavaObjectEditorPanel to read the
|
||||
* name to the current object.
|
||||
@ -141,13 +135,4 @@ public class CrossoverESDefault implements InterfaceCrossover, java.io.Serializa
|
||||
public String getName() {
|
||||
return "ES discrete one-point crossover";
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns a global info string
|
||||
*
|
||||
* @return description
|
||||
*/
|
||||
public static String globalInfo() {
|
||||
return "This is a discrete one-point crossover between m ES individuals.";
|
||||
}
|
||||
}
|
||||
|
@ -5,12 +5,15 @@ import eva2.optimization.operator.selection.probability.InterfaceSelectionProbab
|
||||
import eva2.optimization.operator.selection.probability.SelProbStandard;
|
||||
import eva2.optimization.population.Population;
|
||||
import eva2.tools.math.RNG;
|
||||
import eva2.util.annotation.Description;
|
||||
|
||||
/**
|
||||
* The RouletteWheel selection requires a selection probability calculator.
|
||||
* In case of multiple fitness values the selection
|
||||
* criteria is selected randomly for each selection event.
|
||||
*/
|
||||
@Description("This method chooses individuals similar to the roulette wheel. The chance for each individual to be selected depends on the selection probability." +
|
||||
"This is a single objective selecting method, it select with respect to a random criterion.")
|
||||
public class SelectXProbRouletteWheel implements InterfaceSelection, java.io.Serializable {
|
||||
|
||||
private transient TreeElement[] treeRoot = null;
|
||||
@ -152,9 +155,6 @@ public class SelectXProbRouletteWheel implements InterfaceSelection, java.io.Ser
|
||||
return this.selectFrom(avaiablePartners, size);
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************
|
||||
* These are for GUI
|
||||
*/
|
||||
/**
|
||||
* This method allows the CommonJavaObjectEditorPanel to read the
|
||||
* name to the current object.
|
||||
@ -165,16 +165,6 @@ public class SelectXProbRouletteWheel implements InterfaceSelection, java.io.Ser
|
||||
return "Roulette Wheel Selection";
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns a global info string
|
||||
*
|
||||
* @return description
|
||||
*/
|
||||
public static String globalInfo() {
|
||||
return "This method chooses individuals similar to the roulette wheel. The chance for each individual to be selected depends on the selection probability." +
|
||||
"This is a single objective selecting method, it select with respect to a random criterion.";
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will set the normation method that is to be used.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user