Package org.opt4j.operator.crossover
Class BasicCrossoverModule
java.lang.Object
com.google.inject.AbstractModule
org.opt4j.start.Opt4JModule
org.opt4j.operator.OperatorModule<Crossover<?>>
org.opt4j.operator.crossover.CrossoverModule
org.opt4j.operator.crossover.BasicCrossoverModule
- All Implemented Interfaces:
com.google.inject.Module
The
BasicCrossoverModule
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Type ofCrossover
operator for theBooleanGenotype
.static enum
Type ofCrossover
operator for theDoubleGenotype
.static enum
Type ofCrossover
operator for theIntegerGenotype
.static enum
Type ofCrossover
operator for thePermutationGenotype
. -
Field Summary
Modifier and TypeFieldDescriptionprotected double
protected double
protected BasicCrossoverModule.BooleanType
protected int
protected BasicCrossoverModule.DoubleType
protected double
protected BasicCrossoverModule.IntegerType
protected int
protected double
protected BasicCrossoverModule.PermutationType
protected boolean
Fields inherited from class org.opt4j.start.Opt4JModule
SINGLETON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
config()
Configure the module.double
getAlpha()
Returns the alpha value of theCrossoverDoubleBLX
orCrossoverDoubleUnfairAverage
, respectively.double
Returns the rate of theCrossoverBooleanRate
.Return theOperator
forBooleanGenotype
.int
Returns the number of crossover points of theCrossoverBooleanXPoint
.Return theOperator
forDoubleGenotype
.double
Returns the rate of theCrossoverIntegerRate
.Return theOperator
forIntegerGenotype
.int
Returns the number of crossover points of theCrossoverIntegerXPoint
.double
getNu()
Returns the nu value of theCrossoverDoubleSBX
.Returns theBasicCrossoverModule.PermutationType
.boolean
void
setAlpha
(double alpha) Sets the alpha value of theCrossoverDoubleBLX
orCrossoverDoubleUnfairAverage
, respectively.void
setBooleanRate
(double booleanRate) Sets the rate of theCrossoverBooleanRate
.void
setBooleanType
(BasicCrossoverModule.BooleanType booleanType) Sets theOperator
forBooleanGenotype
.void
setBooleanXPoints
(int booleanXPoints) Sets the number of crossover points of theCrossoverBooleanXPoint
.void
setDoubleType
(BasicCrossoverModule.DoubleType doubleType) Sets theOperator
forDoubleGenotype
.void
setIntegerRate
(double integerRate) Sets the rate of theCrossoverIntegerRate
.void
setIntegerType
(BasicCrossoverModule.IntegerType integerType) Sets theOperator
forIntegerGenotype
.void
setIntegerXPoints
(int integerXPoint) Sets the number of crossover points of theCrossoverIntegerXPoint
.void
setNu
(double nu) Sets the nu value of theCrossoverDoubleSBX
.void
setPermutationType
(BasicCrossoverModule.PermutationType permutationType) Sets theBasicCrossoverModule.PermutationType
.void
setRotation
(boolean rotation) Sets the rotation value for theCrossover
operator for thePermutationGenotype
.Methods inherited from class org.opt4j.operator.crossover.CrossoverModule
getOperatorTypeLiteral
Methods inherited from class org.opt4j.operator.OperatorModule
addOperator, addOperator, addOperator
Methods inherited from class org.opt4j.start.Opt4JModule
addControlListener, addIndividualStateListener, addOptimizerIterationListener, addOptimizerStateListener, bindConstant, bindConstant, bindConstant, bindConstant, configure, constant, multi
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
Field Details
-
booleanType
-
booleanRate
protected double booleanRate -
booleanXPoints
protected int booleanXPoints -
doubleType
-
alpha
protected double alpha -
nu
protected double nu -
permutationType
-
rotation
protected boolean rotation -
integerType
-
integerRate
protected double integerRate -
integerXPoints
protected int integerXPoints
-
-
Constructor Details
-
BasicCrossoverModule
public BasicCrossoverModule()Constructs aBasicCrossoverModule
.
-
-
Method Details
-
getIntegerRate
public double getIntegerRate()Returns the rate of theCrossoverIntegerRate
.- Returns:
- the rate
-
setIntegerRate
public void setIntegerRate(double integerRate) Sets the rate of theCrossoverIntegerRate
.- Parameters:
integerRate
- the rate
-
getIntegerXPoints
public int getIntegerXPoints()Returns the number of crossover points of theCrossoverIntegerXPoint
.- Returns:
- the number of crossover points
-
setIntegerXPoints
public void setIntegerXPoints(int integerXPoint) Sets the number of crossover points of theCrossoverIntegerXPoint
.- Parameters:
integerXPoint
- the number of crossover points
-
getIntegerType
Return theOperator
forIntegerGenotype
.- Returns:
- the operator
-
setIntegerType
Sets theOperator
forIntegerGenotype
.- Parameters:
integerType
- the operator
-
getBooleanRate
public double getBooleanRate()Returns the rate of theCrossoverBooleanRate
.- Returns:
- the rate
-
setBooleanRate
public void setBooleanRate(double booleanRate) Sets the rate of theCrossoverBooleanRate
.- Parameters:
booleanRate
- the rate
-
getBooleanXPoints
public int getBooleanXPoints()Returns the number of crossover points of theCrossoverBooleanXPoint
.- Returns:
- the number of crossover points
-
setBooleanXPoints
public void setBooleanXPoints(int booleanXPoints) Sets the number of crossover points of theCrossoverBooleanXPoint
.- Parameters:
booleanXPoints
- the number of crossover points
-
getBooleanType
Return theOperator
forBooleanGenotype
.- Returns:
- the operator
-
setBooleanType
Sets theOperator
forBooleanGenotype
.- Parameters:
booleanType
- the operator
-
getAlpha
public double getAlpha()Returns the alpha value of theCrossoverDoubleBLX
orCrossoverDoubleUnfairAverage
, respectively.- Returns:
- the alpha value
-
setAlpha
public void setAlpha(double alpha) Sets the alpha value of theCrossoverDoubleBLX
orCrossoverDoubleUnfairAverage
, respectively.- Parameters:
alpha
- the alpha value
-
getNu
public double getNu()Returns the nu value of theCrossoverDoubleSBX
.- Returns:
- the nu value
-
setNu
public void setNu(double nu) Sets the nu value of theCrossoverDoubleSBX
.- Parameters:
nu
- the nu value
-
getDoubleType
Return theOperator
forDoubleGenotype
.- Returns:
- the operator
-
setDoubleType
Sets theOperator
forDoubleGenotype
.- Parameters:
doubleType
- the operator
-
getPermutationType
Returns theBasicCrossoverModule.PermutationType
.- Returns:
- the permutation type
-
setPermutationType
Sets theBasicCrossoverModule.PermutationType
.- Parameters:
permutationType
- the permutation type
-
isRotation
public boolean isRotation()- Returns:
true
if rotation is used
-
setRotation
public void setRotation(boolean rotation) Sets the rotation value for theCrossover
operator for thePermutationGenotype
.- Parameters:
rotation
- the rotation value
-
config
public void config()Description copied from class:Opt4JModule
Configure the module. Bind constants, listeners, and bind arbitrary classes.- Specified by:
config
in classOpt4JModule
- See Also:
-
Binder
-