Pwrand:
Filter:
Classes | Streams-Patterns-Events > Patterns > List

Pwrand : ListPattern : Pattern : AbstractFunction : Object

embed values randomly chosen from a list

Description

Returns one item from the list at random for each repeat, the probability for each item is determined by a list of weights which should sum to 1.0.

Class Methods

Inherited class methods

Undocumented class methods

Pwrand.new(list, weights, repeats: 1)

Instance Methods

Inherited instance methods

Undocumented instance methods

.embedInStream(inval)

.weights

.weights = value

Examples