public class TopScaling<T extends Chromosome> extends Scaling<T>
TopScaling is compatible with multi-objective optimization.
Operator.Statistics
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_FRACTION
The defaulf fraction
|
random, statistics
biggerIsBetter, fitness, ga
Constructor and Description |
---|
TopScaling()
Creates an instance with default fraction
|
TopScaling(double f)
Creates an instance with the given fraction
|
TopScaling(int q)
Creates an instance with the given quantity of individuals
|
Modifier and Type | Method and Description |
---|---|
double |
getFraction()
Returns the fraction
|
int |
getQuantity()
Return the number of top individuals to consider
|
void |
scale(Population<T> pop)
Method used to scale the fitness of indivduals belonging to given
Population
|
void |
setFraction(double f)
Sets the fraction of individuals to consider.
|
void |
setQuantity(int q)
Sets the number of top individuals to consider.
|
getStatistics, updateStatistics
dispose, getFitness, init, isBiggerBetter, isFitnessChanged, setBiggerIsBetter, setBiggerIsBetter, setFitness, setFitness
public TopScaling()
public TopScaling(double f)
f
- fraction between 0 (0%) and 1 (i.e. 100%).public TopScaling(int q)
q
- quantity of top individualspublic final double getFraction()
public final void setFraction(double f)
f
- the fractionpublic final int getQuantity()
public final void setQuantity(int q)
q
- quantitypublic void scale(Population<T> pop)
Scaling
Population
scale
in class Scaling<T extends Chromosome>
pop
- population of individuals to scale