MATLAB Python

setRandSeed

Syntax

[rand_seed, stream] = setRandSeed(seed_type [,exp_name] [,sess_num] [,ppt_name]) [] = optional parameters

Description

This function takes experiment name, session number and/or participant name as input, and uses them to generate and initialize a random seed based on the seed_type instructions.

Usage

setRandSeed(seed_type) attempts to initiate the random seed in the manner specified by seed_type, which indicates the kind of randomization you would like to initiate for this session. It can be set to the string 'experiment', 'session', 'participant_exp', 'participant_sess', 'random', set to a scalar that will be used as the random seed, or left empty. If set to 'experiment', the same random seed will be used for every run of the experiment. If set to 'session', each session within the experiment will recieve a specific random seed. If set to 'participant_exp', every run in a particular experiment will receive the same seed for that participant. If set to 'participant_sess', every run of a particular session will receive the same seed for that participant. If set to random, a different random seed will be used every time (based on the system clock). If set to a value, this will be used to initialize a new random seed. If using a value other than a scalar, you will need to provide additional parameters as below. When using setRandSeed(seed_type, exp_name, sess_num, ppt_name), data in the fields seed_type are used to support the fulfilment of the randomization requested in seed_type. [rand_seed, stream] = setRandSeed(...) returns the seed that was used to initialize randomization, as well as the random stream itself.