Programming Reference:BlockRandSeq Class

From BCI2000 Wiki
Revision as of 08:52, 19 August 2008 by Mellinger (talk | contribs) (→‎Location)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search




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.


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.


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