Package org.opt4j.common.random
Class RandomModule
java.lang.Object
com.google.inject.AbstractModule
org.opt4j.start.Opt4JModule
org.opt4j.common.random.RandomModule
- All Implemented Interfaces:
com.google.inject.Module
The
RandomModule is used to configure the used random number
generator.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected RandomModule.RandTypeprotected booleanFields inherited from class org.opt4j.start.Opt4JModule
SINGLETON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfig()Configure the module.longgetSeed()Returns the seed the is used by the random number generator.getType()Returns the type of the random number generator.booleanReturnstrueif a specific seed is given.voidsetSeed(long seed) Sets the seed that is used by the random number generator.voidsetType(RandomModule.RandType type) Sets the type of the random number generator to the specified value.voidsetUsingSeed(boolean value) Select if a specific seed should be used.Methods inherited from class org.opt4j.start.Opt4JModule
addControlListener, addIndividualStateListener, addOptimizerIterationListener, addOptimizerStateListener, bindConstant, bindConstant, bindConstant, bindConstant, configure, constant, multiMethods 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
-
seed
protected long seed -
usingSeed
protected boolean usingSeed -
type
-
-
Constructor Details
-
RandomModule
public RandomModule()
-
-
Method Details
-
config
public void config()Description copied from class:Opt4JModuleConfigure the module. Bind constants, listeners, and bind arbitrary classes.- Specified by:
configin classOpt4JModule- See Also:
-
Binder
-
setSeed
public void setSeed(long seed) Sets the seed that is used by the random number generator.- Parameters:
seed- the seed that is used by the random number generator- See Also:
-
getSeed
public long getSeed()Returns the seed the is used by the random number generator.- Returns:
- the seed the is used by the random number generator
- See Also:
-
setType
Sets the type of the random number generator to the specified value.- Parameters:
type- the type of the random number generator- See Also:
-
getType
Returns the type of the random number generator.- Returns:
- the type of the random number generator
- See Also:
-
isUsingSeed
public boolean isUsingSeed()Returnstrueif a specific seed is given.- Returns:
- the useSeed
- See Also:
-
setUsingSeed
public void setUsingSeed(boolean value) Select if a specific seed should be used.- Parameters:
value-trueif a seed shall be used,falseotherwise- See Also:
-