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
Currently pygambit has a simple implementation of __repr__ for MixedStrategyProfile and MixedBehaviorProfile (and the related classes that represent player or information set slices), which displays probabilities as a nested list.
This is not ideal, because these classes are dict-like and not list-like; those __repr__ implementations are therefore misleading. Further, they are of perhaps not that much utility for games with more than a few strategies or actions.
Proposal
We propose a new implementation of __repr__ which is more like that of a pandas.Series with hierarchical indexing.
Issues to consider:
When players, strategies, information sets, and/or actions are labeled, it is nature to use their labels in this representation. However, how should we handle the case of un-labeled elements?
The default for a pandas.Series is to truncate the representation of long objects by having an ellipsis in the middle. Should we also do this?
Note that the command-line tools already implement something like this in C++. Although it would be quite quick to implement this in pure Python, it might be worth considering refactoring the existing C++ so we have a commonality of implementation, even if doing the C++ string formatting will be slightly more tedious.
The text was updated successfully, but these errors were encountered:
Overview
Currently
pygambit
has a simple implementation of__repr__
forMixedStrategyProfile
andMixedBehaviorProfile
(and the related classes that represent player or information set slices), which displays probabilities as a nested list.This is not ideal, because these classes are
dict
-like and notlist
-like; those__repr__
implementations are therefore misleading. Further, they are of perhaps not that much utility for games with more than a few strategies or actions.Proposal
We propose a new implementation of
__repr__
which is more like that of apandas.Series
with hierarchical indexing.Issues to consider:
pandas.Series
is to truncate the representation of long objects by having an ellipsis in the middle. Should we also do this?The text was updated successfully, but these errors were encountered: