RandomTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Random Objects : RandomTools package : Commands : RandomTools/SetState

RandomTools

  

SetState

  

Set the internal state of the RandomTools Generator

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

SetState( option )

Parameters

option

-

(optional) argument of the form option=value where option is state

Description

• 

The SetState command sets the state of the pseudo-random number generator used by Generate.  Currently the Mersenne Twister generator is used.

• 

A state returned by GetState can be passed into SetState to regenerate a sequence of numbers.

• 

SetState accepts one optional argument, state.

  

state=value

  

The state argument specifies the data used to set the state of the generator.  This argument is passed on to the SetState method of the underlying pseudo-random number generator.  Currently the MersenneTwister[SetState] function is called.  If the state argument is not given then the state is seeded using values taken from the system.

Examples

withRandomTools

AddFlavor,BlumBlumShub,Generate,GetFlavor,GetFlavors,GetState,HasFlavor,LinearCongruence,MersenneTwister,QuadraticCongruence,RemoveFlavor,SetState,returnValueInertProc

(1)

sGetState

s:= 0 .. 624 ArrayData Type: integer4Storage: rectangularOrder: Fortran_order

(2)

seqGenerateinteger,i=1..5

104281139460,306860183579,477575829529,300187484465,72447943125

(3)

SetStatestate=1234567

seqGenerateinteger,i=1..5

133358104197,226369204,199647555608,83694368637,87420861549

(4)

SetStatestate=1234567

seqGenerateinteger,i=1..5

133358104197,226369204,199647555608,83694368637,87420861549

(5)

SetStatestate=s

seqGenerateinteger,i=1..5

104281139460,306860183579,477575829529,300187484465,72447943125

(6)

See Also

rand

RandomTools

RandomTools[Generate]

RandomTools[GetState]

RandomTools[LinearCongruence][SetState]

RandomTools[MersenneTwister]

RandomTools[MersenneTwister][GenerateInteger]

RandomTools[MersenneTwister][SetState]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam