You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently trying to verify that for some state A an other state B is in the history of A.
I tried something like this:
lineage = [
history.state
for history in current_state.history.lineage
]
if len(found_states) > 0 and found_states[-1] == current_state:
return True
if self._initial_state not in lineage:
return False
for found_state in found_states:
if not found_state in lineage:
return False
return True
The problem is history.state is a weakproxy so I add a .__repr__.self__ to make a strong reference. But still sometimes the garbage collector is remoing weak proxies and make the program crash.
Does someone have a better way to do this ?
The text was updated successfully, but these errors were encountered:
The state option EFFICIENT_STATE_MERGING does what you want. It used to be named something more explicitly related to state strong references, but it seems to have been renamed at some point...
There's a builtin mechanism for holding on to the lineage of states - a StateHierarchy. You can construct one, then pass it to the construction of a SimulationManager, and it should automatically track the information you need, which you can query with methods on the hierarchy object.
I find another solution. Since for each state I go through I have an associtaed block I compare address instead of comparing block object. I believe this is working well for my use case.
Question
I am currently trying to verify that for some state A an other state B is in the history of A.
I tried something like this:
The problem is
history.state
is a weakproxy so I add a.__repr__.self__
to make a strong reference. But still sometimes the garbage collector is remoing weak proxies and make the program crash.Does someone have a better way to do this ?
The text was updated successfully, but these errors were encountered: