@@ -894,27 +894,94 @@ def test_logit_solve_lambda():
894894
895895def test_regrets_tmp ():
896896
897+ prof_data_doub = []
898+ prof_data_doub .append ([[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], [0.5 , 0.5 ]], [[1 , 0 ], [0 , 1 ]]])
899+ # prof_data_doub.append([[[1, 0], [1, 0]], [[1, 0], [0, 1]], [[1, 0], [0.33333, 0.6666]]])
900+ # prof_data_doub.append([[[1, 0], [1, 0]], [[1, 0], [0.5, 0.5]], [[0, 1], [1, 0]]])
901+ # prof_data_doub.append([[[1, 0], [1, 0]], [[1, 0], [0, 1]], [[0.33333, 0.6666], [1, 0]]])
902+
903+ prof_data_rat = []
904+ prof_data_rat .append ([[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], ["1/2" , "1/2" ]], [[1 , 0 ], [0 , 1 ]]])
905+ # prof_data_rat.append([[[1, 0], [1, 0]], [[1, 0], [0, 1]], [[1, 0], ["1/3", "2/3"]]])
906+ # prof_data_rat.append([[[1, 0], [1, 0]], [[1, 0], ["1/2", "1/2"]], [[0, 1], [1, 0]]])
907+ # prof_data_rat.append([[[1, 0], [1, 0]], [[1, 0], [0, 1]], [["1/3", "2/3"], [1, 0]]])
908+
897909 g = games .create_3_player_with_internal_outcomes_efg ()
898- prof_data = []
899- prof_data .append ([[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], [0.5 , 0.5 ]], [[1 , 0 ], [0 , 1 ]]])
900- prof_data .append ([[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], [0 , 1 ]], [[1 , 0 ], [0.33333 , 0.6666 ]]])
901- prof_data .append ([[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], [0.5 , 0.5 ]], [[0 , 1 ], [1 , 0 ]]])
902- prof_data .append ([[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], [0 , 1 ]], [[0.33333 , 0.6666 ], [1 , 0 ]]])
910+
911+ print ()
903912 print ("==================" )
904- for p in prof_data :
913+ for p in prof_data_doub :
905914 prof = g .mixed_behavior_profile (rational = False , data = p )
906- # print(prof)
907915 print (prof .max_regret ())
908916 print (prof .agent_max_regret ())
909-
910917 print ("==================" )
911- prof_data = []
912- prof_data .append ([[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], ["1/2" , "1/2" ]], [[1 , 0 ], [0 , 1 ]]])
913- prof_data .append ([[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], [0 , 1 ]], [[1 , 0 ], ["1/3" , "2/3" ]]])
914- prof_data .append ([[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], ["1/2" , "1/2" ]], [[0 , 1 ], [1 , 0 ]]])
915- prof_data .append ([[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], [0 , 1 ]], [["1/3" , "2/3" ], [1 , 0 ]]])
916- for p in prof_data :
918+ for p in prof_data_rat :
917919 prof = g .mixed_behavior_profile (rational = True , data = p )
918- # print(prof)
919920 print (prof .max_regret ())
920921 print (prof .agent_max_regret ())
922+ print ("==================" )
923+ for p in prof_data_doub :
924+ prof = g .mixed_behavior_profile (rational = False , data = p )
925+ print (prof .max_regret ())
926+ print (prof .agent_max_regret ())
927+
928+
929+ def test_regrets_tmp2 ():
930+
931+ g = games .create_3_player_with_internal_outcomes_efg ()
932+
933+ prof_data_rat = [[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], ["1/2" , "1/2" ]], [[1 , 0 ], [0 , 1 ]]]
934+ profile_rat = g .mixed_behavior_profile (rational = True , data = prof_data_rat )
935+ print ()
936+ print (profile_rat .max_regret ()) # 3/2
937+ # print(profile1.max_regret()) # same
938+ profile_rat = g .mixed_behavior_profile (rational = True , data = prof_data_rat )
939+ print (profile_rat .max_regret ()) # now different! 0
940+ print ("=======================================" )
941+
942+ prof_data_doub = [[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], [0.5 , 0.5 ]], [[1 , 0 ], [0 , 1 ]]]
943+ profile_doub = g .mixed_behavior_profile (rational = False , data = prof_data_doub )
944+ print ()
945+ print (profile_doub .max_regret ())
946+ # print(profile1.max_regret()) # same
947+ profile_doub = g .mixed_behavior_profile (rational = False , data = prof_data_doub )
948+ print (profile_doub .max_regret ())
949+ print ("=======================================" )
950+
951+ prof_data_rat = [[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], ["1/2" , "1/2" ]], [[1 , 0 ], [0 , 1 ]]]
952+ profile_rat = g .mixed_behavior_profile (rational = True , data = prof_data_rat )
953+ print ()
954+ print (profile_rat .max_regret ())
955+ # print(profile1.max_regret()) # same
956+ profile_rat = g .mixed_behavior_profile (rational = True , data = prof_data_rat )
957+ print (profile_rat .max_regret ())
958+ print ("=======================================" )
959+
960+
961+ def test_regrets_tmp3 ():
962+
963+ g = games .create_3_player_with_internal_outcomes_efg ()
964+
965+ prof_data_doub = [[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], [0.5 , 0.5 ]], [[1 , 0 ], [0 , 1 ]]]
966+ profile_doub = g .mixed_behavior_profile (rational = False , data = prof_data_doub )
967+ print ()
968+ print (profile_doub .max_regret ()) # 1.5
969+ profile_doub = g .mixed_behavior_profile (rational = False , data = prof_data_doub )
970+ print (profile_doub .max_regret ()) # now different! 0
971+ print ("=======================================" )
972+
973+ prof_data_rat = [[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], ["1/2" , "1/2" ]], [[1 , 0 ], [0 , 1 ]]]
974+ profile_rat = g .mixed_behavior_profile (rational = True , data = prof_data_rat )
975+ print ()
976+ print (profile_rat .max_regret ())
977+ profile_rat = g .mixed_behavior_profile (rational = True , data = prof_data_rat )
978+ print (profile_rat .max_regret ())
979+ print ("=======================================" )
980+
981+ prof_data_doub = [[[1 , 0 ], [1 , 0 ]], [[1 , 0 ], [0.5 , 0.5 ]], [[1 , 0 ], [0 , 1 ]]]
982+ profile_doub = g .mixed_behavior_profile (rational = False , data = prof_data_doub )
983+ print ()
984+ print (profile_doub .max_regret ())
985+ profile_doub = g .mixed_behavior_profile (rational = False , data = prof_data_doub )
986+ print (profile_doub .max_regret ())
987+ print ("=======================================" )
0 commit comments