RandomOrbit:
Filter:
adclib/Classes (extension) | Control | MetaControl

RandomOrbit
ExtensionExtension

generate series of repeatable and reversible random decisions

Description

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:

Class Methods

.new

create a new RandomOrbit func and given seed and

Arguments:

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.

Instance Methods

.value

evaluate func to create next random value

Arguments:

inc

an increment for the seed value

... args

arguments to pass to func when evaluating

.func

the function to evaluate with the current seed.

.stepSeed

change the current seed by an increment.

.seed

get and set the current seed

.useScale

get and set flag for using scale and sign in value calculation.

.scaler

get and set the current scaler value

.sign

get and set the current sign value. A value of -1 can be used to go back a sequence of relative setting changes.

Examples