-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agent ID generation (host and device) #199
Comments
Device agent creation can use the position flag at scatter time. That's a contiguous 0 index for all new agents, just requires the existing max index to add it to. |
To avoid using atomics to generate new individual Ids, we could make the an automatic, compulsory feature.
This would be instead of explicit newAgentId() methods like in current flame. Enforcing that agents have immutable, unique IDs might not be generally beneficial - to avoid self-messages and just prevent users from having to explcitly provide them (although some users may not want this) Self message avoidance would not be automatic however, as it depends on the message being read by the same population which output the message, and some models do want self messaging. THe inclusion of the id in the message would likely not be compulsory. This could be an optional feature, specified in the agent description. To prevent users overwriting, access could be controlled through explicit methods rather than getVariable / set variable, but the type would need to be specified upfront. e.g. in an agent function
or similar. the |
After discussion with @mondus Give all agents IDs automatically, but prevent users from over writing it. Give a new method to get agent ids automatically, rather than letting users set and get this property like other agent variables. |
Assuming #457 is merged, I will end up working on this next. So need to begin tying down a rough plan of action. Agent ID notes
To Solve
Solution
|
This is managed by FLAMEGPU and can be accessed with getID() in all places where getVariable is available. IDs are assigned when a simulation begins, but can be exported and reimported to/from AgentVector/file. Users cannot change or disable agent IDs. id_t is the type of ID, is currently a typedef to unsigned int, but can be changed to uint64_t if desired. If an id_t type agent/message/env variable is required in Python, newVariableID() or similar can be used. Closes #199
This is managed by FLAMEGPU and can be accessed with getID() in all places where getVariable is available. IDs are assigned when a simulation begins, but can be exported and reimported to/from AgentVector/file. Users cannot change or disable agent IDs. id_t is the type of ID, is currently a typedef to unsigned int, but can be changed to uint64_t if desired. If an id_t type agent/message/env variable is required in Python, newVariableID() or similar can be used. Closes #199
This is managed by FLAMEGPU and can be accessed with getID() in all places where getVariable is available. IDs are assigned when a simulation begins, but can be exported and reimported to/from AgentVector/file. Users cannot change or disable agent IDs. id_t is the type of ID, is currently a typedef to unsigned int, but can be changed to uint64_t if desired. If an id_t type agent/message/env variable is required in Python, newVariableID() or similar can be used. Closes #199
FLAME GPU 1 has methods to generate (probably) unique IDs for agents from the host or the device.
General process is:
It might be easeir to just use managed memory.
The text was updated successfully, but these errors were encountered: