C++ api and internal cleanups - #1052
Open
tturocy wants to merge 5 commits into
Open
Conversation
The predicate of whether an action or infoset precedes a node can be written as a composition of whether a node precedes another node. As we are preferring to have a slimmer API surface, we are removing these superfluous predicates.
… a mapping at chance moves.
…he infoset GameInfosetRep has persistent identity but mutable content: its members, actions, and player can all be replaced without the object's identity changing, so a caller holding a GameInfoset across other operations can end up with a stale-but-valid reference to something that no longer means what it did when fetched. Add GameNodeRep::GetInfosetLabel/IsChanceInfoset/GetActionProb/SameInfoset so callers needing one of these node-invariant properties don't need to materialize the infoset at all. Rework the three GUI handlers that held an infoset across multiple mutating calls (DoInsertAction, OnEditReveal, OnEditMove/EditMoveDialog) to instead anchor on the node they already have and re-derive the infoset fresh at each point of use.
MixedStrategyProfile, MixedBehaviorProfile, LogBehavProfile, and BehaviorSupportProfile cached their per-node/per-infoset/per-action/ per-player data in std::map<GameAction/GameInfoset/GameNode, T>. This is quite inefficient for what's fundamentally dense, small-integer-keyed data. Replace these with Array<T>, indexed directly by the relevant object's existing dense number.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an omnibus of several commits focused on refactorings ultimately targeted at being able to remove direct reference to internal game objects (mediated via shared pointers)