Package org.opt4j.operator.neighbor
Class NeighborIntegerRandom
- java.lang.Object
-
- org.opt4j.operator.neighbor.NeighborIntegerRandom
-
- All Implemented Interfaces:
Operator<IntegerGenotype>
,Neighbor<IntegerGenotype>
,NeighborInteger
public class NeighborIntegerRandom extends Object implements NeighborInteger
TheNeighborIntegerRandom
selects on element of anIntegerGenotype
and changes it. The neighbor is created randomly between the lower and upper bounds.
-
-
Constructor Summary
Constructors Constructor Description NeighborIntegerRandom(Rand random)
Constructs aNeighborIntegerRandom
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
neighbor(IntegerGenotype genotype)
Moves theGenotype
to a neighbor.
-
-
-
Field Detail
-
random
protected final Random random
-
-
Constructor Detail
-
NeighborIntegerRandom
@Inject public NeighborIntegerRandom(Rand random)
Constructs aNeighborIntegerRandom
.- Parameters:
random
- the random number generator
-
-
Method Detail
-
neighbor
public void neighbor(IntegerGenotype genotype)
Description copied from interface:Neighbor
Moves theGenotype
to a neighbor.- Specified by:
neighbor
in interfaceNeighbor<IntegerGenotype>
- Parameters:
genotype
- theGenotype
to be changed
-
-