Alex Herbert created RNG-200:
--------------------------------
Summary: TWO_CMRES_SELECT cannot be serialized within
JDKRandomBridge
Key: RNG-200
URL: https://issues.apache.org/jira/browse/RNG-200
Project: Commons RNG
Issue Type: Bug
Components: core, simple
Affects Versions: 1.7
Reporter: Alex Herbert
The TWO_CMRES_SELECT random source is constructed using a seed and two chosen
sub-cycle generators. The state of the RNG can be saved and restored using the
methods of RestorableUniformRandomProvider. This state *does not* include the
identifiers of the sub-cycle generators. Thus the state can be restored to the
*same instance* of the RNG where the sub-cycle generators are known. It cannot
be used to create a new instance of the generator when deserializing the state
in the JDKRandomBridge.
The JDKRandomBridge creates a new instance of the random source using:
{code:java}
delegate = source.create(); {code}
This is the no argument factory method of RandomSource:
{code:java}
public RestorableUniformRandomProvider create() {code}
The TWO_CMRES_SELECT generator requires the two sub cycle generators to be
specified in the overloaded factory method:
{code:java}
public RestorableUniformRandomProvider create(Object seed,
Object... data) {code}
For example:
{code:java}
long seed = 1;
int subCycle1 = 3;
int subCycle2 = 8;
delegate = source.create(seed, subCycle1, subCycle2); {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)