Package org.opt4j.operator.mutate
Class ConstantMutationRate
java.lang.Object
org.opt4j.operator.mutate.ConstantMutationRate
- All Implemented Interfaces:
MutationRate
Constant mutation rate. The
MutationRate
is set once.-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstantMutationRate
(double rate) Constructs aConstantMutationRate
with a given value. -
Method Summary
-
Field Details
-
rate
protected final double rate
-
-
Constructor Details
-
ConstantMutationRate
@Inject public ConstantMutationRate(double rate) Constructs aConstantMutationRate
with a given value.- Parameters:
rate
- the mutation rate value
-
-
Method Details
-
get
public double get()Description copied from interface:MutationRate
Returns the mutation rate as a double value.- Specified by:
get
in interfaceMutationRate
- Returns:
- the mutation rate
-
set
public void set(double value) Description copied from interface:MutationRate
Sets the mutation to a double value.- Specified by:
set
in interfaceMutationRate
- Parameters:
value
- the new muation rate
-