Programming Reference:BlockRandSeq Class

From BCI2000 Wiki
Jump to: navigation, search

Location

BCI2000/srcrc/shared/modules/application/utils

Synopsis

The BlockRandSeq class generates block randomized sequences. Sequences may be specified by

  • the number of elements, or
  • a list of absolute frequencies.

In the first case, the generated sequence will consist of random permutations of the numbers 1..N, following each other indefinitely. In the second case, the generated sequence will be specified by a list of frequencies f_k\geq 0 for the numbers 1..k, and the sequence itself consist of random permutations of the number sequence 1..N with each number repeated f_k times.

Properties

For each property, there is a getter method carrying the plain property name. Writable properties have an additional setter method prefixed with "Set".

int BlockSize (rw)

The length of a block, i.e. the number of elements in the output before the next permutation begins.

list Frequencies (r)

A list of frequencies f_k as specified above. The actual list argument to the setter function may be any STL container class.

Methods

BlockRandSeq( RandomGenerator& )

The BlockRandSeq object uses a RandomGenerator object to determine random permutations. In the constructor, a reference to a valid RandomGenerator object must be specified. This RandomGenerator object must remain valid during the entire lifetime of the BlockRandSeq object.

unsigned int NextElement()

Returns the next element in the block randomized sequence.

See also

Programming Reference:ApplicationBase Class, Programming Reference:RandomGenerator Class