org.jactr.core.module.random.six
Class DefaultRandomModule

java.lang.Object
  extended by org.jactr.core.module.AbstractModule
      extended by org.jactr.core.module.random.six.DefaultRandomModule
All Implemented Interfaces:
IModule, IRandomModule, IInitializable, IInstallable, IParameterized

public class DefaultRandomModule
extends AbstractModule
implements IRandomModule, IParameterized


Field Summary
 
Fields inherited from interface org.jactr.core.module.random.IRandomModule
RANDOM_TIME_PARAM, SEED_PARAM
 
Constructor Summary
DefaultRandomModule()
           
 
Method Summary
 java.util.Random getGenerator()
           
static IRandomModule getInstance()
           
 java.lang.String getParameter(java.lang.String key)
          return parameter value - null if not defined.
 java.util.Collection<java.lang.String> getPossibleParameters()
          Return all parameters that can be read
 long getSeed()
           
 java.util.Collection<java.lang.String> getSetableParameters()
          Return list of all parameters that can be set.
 double getTimeRandomizer()
           
 void initialize()
          this will be called after all the modules have been installed permitting the module to attach listeners to other modules.
 double logisticNoise(double s)
           
 boolean randomBoolean()
           
 double randomizedTime(double currentTime)
           
 void reset()
          reset the module.
 void setParameter(java.lang.String key, java.lang.String value)
          Set the named parameter
 void setSeed(long seedValue)
           
 void setTimeRandomizer(double randomizer)
          sets the seed for the time randomizer which will randomize the requested time across the equal distribution [time*((randomizer-1)/randomizer), time*((randomizer+1)/randomizer))
 
Methods inherited from class org.jactr.core.module.AbstractModule
delayedFuture, dispose, getExecutor, getModel, getName, immediateFuture, immediateReturn, install, uninstall
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jactr.core.module.IModule
dispose, getModel, getName, install
 
Methods inherited from interface org.jactr.core.utils.IInstallable
uninstall
 

Constructor Detail

DefaultRandomModule

public DefaultRandomModule()
Method Detail

getInstance

public static IRandomModule getInstance()

getGenerator

public java.util.Random getGenerator()
Specified by:
getGenerator in interface IRandomModule

getSeed

public long getSeed()
Specified by:
getSeed in interface IRandomModule

setSeed

public void setSeed(long seedValue)
Specified by:
setSeed in interface IRandomModule

logisticNoise

public double logisticNoise(double s)
Specified by:
logisticNoise in interface IRandomModule

initialize

public void initialize()
Description copied from interface: IModule
this will be called after all the modules have been installed permitting the module to attach listeners to other modules. if you want to get access to chunks,types, or productions before the model runs, attach a model listener and do that during the modelStarted call

Specified by:
initialize in interface IModule
Specified by:
initialize in interface IInitializable
Specified by:
initialize in class AbstractModule

randomBoolean

public boolean randomBoolean()
Specified by:
randomBoolean in interface IRandomModule

getParameter

public java.lang.String getParameter(java.lang.String key)
Description copied from interface: IParameterized
return parameter value - null if not defined.

Specified by:
getParameter in interface IParameterized
Parameters:
key - Description of the Parameter
Returns:
The parameter value
See Also:
IParameterized.getParameter(java.lang.String)

getPossibleParameters

public java.util.Collection<java.lang.String> getPossibleParameters()
Description copied from interface: IParameterized
Return all parameters that can be read

Specified by:
getPossibleParameters in interface IParameterized
Returns:
The possibleParameters value
See Also:
IParameterized.getPossibleParameters()

getSetableParameters

public java.util.Collection<java.lang.String> getSetableParameters()
Description copied from interface: IParameterized
Return list of all parameters that can be set.

Specified by:
getSetableParameters in interface IParameterized
Returns:
The setableParameters value
See Also:
IParameterized.getSetableParameters()

setParameter

public void setParameter(java.lang.String key,
                         java.lang.String value)
Description copied from interface: IParameterized
Set the named parameter

Specified by:
setParameter in interface IParameterized
See Also:
IParameterized.setParameter(java.lang.String, java.lang.String)

getTimeRandomizer

public double getTimeRandomizer()
Specified by:
getTimeRandomizer in interface IRandomModule

randomizedTime

public double randomizedTime(double currentTime)
Specified by:
randomizedTime in interface IRandomModule

setTimeRandomizer

public void setTimeRandomizer(double randomizer)
Description copied from interface: IRandomModule
sets the seed for the time randomizer which will randomize the requested time across the equal distribution [time*((randomizer-1)/randomizer), time*((randomizer+1)/randomizer))

Specified by:
setTimeRandomizer in interface IRandomModule

reset

public void reset()
Description copied from interface: IModule
reset the module. This will typically clear the owned buffers and abort any module specific operations

Specified by:
reset in interface IModule