nhra_gt.visualization.game_trees¶
Extensive-Form Game Tree Visualization.
This module provides tools for constructing and rendering extensive-form game trees using PyGambit and Graphviz. It supports both simple 2-player games and hierarchical 3-player (Hybrid) models.
Functions¶
beartype(func)
¶
create_extensive_game_from_matrix(u_row, u_col, title='NHRA Subgame', row_player_label='Commonwealth', col_player_label='State', row_action_labels=None, col_action_labels=None)
¶
Constructs a 2-player extensive form game from payoff matrices. Sequence: Player 1 moves, then Player 2 moves (perfect information).
Source code in src/nhra_gt/visualization/game_trees.py
create_hybrid_game_tree(u_cth, u_state_macro, micro_matrices, title='Hybrid NHRA Game')
¶
Constructs a 3-player hierarchical/hybrid game tree. Sequence: Cth -> State -> LHN.
Source code in src/nhra_gt/visualization/game_trees.py
render_tree_static(game, output_path)
¶
Renders the game tree to an SVG/PNG using Graphviz.
Traverses the PyGambit tree and builds a Graphviz Digraph.
Source code in src/nhra_gt/visualization/game_trees.py
export_gte_html(game, output_path)
¶
Exports the game in .efg format for use in Game Theory Explorer.
Source code in src/nhra_gt/visualization/game_trees.py
get_game_evidence(game_name)
¶
Returns bibliographic mapping for subgame nodes.