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
At the moment, many of the cached quantities in MixedBehaviorProfile access the cache using the [] operator on std::map. This operator has the behaviour that it returns a default value if the key is not present. We should use .at() everywhere to avoid silently returning defaults.
As an example of what can happen, at the moment it's possible to get a belief for a terminal node, which is not behaviour which we intended (but silently works because of the use of [])
More broadly: We should example this class closely to confirm and document the behaviour of computed quantities on edge cases, as well as making all const-accessor functions use .at() (which may scare up some errors in the test suite).
We have already started examining the edge case of absent-minded information sets in #826.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
At the moment, many of the cached quantities in
MixedBehaviorProfileaccess the cache using the[]operator onstd::map. This operator has the behaviour that it returns a default value if the key is not present. We should use.at()everywhere to avoid silently returning defaults.As an example of what can happen, at the moment it's possible to get a belief for a terminal node, which is not behaviour which we intended (but silently works because of the use of
[])More broadly: We should example this class closely to confirm and document the behaviour of computed quantities on edge cases, as well as making all const-accessor functions use
.at()(which may scare up some errors in the test suite).We have already started examining the edge case of absent-minded information sets in #826.
Beta Was this translation helpful? Give feedback.
All reactions