se_randomizeseeds

Randomize seeds of SimEvents® blocks to make them unique

Syntax

se_randomizeseeds(obj)
se_randomizeseeds(obj,'Mode',modevalue)
se_randomizeseeds(obj,'Mode','SpecifySeeds',sv)
se_randomizeseeds(...,'GlobalSeed',seed)
se_randomizeseeds(...,'Verbose',verbosity)

Description

se_randomizeseeds(obj) assigns the seeds of all SimEvents blocks that use random number generators within obj, making sure they are unique. obj is a system name, subsystem path name, block path name, or cell array of such names. If obj represents a system or subsystem, the function assigns seeds in subsystems of obj at any depth.

se_randomizeseeds(obj,'Mode',modevalue) or se_randomizeseeds(obj,'Mode','SpecifySeeds',sv) restricts the scope of the seed assignment based on the value of modevalue, as listed in this table.

Syntax OptionOperation
se_randomizeseeds(obj,'Mode','All')The function assigns all seeds in obj. This is the default behavior.
se_randomizeseeds(obj,'Mode','Identical')The function changes only those seeds in the system or subsystem obj that appear multiple times in obj.
se_randomizeseeds(obj,'Mode','SpecifySeeds',sv)The function changes only those seeds that currently have a value that appears in the vector sv.

se_randomizeseeds(...,'GlobalSeed',seed) specifies a global seed that the function uses to generate seed values in a repeatable way. The argument seed must be a nonnegative integer. The result of using this syntax is repeatable for a given seed value, assuming the underlying systems or blocks specified in obj do not change. However, to ensure repeatability, this syntax does not guarantee uniqueness of generated seed values.

se_randomizeseeds(...,'Verbose',verbosity) explicitly reports the status of each seed change if verbosity is 'on'. By default, verbosity is 'off'.

Examples

See Also

se_getseeds, se_setseeds

Running Simulations Repeatedly

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS