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
public class RandomModule extends Opt4JModule
TheRandomModule
is used to configure the used random number generator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RandomModule.RandType
-
Field Summary
Fields Modifier and Type Field Description protected long
seed
protected RandomModule.RandType
type
protected boolean
usingSeed
-
Fields inherited from class org.opt4j.start.Opt4JModule
SINGLETON
-
-
Constructor Summary
Constructors Constructor Description RandomModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
config()
Configure the module.long
getSeed()
Returns the seed the is used by the random number generator.RandomModule.RandType
getType()
Returns the type of the random number generator.boolean
isUsingSeed()
Returnstrue
if a specific seed is given.void
setSeed(long seed)
Sets the seed that is used by the random number generator.void
setType(RandomModule.RandType type)
Sets the type of the random number generator to the specified value.void
setUsingSeed(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, 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
-
seed
protected long seed
-
usingSeed
protected boolean usingSeed
-
type
protected RandomModule.RandType type
-
-
Method Detail
-
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
-
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()
-
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:
setSeed(long)
-
setType
public void setType(RandomModule.RandType type)
Sets the type of the random number generator to the specified value.- Parameters:
type
- the type of the random number generator- See Also:
getType()
-
getType
public RandomModule.RandType getType()
Returns the type of the random number generator.- Returns:
- the type of the random number generator
- See Also:
setType(org.opt4j.common.random.RandomModule.RandType)
-
isUsingSeed
public boolean isUsingSeed()
Returnstrue
if a specific seed is given.- Returns:
- the useSeed
- See Also:
setUsingSeed(boolean)
-
setUsingSeed
public void setUsingSeed(boolean value)
Select if a specific seed should be used.- Parameters:
value
-true
if a seed shall be used,false
otherwise- See Also:
isUsingSeed()
-
-