-
Notifications
You must be signed in to change notification settings - Fork 21
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
New Agent getID
outside of an init function
#1220
Comments
Should be documented as exception. I don't think it's possible to assume agent IDs outside of the The exception to that rule is agent state input files, which may contain IDs but purge all agent state on load (iirc). |
It didn't throw when I did this unintentionally (started with init func, but switched to pre-init to avoid having to pass too many objects into an init func via file scoped variables), all agents just returned 0. I agree it should throw as it can't be accurate, and be documented as throwing, plus probably mentioning in the user guide too. |
https://github.com/FLAMEGPU/FLAMEGPU2/blob/master/src/flamegpu/simulation/detail/CUDAAgent.cu#L179 Well that seems like a bug, when agents are passed to |
The current documentation for
host functions & conditions
>Agent Creation
states that:I.e. this is what you will find if you want to find how to get the ID of a new agent.
If instead of doing this in an init function, but instead doing it outside of / prior to the Simulation existing, on a
flamegpu::AgentVector_Agent
, the `getID() method exists, but always returns 0 (because it has not been set yet, and can't be until it is associated with the Simulation).This could either be documented, or possible an exception thrown if this method is used prior to the instance having it's actual ID set?
The text was updated successfully, but these errors were encountered: