FLAMEGPU / FLAMEGPU2

FLAME GPU 2 is a GPU accelerated agent based modelling framework for CUDA C++ and Python
https://flamegpu.com
MIT License
106 stars 22 forks source link

agent native does not account for scope #1125

Closed Robadob closed 11 months ago

Robadob commented 1 year ago
for edge in fgraph.outEdges(vertex_index):
    foo = edge.getPropertyInt("foo")

for edge in fgraph.inEdges(vertex_index):
    foo = edge.getPropertyInt("foo")

translates to

for (const auto& edge : fgraph.outEdges(vertex_index)){
    auto foo = edge.getProperty<int>("foo");
}
for (const auto& edge : fgraph.inEdges(vertex_index)){
    foo = edge.getProperty<int>("foo");
}

This could be fixed by updating self._locals to instead store tuples that log the value of self._indent at declaration. Then self._locals could be purged of out of scope vars as leave() is triggered which decrements self._indent.

I may try to address this after network message has been merged (rather than complicate my existing changes).