Package org.opt4j.optimizer.ea
Class ConstantCrossoverRate
- java.lang.Object
-
- org.opt4j.optimizer.ea.ConstantCrossoverRate
-
- All Implemented Interfaces:
CrossoverRate
public class ConstantCrossoverRate extends Object implements CrossoverRate
TheConstantCrossoverRate
represents a crossover rate that is constant during the whole optimization.
-
-
Field Summary
Fields Modifier and Type Field Description protected double
crossoverRate
-
Constructor Summary
Constructors Constructor Description ConstantCrossoverRate(double crossoverRate)
Constructs aConstantCrossoverRate
with a given crossover rate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
get()
Returns the crossover rate as a double value.void
set(double value)
Sets the crossover rate to a double value.
-
-
-
Constructor Detail
-
ConstantCrossoverRate
@Inject public ConstantCrossoverRate(double crossoverRate)
Constructs aConstantCrossoverRate
with a given crossover rate.- Parameters:
crossoverRate
- the crossover rate
-
-
Method Detail
-
get
public double get()
Description copied from interface:CrossoverRate
Returns the crossover rate as a double value.- Specified by:
get
in interfaceCrossoverRate
- Returns:
- the crossover rate
-
set
public void set(double value)
Description copied from interface:CrossoverRate
Sets the crossover rate to a double value.- Specified by:
set
in interfaceCrossoverRate
- Parameters:
value
- the new crossover rate
-
-