@@ -352,7 +352,7 @@ def create_3_player_with_internal_outcomes_efg(nonterm_outcomes: bool = False) -
352352 o = g .add_outcome ([0 , 0 , 0 ])
353353 g .set_outcome (g .root .children [0 ].children [0 ].children [1 ].children [0 ], o )
354354 g .set_outcome (g .root .children [0 ].children [0 ].children [1 ].children [1 ], o )
355- g . to_efg ( f"TEST_ { nonterm_outcomes } .efg" )
355+ # g.sort_infosets( )
356356 return g
357357
358358
@@ -652,7 +652,7 @@ def create_kuhn_poker_efg(nonterm_outcomes: bool = False) -> gbt.Game:
652652 g = _create_kuhn_poker_efg_only_term_outcomes ()
653653
654654 # Ensure infosets are in the same order as if game was written to efg and read back in
655- g .sort_infosets ()
655+ # g.sort_infosets()
656656 return g
657657
658658
@@ -850,6 +850,107 @@ def create_reduction_both_players_payoff_ties_efg() -> gbt.Game:
850850 return g
851851
852852
853+ def create_problem_example_efg () -> gbt .Game :
854+ g = gbt .Game .new_tree (players = ["1" , "2" ], title = "" )
855+ g .append_move (g .root , player = "1" , actions = ["L" , "R" ])
856+ # do the second child first on purpose to diverge from sort infosets order
857+ g .append_move (g .root .children [1 ], "2" , actions = ["l2" , "r2" ])
858+ g .append_move (g .root .children [0 ], "2" , actions = ["l1" , "r1" ])
859+ g .set_outcome (g .root .children [0 ].children [0 ], outcome = g .add_outcome (payoffs = [5 , - 5 ]))
860+ g .set_outcome (g .root .children [0 ].children [1 ], outcome = g .add_outcome (payoffs = [2 , - 2 ]))
861+ g .set_outcome (g .root .children [1 ].children [0 ], outcome = g .add_outcome (payoffs = [- 5 , 5 ]))
862+ g .set_outcome (g .root .children [1 ].children [1 ], outcome = g .add_outcome (payoffs = [- 2 , 2 ]))
863+ return g
864+
865+
866+ def create_STOC_simplified () -> gbt .Game :
867+ """
868+ """
869+ g = gbt .Game .new_tree (players = ["1" , "2" ], title = "" )
870+ g .append_move (g .root , g .players .chance , actions = ["1" , "2" ])
871+ g .set_chance_probs (g .root .infoset , [0.2 , 0.8 ])
872+ g .append_move (g .root .children [0 ], player = "1" , actions = ["l" , "r" ])
873+ g .append_move (g .root .children [1 ], player = "1" , actions = ["c" , "d" ])
874+ g .append_move (g .root .children [0 ].children [1 ], player = "2" , actions = ["p" , "q" ])
875+ g .append_move (
876+ g .root .children [0 ].children [1 ].children [0 ], player = "1" , actions = ["L" , "R" ]
877+ )
878+ g .append_infoset (
879+ g .root .children [0 ].children [1 ].children [1 ],
880+ g .root .children [0 ].children [1 ].children [0 ].infoset ,
881+ )
882+ g .set_outcome (
883+ g .root .children [0 ].children [0 ],
884+ outcome = g .add_outcome (payoffs = [5 , - 5 ], label = "l" ),
885+ )
886+ g .set_outcome (
887+ g .root .children [0 ].children [1 ].children [0 ].children [0 ],
888+ outcome = g .add_outcome (payoffs = [10 , - 10 ], label = "rpL" ),
889+ )
890+ g .set_outcome (
891+ g .root .children [0 ].children [1 ].children [0 ].children [1 ],
892+ outcome = g .add_outcome (payoffs = [15 , - 15 ], label = "rpR" ),
893+ )
894+ g .set_outcome (
895+ g .root .children [0 ].children [1 ].children [1 ].children [0 ],
896+ outcome = g .add_outcome (payoffs = [20 , - 20 ], label = "rqL" ),
897+ )
898+ g .set_outcome (
899+ g .root .children [0 ].children [1 ].children [1 ].children [1 ],
900+ outcome = g .add_outcome (payoffs = [- 5 , 5 ], label = "rqR" ),
901+ )
902+ g .set_outcome (
903+ g .root .children [1 ].children [0 ],
904+ outcome = g .add_outcome (payoffs = [10 , - 10 ], label = "c" ),
905+ )
906+ g .set_outcome (
907+ g .root .children [1 ].children [1 ],
908+ outcome = g .add_outcome (payoffs = [20 , - 20 ], label = "d" ),
909+ )
910+ # g.sort_infosets()
911+ return g
912+
913+
914+ def create_STOC_simplified2 () -> gbt .Game :
915+ """
916+ """
917+ g = gbt .Game .new_tree (players = ["1" , "2" ], title = "" )
918+ g .append_move (g .root , g .players .chance , actions = ["1" , "2" ])
919+ g .set_chance_probs (g .root .infoset , [0.2 , 0.8 ])
920+ g .append_move (g .root .children [0 ], player = "1" , actions = ["r" ])
921+ g .append_move (g .root .children [1 ], player = "1" , actions = ["c" ])
922+ g .append_move (g .root .children [0 ].children [0 ], player = "2" , actions = ["p" , "q" ])
923+ g .append_move (
924+ g .root .children [0 ].children [0 ].children [0 ], player = "1" , actions = ["L" , "R" ]
925+ )
926+ g .append_infoset (
927+ g .root .children [0 ].children [0 ].children [1 ],
928+ g .root .children [0 ].children [0 ].children [0 ].infoset ,
929+ )
930+ g .set_outcome (
931+ g .root .children [0 ].children [0 ].children [0 ].children [0 ],
932+ outcome = g .add_outcome (payoffs = [10 , - 10 ], label = "rpL" ),
933+ )
934+ g .set_outcome (
935+ g .root .children [0 ].children [0 ].children [0 ].children [1 ],
936+ outcome = g .add_outcome (payoffs = [15 , - 15 ], label = "rpR" ),
937+ )
938+ g .set_outcome (
939+ g .root .children [0 ].children [0 ].children [1 ].children [0 ],
940+ outcome = g .add_outcome (payoffs = [20 , - 20 ], label = "rqL" ),
941+ )
942+ g .set_outcome (
943+ g .root .children [0 ].children [0 ].children [1 ].children [1 ],
944+ outcome = g .add_outcome (payoffs = [- 5 , 5 ], label = "rqR" ),
945+ )
946+ g .set_outcome (
947+ g .root .children [1 ].children [0 ],
948+ outcome = g .add_outcome (payoffs = [10 , - 10 ], label = "c" ),
949+ )
950+ # g.sort_infosets()
951+ return g
952+
953+
853954def create_seq_form_STOC_paper_zero_sum_2_player_efg () -> gbt .Game :
854955 """
855956 Example from
@@ -928,7 +1029,7 @@ def create_seq_form_STOC_paper_zero_sum_2_player_efg() -> gbt.Game:
9281029 g .root .children [0 ].children [1 ].infoset .label = "01"
9291030 g .root .children [2 ].children [0 ].infoset .label = "20"
9301031 g .root .children [0 ].children [1 ].children [0 ].infoset .label = "010"
931-
1032+ # g.sort_infosets()
9321033 return g
9331034
9341035
0 commit comments