Repository navigation
Gambit v17.0.0-alpha.3
Pre-release
Pre-release
·
117 commits
to master
since this release
Added
- Added
Game.get_infosets(player), returning a materialized list of one representative
Nodeper information set belonging toplayer, replacingPlayer.infosets/Game.infosets.
playermust be a personal player; useGame.get_events()for the chance player's events. - Added
Game.get_events(), returning a materialized list of one representativeNodeper
chance event in the game. - Added
Event, the chance-event counterpart toInfoset: a lazy, node-anchored view of the
chance player's information partition. AddedNode.eventalongside the existing
Node.infoset, which is now specific to personal players' information sets; each is falsy
when it does not apply to a given node. - Added
Node.members, the set of nodes belonging to the same information set or event asNode,
equivalent toNode.infoset.members/Node.event.members, whichever applies. - Added
Node.actions, the labels of the actions available at the node's current information
set or event, whichever applies (equivalent toNode.infoset.actions/Node.event.actions). - Added
Node.action_probs, the probability of each action at the node's current chance event,
keyed by label. - Added
Branch, a(node, label)pair returned byNode.prior_action/Node.own_prior_action,
replacingAction. - Added
BehaviorSupportProfiletopygambit. - Added callback functions to Nash solvers, allowing calling code to take actions when an equilibrium
is found or another solver event is emitted. - Added
Game.make_outcome, which creates an outcome with the given payoffs and attaches it to a
set of nodes (extensive) or contingencies (strategic) in a single operation. (#1061) - Added
Game.make_outcome_null, which resets a set of nodes (extensive) or contingencies
(strategic) to the null outcome, removing the previously-attached outcome if this was its
last reference. (#1061) - Added
MixedStrategyProfile.as_floatandMixedBehaviorProfile.as_float, converting a
rational-precision profile to floating-point precision.liap_solve,liap_agent_solve,
logit_estimate,ipa_solve, andgnm_solvenow also accept a rational-precision profile
directly (as a starting point or perturbation vector), converting it internally.
(#721, #458) - Added
Game.get_outcome, which returns theOutcomeattached to a pure-strategy contingency
of a game in strategic (table) representation. - Added
Game.get_payoffs, which returns the payoff to each player at a pure-strategy
contingency, for a game in any representation. - Added
Game.get_strategies(player),Game.get_sequences(player),Game.get_min_payoff(player),
andGame.get_max_payoff(player), replacingPlayer.strategies/.sequences/.min_payoff/
.max_payoffnow thatPlayerhas been removed. - In the GUI, computed strategy and behaviour profiles can now be sorted by probability (#1077)
Changed
Infosetis now a lazy, node-anchored view (likeNode.player/Node.outcome), constructed
by anchoring on a representative member node rather than carrying independent identity, and is
now specific to personal players; seeEventfor the chance player.Infoset.is_chancehas
been removed, asInfosetis never chance; test truthiness ofNode.infoset/Node.event
instead.
Game.append_infoset,Game.insert_infoset,Game.set_move_actions,Game.set_event_actions,
Game.relabel_actions,Game.reveal, andGame.minimal_subgamenow identify an information
set or event via a memberNode(or its label) rather than anInfosetobject.Infoset.actions/Event.actions/Node.actionsnow return the plain labels (list[str]) of
the actions at the information set or event, rather thanActionobjects.Sequence.actionsnow returns atuple[str, ...]of labels rather thanActionobjects.Node.prior_action/Node.own_prior_actionnow return aBranch(a(node, label)pair)
rather than anAction.Game.behavior_support_profile'sactionsfilter callable is now called as
actions(node, action)(two positional arguments, wherenodeis a representative node of
the information set andactionis the action's label) rather than with a singleAction.Node.playernow returns the player's label (str), orNoneat a terminal node, directly
rather than a lazyNodePlayerproxy object.Infoset.player/Event.player/Sequence.player
now likewise return a label (str) rather than aPlayerobject.StrategySupport.player,BehaviorSupport.player,MixedStrategy.player, and
MixedBehavior.playernow return a label (str) rather than aPlayerobject.Game.playersnow iterates player labels (str) rather thanPlayerobjects; indexing by
label is no longer supported (a label is already in hand once iterated) -- useinto test
membership.Game.append_move,Game.insert_move,Game.reveal,Game.relabel_strategies, and
Game.set_strategiesnow takeplayeras a label (str) rather than accepting aPlayer
object.Game.strategy_support_profile'sstrategiesfilter callable'splayerargument is now a
label (str) rather than aPlayerobject.- Command-line tools are now implemented in
pygambitrather than C++-based compiled programs.
Thegambit-convertutility has been removed. - Refreshed GUI icons and standardised dialog layout and formatting
- Improved installers for Windows, and disk-image "installer" for MacOS
- Revised
StrategySupportProfileto expose a slimmer set of operations, and
implementStrategySupportas an immutable snapshot. - Absent outcomes are now represented by a per-game null outcome rather than by a null reference.
Two null outcomes always compare unequal (cf. missing values inpandas). Null outcomes do not appear when
iterating over a game's outcomes, and assigning a payoff to one raisesUndefinedOperationError. (#1061) Game.new_tableno longer creates an outcome for every contingency; a new strategic game has no outcomes,
and every contingency is initially null. Outcomes are created as they are needed;
games built byGame.from_arraysandGame.from_dictare unaffected. (#1061)- Tutorial notebooks that use
gtdrawto draw game trees now degrade gracefully if it isn't
installed: the drawing cells print a short note instead of raisingImportError, so the rest
of the tutorial (which doesn't otherwise depend ongtdraw) still runs.gtdrawdepends on a
LaTeX installation, so this lets the tutorials be run without that heavier local setup.
Removed
Game.add_outcome,Game.delete_outcome, andGame.set_outcomehave been removed; use
Game.make_outcome/Game.make_outcome_null, which create-and-attach or reset an outcome in
a single operation and never leave an unattached outcome in the game. (#1061)gtdrawis no longer part of thedocoptional-dependency group. Install it separately
(pip install gtdraw) to run tutorials locally or build the documentation.Game.contingenciesnow yields contingencies as a mapping from player label to strategy
label, rather than a list of per-player strategy indices.Game.strategy_support_profile'sstrategiesfilter callable is now called as
strategies(player, label)(two positional arguments) rather than with a singleStrategy.- Removed
Player. Players are now identified purely by label (str), as returned by iterating
Game.players.Player.strategies/.sequences/.min_payoff/.max_payoffare replaced by
Game.get_strategies/Game.get_sequences/Game.get_min_payoff/Game.get_max_payoff;
Player.numberhad no remaining use once labels are unambiguous (recover via
list(game.players).index(label)if truly needed);Player.is_chanceandGame.players.chance
are removed outright, with no replacement -- testNode.event/Node.infosettruthiness
instead.GamePlayerRepin the C++ core is unaffected by this change (a separate, later piece
of work). Game.get_behavior'splayerandstrategyparameters are now labels (str) rather than
accepting aPlayer/Strategyobject;StrategyBehavior.player/.strategynow return
labels rather thanPlayer/Strategyobjects.- Removed
Game.__getitem__, replaced byGame.get_outcome/Game.get_payoffs. - Removed
Game.strategies; iterateGame.playersand each player'sstrategiesinstead. - Removed
Strategy.action; useGame.get_behavior(player, strategy)[infoset](or.get),
already the documented fuller form of the same lookup. - Removed
Strategy. Strategies are now identified purely by label (str), as returned by
Player.strategies; aStrategyobject carried no information a label didn't already
carry, now that strategy labels are unique within a player.GameStrategyRepin the C++
core is unaffected by this change (a separate, later piece of work). - Removed
Player.infosetsandGame.infosets; useGame.get_infosets(player)instead. - Removed
Game.actions/Player.actions; the total count/collection of actions across a
game or player is now most directly available by iteratingGame.get_infosets(player)and
each node'sNode.actions. - Removed
Action. Actions are now identified purely by label (str), as returned by
Node.actions/Infoset.actions/Event.actions; useNode.action_probsfor chance-event
action probabilities, previouslyAction.prob, andNode.prior_action/Node.own_prior_action's
Branchin place of anActionreached via a node.StrategyBehavior's prescribed actions
are likewise now labels rather thanActionobjects. Also removed
Infoset.own_prior_actions/Infoset.plays(and theirEventmirrors), subsumed by the
existingNode.own_prior_action/Node.plays.