How to best randomize Simulink Random Number seeds for Rapid Accelerator simulation
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a large model that I would like to execute iteratively in rapid simulation mode inside a parfor loop. The model contains 112 Random Number or Uniform Random Number blocks spread through various libraries and referenced models. All of them have a seed value of 0. Some of them produce vectors but because the developer (not me) never changed the seed from a scalar 0, the vectors are filled with identical elements.
I would like to randomize the seeds not only within the model (every block a different seed or set of seeds) but for each iteration of my parfor-contained rapid simulation execution.
Is there a straightforward way of accomplishing this?
So far I have tried replacing all of the seeds with randi(intmax,mySize), where mySize is set to match the size of any non-scalar values in Mean, Variance, Minimum, or Maximum. This randomized the outputs between successive runs from the Simulink window, but not if I ran the model successively in rapid accelerator mode with RapidAcceleratorUpToDateCheck off.
I am considering replacing each seed with a reference to a Simulink.Parameter in the base workspace before building the rapid simulation target.
-
The bottom line: I see why random number repeatability is a feature, but I was hoping that there might be a convenient switch to truly randomize my data.
0 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Sources in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!