Skip to content

Gambit v17.0.0-alpha.3

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 31 Aug 16:55
· 117 commits to master since this release

Added

  • Added Game.get_infosets(player), returning a materialized list of one representative
    Node per information set belonging to player, replacing Player.infosets/Game.infosets.
    player must be a personal player; use Game.get_events() for the chance player's events.
  • Added Game.get_events(), returning a materialized list of one representative Node per
    chance event in the game.
  • Added Event, the chance-event counterpart to Infoset: a lazy, node-anchored view of the
    chance player's information partition. Added Node.event alongside 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 as Node,
    equivalent to Node.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 to Node.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 by Node.prior_action/Node.own_prior_action,
    replacing Action.
  • Added BehaviorSupportProfile to pygambit.
  • 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_float and MixedBehaviorProfile.as_float, converting a
    rational-precision profile to floating-point precision. liap_solve, liap_agent_solve,
    logit_estimate, ipa_solve, and gnm_solve now 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 the Outcome attached 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),
    and Game.get_max_payoff(player), replacing Player.strategies/.sequences/.min_payoff/
    .max_payoff now that Player has been removed.
  • In the GUI, computed strategy and behaviour profiles can now be sorted by probability (#1077)

Changed

  • Infoset is now a lazy, node-anchored view (like Node.player/Node.outcome), constructed
    by anchoring on a representative member node rather than carrying independent identity, and is
    now specific to personal players; see Event for the chance player. Infoset.is_chance has
    been removed, as Infoset is never chance; test truthiness of Node.infoset/Node.event
    instead.
    Game.append_infoset, Game.insert_infoset, Game.set_move_actions, Game.set_event_actions,
    Game.relabel_actions, Game.reveal, and Game.minimal_subgame now identify an information
    set or event via a member Node (or its label) rather than an Infoset object.
  • Infoset.actions/Event.actions/Node.actions now return the plain labels (list[str]) of
    the actions at the information set or event, rather than Action objects.
  • Sequence.actions now returns a tuple[str, ...] of labels rather than Action objects.
  • Node.prior_action/Node.own_prior_action now return a Branch (a (node, label) pair)
    rather than an Action.
  • Game.behavior_support_profile's actions filter callable is now called as
    actions(node, action) (two positional arguments, where node is a representative node of
    the information set and action is the action's label) rather than with a single Action.
  • Node.player now returns the player's label (str), or None at a terminal node, directly
    rather than a lazy NodePlayer proxy object. Infoset.player/Event.player/Sequence.player
    now likewise return a label (str) rather than a Player object.
  • StrategySupport.player, BehaviorSupport.player, MixedStrategy.player, and
    MixedBehavior.player now return a label (str) rather than a Player object.
  • Game.players now iterates player labels (str) rather than Player objects; indexing by
    label is no longer supported (a label is already in hand once iterated) -- use in to test
    membership.
  • Game.append_move, Game.insert_move, Game.reveal, Game.relabel_strategies, and
    Game.set_strategies now take player as a label (str) rather than accepting a Player
    object.
  • Game.strategy_support_profile's strategies filter callable's player argument is now a
    label (str) rather than a Player object.
  • Command-line tools are now implemented in pygambit rather than C++-based compiled programs.
    The gambit-convert utility has been removed.
  • Refreshed GUI icons and standardised dialog layout and formatting
  • Improved installers for Windows, and disk-image "installer" for MacOS
  • Revised StrategySupportProfile to expose a slimmer set of operations, and
    implement StrategySupport as 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 in pandas). Null outcomes do not appear when
    iterating over a game's outcomes, and assigning a payoff to one raises UndefinedOperationError. (#1061)
  • Game.new_table no 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 by Game.from_arrays and Game.from_dict are unaffected. (#1061)
  • Tutorial notebooks that use gtdraw to draw game trees now degrade gracefully if it isn't
    installed: the drawing cells print a short note instead of raising ImportError, so the rest
    of the tutorial (which doesn't otherwise depend on gtdraw) still runs. gtdraw depends on a
    LaTeX installation, so this lets the tutorials be run without that heavier local setup.

Removed

  • Game.add_outcome, Game.delete_outcome, and Game.set_outcome have 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)
  • gtdraw is no longer part of the doc optional-dependency group. Install it separately
    (pip install gtdraw) to run tutorials locally or build the documentation.
  • Game.contingencies now yields contingencies as a mapping from player label to strategy
    label, rather than a list of per-player strategy indices.
  • Game.strategy_support_profile's strategies filter callable is now called as
    strategies(player, label) (two positional arguments) rather than with a single Strategy.
  • Removed Player. Players are now identified purely by label (str), as returned by iterating
    Game.players. Player.strategies/.sequences/.min_payoff/.max_payoff are replaced by
    Game.get_strategies/Game.get_sequences/Game.get_min_payoff/Game.get_max_payoff;
    Player.number had no remaining use once labels are unambiguous (recover via
    list(game.players).index(label) if truly needed); Player.is_chance and Game.players.chance
    are removed outright, with no replacement -- test Node.event/Node.infoset truthiness
    instead. GamePlayerRep in the C++ core is unaffected by this change (a separate, later piece
    of work).
  • Game.get_behavior's player and strategy parameters are now labels (str) rather than
    accepting a Player/Strategy object; StrategyBehavior.player/.strategy now return
    labels rather than Player/Strategy objects.
  • Removed Game.__getitem__, replaced by Game.get_outcome/Game.get_payoffs.
  • Removed Game.strategies; iterate Game.players and each player's strategies instead.
  • Removed Strategy.action; use Game.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; a Strategy object carried no information a label didn't already
    carry, now that strategy labels are unique within a player. GameStrategyRep in the C++
    core is unaffected by this change (a separate, later piece of work).
  • Removed Player.infosets and Game.infosets; use Game.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 iterating Game.get_infosets(player) and
    each node's Node.actions.
  • Removed Action. Actions are now identified purely by label (str), as returned by
    Node.actions/Infoset.actions/Event.actions; use Node.action_probs for chance-event
    action probabilities, previously Action.prob, and Node.prior_action/Node.own_prior_action's
    Branch in place of an Action reached via a node. StrategyBehavior's prescribed actions
    are likewise now labels rather than Action objects. Also removed
    Infoset.own_prior_actions/Infoset.plays (and their Event mirrors), subsumed by the
    existing Node.own_prior_action/Node.plays.