12.6 Environment Generation Functions

The following functions are available on the Environment object for algorithmically creating events. See `demo/bp_misc/gen_rnd_prototypes.css' for a CSS script that creates prototypes and random exemplars based on these prototypes using some of the following functions.

ReplicateEvents(int n_replicas, bool make_groups)
This will create n_replicas of all of the existing events in the environment. If make_groups is set, then all events which are replicas of a given one will be placed into the same sub-group. Otherwise, the replicas appear right after the event they are replicas of. This can be used to replicate a set of prototype events, and noise can be added (AddNoise, FlipBits) to create random distortions of these prototypes.
PermutedBinary(int pat_no, int n_on)
This produces random (permuted) binary patterns of 1's and 0's over the existing events in the environment. pat_no determines which pattern to use, and n_on specifies the number of 1's in each random pattern.
PermutedBinary_MinDist(int pat_no, int n_on, float dist, bool max_correl)
This is like PermutedBinary, but it ensures that the hamming distance between any two patterns is at least dist (i.e., all patterns are separated by at least this minimum distance). If max_correl is set, this ensures that the maximum correlation between patterns is below the dist value.
FlipBits(int pat_no, int n_off, int n_on)
This switches exactly n_off values of a pattern from 1 to 0, and n_on from 0 to 1. In other words, some values that were 1 will now be 0, and some values that were 0 will now be 1. This is a useful way of creating random distortions of prototypical patterns.
AddNoise(int pat_no, Random rnd_spec)
This will add noise of the given specification to all events in pattern pat_no.
TransformPats(int pat_no, PreProcessVals trans)
This will apply given transformation (simple math) operation to all events in pattern pat_no.
DistMatrix(ostream& strm, int pat_no, bool correl, bool no_names)
This produces a distance matrix between all events for given pattern, optionally reporting correlations, and not printing the names. This is useful for assessing the similarity relationships among patterns, etc.