RandomOrbit allows generating series of repeatable and reversible random decisions by controlling the seeding of the random generator used. Moving the seed number up and down by the same steps will create the same results again, and having a sign. Its default function is intended for also reversing decisions by scaling and inverting the resulting list of bipolar number values. RandomOrbit is a concept by Hannes Hoelzl; implementation started by adc. Combines well with the Influx class (in the Influx Quark).
First code examples:
create a new RandomOrbit func and given seed and
seed |
optional initial seed value |
func |
optional func to use |
useScale |
flag whether to use scaling by scaler and sign. turn this off for non-numerical values. |
evaluate func to create next random value
inc |
an increment for the seed value |
... args |
arguments to pass to func when evaluating |
the function to evaluate with the current seed.
change the current seed by an increment.
get and set the current seed
get and set flag for using scale and sign in value calculation.
get and set the current scaler value
get and set the current sign value. A value of -1 can be used to go back a sequence of relative setting changes.