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

RandomOrbit : Object
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

RandomOrbit.new(seed, func, useScale: true)

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.

Inherited class methods

Instance Methods

.value(inc ... args)

evaluate func to create next random value

Arguments:

inc

an increment for the seed value

... args

arguments to pass to func when evaluating

.func

.func = value

the function to evaluate with the current seed.

.stepSeed(inc: 1)

change the current seed by an increment.

.seed

.seed = value

get and set the current seed

.useScale

.useScale = value

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

.scaler

.scaler = value

get and set the current scaler value

.sign

.sign = value

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

Inherited instance methods

Undocumented instance methods

.asStream

.embedInStream(stream)

.next(inval)

Examples