Package org.opt4j.operator.mutate
Class ConstantMutationRate
- java.lang.Object
-
- org.opt4j.operator.mutate.ConstantMutationRate
-
- All Implemented Interfaces:
MutationRate
public class ConstantMutationRate extends Object implements MutationRate
Constant mutation rate. TheMutationRateis set once.
-
-
Field Summary
Fields Modifier and Type Field Description protected doublerate
-
Constructor Summary
Constructors Constructor Description ConstantMutationRate(double rate)Constructs aConstantMutationRatewith a given value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleget()Returns the mutation rate as a double value.voidset(double value)Sets the mutation to a double value.
-
-
-
Constructor Detail
-
ConstantMutationRate
@Inject public ConstantMutationRate(double rate)
Constructs aConstantMutationRatewith a given value.- Parameters:
rate- the mutation rate value
-
-
Method Detail
-
get
public double get()
Description copied from interface:MutationRateReturns the mutation rate as a double value.- Specified by:
getin interfaceMutationRate- Returns:
- the mutation rate
-
set
public void set(double value)
Description copied from interface:MutationRateSets the mutation to a double value.- Specified by:
setin interfaceMutationRate- Parameters:
value- the new muation rate
-
-