FLAMEGPU2
FLAMEGPU2 copied to clipboard
State Transition Convineince Functions
Using multiple states can be a little faffy to use in places, requiring agent function conditions which then launch trivial agent functions just to enforce transition based on agent data.
Instead a specialised layer element could be provided, which moves agents between states in a single kernel launch (+ sort + scatter), rather than function condition kernel + sort + scatter + kernel + state change sort /scatter.
This could support moving from one state to 2 states, or 1:many (a bit more awkward).
Joining would then complement this - many input states, 1 output state (if conditions passed?)
There is probably many other convineince functions which could be added to make using states more user-friendly (although we will need to ensure that dependency analysis is still possible).
I.e. agent functions that execute for all agents in all states (or a subset of more than 1 state?). This might be horrible to implement however without lots of sorting (temp moving agents into the same state list then returning them post execution).