Random seed in agents functions #1088
-
Hi, Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
No. Random state is per-thread, rather than per-agent within FLAMEGPU, therefore a thread's random state is not attached to a single agent unless a model only has 1 agent type, with 1 state and a fixed number of agents which are never sorted (e.g. not using spatial messaging). If implementing a model in C/C++ you could implement per-agent random state/generation manually, by having curand states stored behind a |
Beta Was this translation helpful? Give feedback.
No.
Random state is per-thread, rather than per-agent within FLAMEGPU, therefore a thread's random state is not attached to a single agent unless a model only has 1 agent type, with 1 state and a fixed number of agents which are never sorted (e.g. not using spatial messaging).
If implementing a model in C/C++ you could implement per-agent random state/generation manually, by having curand states stored behind a
__device__
global array accessed with an agent's unique ID.