Ejemplo n.º 1
0
 def test_efg_game(self):
   game = pyspiel.load_efg_game(pyspiel.get_sample_efg_data())
   # EFG games loaded directly by string cannot serialize because the game's
   # data cannot be passed in via string parameter.
   for _ in range(0, 100):
     self.sim_game(
         game,
         check_pyspiel_serialization=False,
         check_pickle_serialization=False)
   game = pyspiel.load_efg_game(pyspiel.get_kuhn_poker_efg_data())
   for _ in range(0, 100):
     self.sim_game(
         game,
         check_pyspiel_serialization=False,
         check_pickle_serialization=False)
   # EFG games loaded by file should serialize properly:
   filename = file_utils.find_file(
       "open_spiel/games/efg/sample.efg", 2)
   if filename is not None:
     game = pyspiel.load_game("efg_game(filename=" + filename + ")")
     for _ in range(0, 100):
       self.sim_game(game)
   filename = file_utils.find_file(
       "open_spiel/games/efg/sample.efg", 2)
   if filename is not None:
     game = pyspiel.load_game("efg_game(filename=" + filename + ")")
     for _ in range(0, 100):
       self.sim_game(game)
Ejemplo n.º 2
0
def _import_data_create_game():
    """Creates a game via imported payoff data."""
    payoff_file = file_utils.find_file(
        "open_spiel/data/paper_data/response_graph_ucb/soccer.txt", 2)
    payoffs = np.loadtxt(payoff_file) * 2 - 1
    return pyspiel.create_matrix_game(payoffs, payoffs.T)
Ejemplo n.º 3
0
def get_soccer_data():
    """Returns the payoffs and strategy labels for MuJoCo soccer experiments."""
    payoff_file = file_utils.find_file(
        'open_spiel/data/paper_data/response_graph_ucb/soccer.txt', 2)
    payoffs = np.loadtxt(payoff_file)
    return payoffs