Package org.opt4j.operators.crossover
Class BasicCrossoverModule
- java.lang.Object
-
- com.google.inject.AbstractModule
-
- org.opt4j.core.start.Opt4JModule
-
- org.opt4j.operators.OperatorModule<Crossover<?>>
-
- org.opt4j.operators.crossover.CrossoverModule
-
- org.opt4j.operators.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
-
Constructor Summary
Constructors Constructor Description BasicCrossoverModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
config()
double
getAlpha()
Returns the alpha value of theCrossoverDoubleBLX
orCrossoverDoubleUnfairAverage
, respectively.double
getBooleanRate()
Returns the rate of theCrossoverBooleanRate
.BasicCrossoverModule.BooleanType
getBooleanType()
Return theOperator
forBooleanGenotype
.int
getBooleanXPoints()
Returns the number of crossover points of theCrossoverBooleanXPoint
.BasicCrossoverModule.DoubleType
getDoubleType()
Return theOperator
forDoubleGenotype
.double
getIntegerRate()
Returns the rate of theCrossoverIntegerRate
.BasicCrossoverModule.IntegerType
getIntegerType()
Return theOperator
forIntegerGenotype
.int
getIntegerXPoints()
Returns the number of crossover points of theCrossoverIntegerXPoint
.double
getNu()
Returns the nu value of theCrossoverDoubleSBX
.BasicCrossoverModule.PermutationType
getPermutationType()
Returns theBasicCrossoverModule.PermutationType
.boolean
isRotation()
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.operators.crossover.CrossoverModule
getOperatorTypeLiteral
-
Methods inherited from class org.opt4j.operators.OperatorModule
addOperator, addOperator, addOperator, addOperatorSelector, addOperatorSelectorInstance
-
Methods inherited from class org.opt4j.core.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, 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
-
-
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()
- Specified by:
config
in classorg.opt4j.core.start.Opt4JModule
-
-