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
public class BasicCrossoverModule extends CrossoverModule
TheBasicCrossoverModule
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BasicCrossoverModule.BooleanType
Type ofCrossover
operator for theBooleanGenotype
.static class
BasicCrossoverModule.DoubleType
Type ofCrossover
operator for theDoubleGenotype
.static class
BasicCrossoverModule.IntegerType
Type ofCrossover
operator for theIntegerGenotype
.static class
BasicCrossoverModule.PermutationType
Type ofCrossover
operator for thePermutationGenotype
.
-
Field Summary
Fields Modifier and Type Field Description protected double
alpha
protected double
booleanRate
protected BasicCrossoverModule.BooleanType
booleanType
protected int
booleanXPoints
protected BasicCrossoverModule.DoubleType
doubleType
protected double
integerRate
protected BasicCrossoverModule.IntegerType
integerType
protected int
integerXPoints
protected double
nu
protected BasicCrossoverModule.PermutationType
permutationType
protected boolean
rotation
-
Fields inherited from class org.opt4j.start.Opt4JModule
SINGLETON
-
-
Constructor Summary
Constructors Constructor Description BasicCrossoverModule()
Constructs aBasicCrossoverModule
.
-
Method Summary
-
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 Detail
-
booleanType
protected BasicCrossoverModule.BooleanType booleanType
-
booleanRate
protected double booleanRate
-
booleanXPoints
protected int booleanXPoints
-
doubleType
protected BasicCrossoverModule.DoubleType doubleType
-
alpha
protected double alpha
-
nu
protected double nu
-
permutationType
protected BasicCrossoverModule.PermutationType permutationType
-
rotation
protected boolean rotation
-
integerType
protected BasicCrossoverModule.IntegerType integerType
-
integerRate
protected double integerRate
-
integerXPoints
protected int integerXPoints
-
-
Constructor Detail
-
BasicCrossoverModule
public BasicCrossoverModule()
Constructs aBasicCrossoverModule
.
-
-
Method Detail
-
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
public BasicCrossoverModule.IntegerType getIntegerType()
Return theOperator
forIntegerGenotype
.- Returns:
- the operator
-
setIntegerType
public void setIntegerType(BasicCrossoverModule.IntegerType integerType)
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
public BasicCrossoverModule.BooleanType getBooleanType()
Return theOperator
forBooleanGenotype
.- Returns:
- the operator
-
setBooleanType
public void setBooleanType(BasicCrossoverModule.BooleanType booleanType)
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
public BasicCrossoverModule.DoubleType getDoubleType()
Return theOperator
forDoubleGenotype
.- Returns:
- the operator
-
setDoubleType
public void setDoubleType(BasicCrossoverModule.DoubleType doubleType)
Sets theOperator
forDoubleGenotype
.- Parameters:
doubleType
- the operator
-
getPermutationType
public BasicCrossoverModule.PermutationType getPermutationType()
Returns theBasicCrossoverModule.PermutationType
.- Returns:
- the permutation type
-
setPermutationType
public void setPermutationType(BasicCrossoverModule.PermutationType permutationType)
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
-
-