Package org.opt4j.optimizer.mopso
Class MutateDoubleUniform
- java.lang.Object
-
- org.opt4j.operator.mutate.MutateDouble
-
- org.opt4j.operator.mutate.MutateDoubleElementwise
-
- org.opt4j.optimizer.mopso.MutateDoubleUniform
-
- All Implemented Interfaces:
Operator<DoubleGenotype>
,Mutate<DoubleGenotype>
- Direct Known Subclasses:
MutateDoubleNonUniform
public class MutateDoubleUniform extends MutateDoubleElementwise
TheMutateDoubleUniform
uniformly mutates aDoubleGenotype
elementwise.
-
-
Field Summary
Fields Modifier and Type Field Description protected double
perturbation
-
Fields inherited from class org.opt4j.operator.mutate.MutateDouble
normalize, random
-
-
Constructor Summary
Constructors Constructor Description MutateDoubleUniform(Rand random, NormalizeDouble normalize, double perturbation)
Constructs aMutateDoubleUniform
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
mutateElement(double x, double lb, double ub, double p)
Mutate one element of the list.-
Methods inherited from class org.opt4j.operator.mutate.MutateDoubleElementwise
mutateList
-
Methods inherited from class org.opt4j.operator.mutate.MutateDouble
mutate
-
-
-
-
Constructor Detail
-
MutateDoubleUniform
@Inject public MutateDoubleUniform(Rand random, NormalizeDouble normalize, double perturbation)
Constructs aMutateDoubleUniform
.- Parameters:
random
- the random number generatornormalize
- the normalize operatorperturbation
- the perturbation index
-
-
Method Detail
-
mutateElement
protected double mutateElement(double x, double lb, double ub, double p)
Description copied from class:MutateDoubleElementwise
Mutate one element of the list.- Specified by:
mutateElement
in classMutateDoubleElementwise
- Parameters:
x
- the elementlb
- the lower boundub
- the upper boundp
- the mutation rate- Returns:
- the mutated element
-
-