public class SteadyState<T extends Chromosome> extends Crowder<T>
Modifier and Type | Class and Description |
---|---|
static class |
SteadyState.ReplacementStrategy
Replacement strategies
|
Operator.Statistics
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_REPLACEMENT_RATE
Default replacement rate
|
static SteadyState.ReplacementStrategy |
DEFAULT_REPLACEMENT_STRATEGY
Default replace strategy
|
static int |
DEFAULT_SELECTION_RATE
Defualt selection rate
|
protected int |
replacementRate
Replacement rate
|
protected SteadyState.ReplacementStrategy |
replacementStrategy
Replacement strategy
|
protected Selector<T> |
selector
Selector
|
random, statistics
biggerIsBetter, fitness, ga
Constructor and Description |
---|
SteadyState(int rr,
int sr,
Selector<T> selector,
AbstractStage<T>... stages)
Creates a SteadyState instance
|
SteadyState(Selector<T> selector,
AbstractStage<T>... stages)
Creates a SteadySate instance
|
Modifier and Type | Method and Description |
---|---|
SteadyState.ReplacementStrategy |
getReplacementPolicy()
Returns the replacement policy
|
int |
getReplacementRate()
Returns the replacement rate
|
int |
getSelectionRate()
Returns the selection rate
|
Selector<T> |
getSelector()
Returns the selector
|
protected void |
preselect(Population<T> in,
Population<T> out)
Preselection of individuals before processing.
|
protected void |
replace(Population<T> initial,
Population<T> preselected,
Population<T> evolved,
Population<T> out)
Implements the replacement policy.
|
void |
setBiggerIsBetter(boolean flag,
boolean recursively)
Deprecated.
|
void |
setReplacementPolicy(SteadyState.ReplacementStrategy replacement)
Sets the replacement policy
|
void |
setReplacementRate(int rate)
Sets the replacement rate
|
void |
setSelectionRate(int sr)
Sets the selection rate
|
void |
setSelector(Selector<T> selector)
Sets the selector
|
getBody, init, isElitist, process, setElitist, setFitness, similarity
getStatistics, updateStatistics
dispose, getFitness, isBiggerBetter, isFitnessChanged, setBiggerIsBetter, setFitness
public static final SteadyState.ReplacementStrategy DEFAULT_REPLACEMENT_STRATEGY
public static final int DEFAULT_SELECTION_RATE
public static final int DEFAULT_REPLACEMENT_RATE
protected Selector<T extends Chromosome> selector
protected SteadyState.ReplacementStrategy replacementStrategy
protected int replacementRate
public SteadyState(Selector<T> selector, AbstractStage<T>... stages)
selector
- selectorstages
- body stagespublic SteadyState(int rr, int sr, Selector<T> selector, AbstractStage<T>... stages)
rr
- replacement ratesr
- selection rateselector
- selectorstages
- body statgespublic final int getSelectionRate()
public void setSelectionRate(int sr)
sr
- ratepublic final SteadyState.ReplacementStrategy getReplacementPolicy()
public void setReplacementPolicy(SteadyState.ReplacementStrategy replacement)
replacement
- public final int getReplacementRate()
public void setReplacementRate(int rate)
rate
- protected void preselect(Population<T> in, Population<T> out)
Crowder
preselect
in class Crowder<T extends Chromosome>
in
- input populationout
- output populationprotected void replace(Population<T> initial, Population<T> preselected, Population<T> evolved, Population<T> out)
Crowder
replace
in class Crowder<T extends Chromosome>
initial
- - the initial populationpreselected
- - the population resulting from preselectionevolved
- - the part of population that has evolvedout
- - the output population@Deprecated public void setBiggerIsBetter(boolean flag, boolean recursively)
setBiggerIsBetter
in class Crowder<T extends Chromosome>
flag
- true, if the best individual has the higher fitnessrecursively
- true, to propagate this setting down, otherwise false.