RandomState
Set random number generator
Description
The RandomState
property sets the random
number generator for the stochastic solvers. It is a property of the SolverOptions
object. SolverOptions
is
a property of the configset
object.
SimBiology® software uses a pseudorandom number generator.
The sequence of numbers generated is determined by the state of the
generator, which can be specified by the integer RandomState
.
If RandomState
is set to integer J
,
the random number generator is initialized to its Jth
state.
The random number generator can generate all the floating-point numbers
in the closed interval [2^(-53), 1-2^(-53)]
. Theoretically,
it can generate over 2^1492
values before repeating
itself. But for a given state, the sequence of numbers generated will
be the same. To change the sequence, change RandomState
. SimBiology software
resets the state at startup. The default value of RandomState
is []
.
Characteristics
Applies to | Objects: SolverOptions for SSA,
expltau, impltau |
Data type | int |
Data values | Default is [] (empty). |
Access | Read/write |
Examples
This example shows how to change RandomState
settings.
Retrieve the
configset
object from themodelObj
and change theSolverType
toexpltau
.modelObj = sbiomodel('cell'); configsetObj = getconfigset(modelObj); set(configsetObj, 'SolverType', 'expltau')
Change the
Randomstate
to5
.set(configsetObj.SolverOptions, 'RandomState', 5); get(configsetObj.SolverOptions, 'RandomState')) ans = 5