def test_random_game(self): """Test random simulation.""" game = pyspiel.load_game("python_mfg_dynamic_routing") pyspiel.random_sim_test(game, num_sims=10, serialize=False, verbose=True)
def test_game_from_cc(self): """Runs our standard game tests, checking API consistency.""" game = pyspiel.load_game("python_tic_tac_toe") pyspiel.random_sim_test(game, num_sims=10, serialize=False, verbose=True)
def test_game_from_cc(self): """Runs our standard game tests, checking API consistency.""" game = pyspiel.load_game("python_iterated_prisoners_dilemma") pyspiel.random_sim_test(game, num_sims=10, serialize=False, verbose=True)
def test_game_as_turn_based(self): """Check the game can be converted to a turn-based game.""" game = pyspiel.load_game("python_iterated_prisoners_dilemma") turn_based = pyspiel.convert_to_turn_based(game) pyspiel.random_sim_test(turn_based, num_sims=10, serialize=False, verbose=True)
def test_game_as_turn_based_via_string(self): """Check the game can be created as a turn-based game from a string.""" game = pyspiel.load_game( "turn_based_simultaneous_game(game=python_iterated_prisoners_dilemma())" ) pyspiel.random_sim_test(game, num_sims=10, serialize=False, verbose=True)
def test_random_game(self): """Tests basic API functions.""" horizon = 20 size = 50 game = crowd_modelling.MFGCrowdModellingGame(params={ "horizon": horizon, "size": size }) pyspiel.random_sim_test( game, num_sims=10, serialize=False, verbose=True)
def test_random_game(self, population): """Tests basic API functions.""" horizon = 10 size = 20 game = predator_prey.MFGPredatorPreyGame(params={ 'horizon': horizon, 'size': size, }) pyspiel.random_sim_test(game, num_sims=10, serialize=False, verbose=True, mean_field_population=population)
def test_multiple_departure_time_vehicle(self): """Check that departure time can be define.""" vehicles = [ dynamic_routing_utils.Vehicle("O->A", "D->E", 0), dynamic_routing_utils.Vehicle("O->A", "D->E", 0.5), dynamic_routing_utils.Vehicle("O->A", "D->E", 1.0) ] game = dynamic_routing.DynamicRoutingGame( { "max_num_time_step": 10, "time_step_length": 0.5, "players": -1 }, vehicles=vehicles) pyspiel.random_sim_test(game, num_sims=10, serialize=False, verbose=True)
def test_multiple_departure_time_vehicle(self): """Check that departure time can be define.""" od_demand = [ dynamic_routing_utils.OriginDestinationDemand( "O->A", "D->E", 0, 5), dynamic_routing_utils.OriginDestinationDemand( "O->A", "D->E", 0.5, 5), dynamic_routing_utils.OriginDestinationDemand( "O->A", "D->E", 1.0, 5) ] game = dynamic_routing.MeanFieldRoutingGame( { "max_num_time_step": 10, "time_step_length": 0.5, "players": -1 }, od_demand=od_demand) pyspiel.random_sim_test(game, num_sims=10, serialize=False, verbose=True)
def test_game_as_turn_based(self): """Check the game can be converted to a turn-based game.""" game = pyspiel.load_game("python_dynamic_routing") turn_based = pyspiel.convert_to_turn_based(game) pyspiel.random_sim_test( turn_based, num_sims=10, serialize=False, verbose=True)
def test_random_game(self): """Tests basic API functions with the standard game tests.""" game = pyspiel.load_game("python_dynamic_routing") pyspiel.random_sim_test(game, num_sims=10, serialize=False, verbose=True)