- live browsing of Self object memory -

lobby traitsrandomLC

This is a traits for a concrete random number generator that generates
      random numbers using a linear congruence. It is fast but not very 
       random. It may also have a rather short period.

CopyDowns: vector

CreatorPath: traits randomLC

Module: random

parent* = traits random
copySeed:Modulus:Multiplier:Displacement: =
( 
    "Copy and set all the parameters in the random number generator.
     Prime numbers should be preferred for moduli."

    copy initSeed: s Modulus: mod Multiplier: mul Displacement: disp)
statePrintString = ( vseed printString)
storeStringIfFail: = ( 'randomLC copy' "punt saving state for now")
basicInteger =
( 
    vseed: ((vseed * multiplier) + displacement) %+ modulus.
    vseed)
initSeed:Modulus:Multiplier:Displacement: =
( 
    modulus:      mod.
    multiplier:   mul.
    displacement: disp.
    seed:         s)
resolution = ( modulus)
setSeed: = ( vseed: s %+ modulus)