diff --git a/examples/introduction_flatland_2_1.py b/examples/introduction_flatland_2_1.py index 214f0c547af4adceda9e12194a3b4deafe3ffaae..87451ecef1f7a07c475c02a3be5915a5cb408ce9 100644 --- a/examples/introduction_flatland_2_1.py +++ b/examples/introduction_flatland_2_1.py @@ -27,7 +27,7 @@ from flatland.utils.rendertools import RenderTool, AgentRenderVariant width = 16*7 # With of map height = 9*7 # Height of map -nr_trains = 10 # Number of trains that have an assigned task in the env +nr_trains = 20 # Number of trains that have an assigned task in the env cities_in_map = 20 # Number of cities where agents can start or end seed = 14 # Random seed grid_distribution_of_cities = False # Type of city distribution, if False cities are randomly placed @@ -58,7 +58,7 @@ schedule_generator = sparse_schedule_generator(speed_ration_map) # We can furthermore pass stochastic data to the RailEnv constructor which will allow for stochastic malfunctions # during an episode. -stochastic_data = {'malfunction_rate': 1000, # Rate of malfunction occurence of single agent +stochastic_data = {'malfunction_rate': 5, # Rate of malfunction occurence of single agent 'min_duration': 3, # Minimal duration of malfunction 'max_duration': 20 # Max duration of malfunction } diff --git a/flatland/envs/rail_env.py b/flatland/envs/rail_env.py index e11243046256a28f04913f40ef7ef29539e90c39..8090cff688cb0822fb1ceb2f1fee803fe47ccb16 100644 --- a/flatland/envs/rail_env.py +++ b/flatland/envs/rail_env.py @@ -427,7 +427,6 @@ class RailEnv(Environment): """ if self.np_random.rand() < self._malfunction_prob(rate, len(self.active_agents)): - print("Malfunction") # Select only from agents that are not done yet breaking_agent_idx = self.np_random.choice(self.active_agents) breaking_agent = self.agents[breaking_agent_idx] diff --git a/tests/test_utils.py b/tests/test_utils.py index ff4948d629747a3394644b971105178ec1ac4523..6dfc6239ed191d06c16feeca5e8d68dbd6654952 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -121,7 +121,7 @@ def run_replay_config(env: RailEnv, test_configs: List[ReplayConfig], rendering: agent.malfunction_data['moving_before_malfunction'] = agent.moving agent.malfunction_data['fixed'] = False _assert(a, agent.malfunction_data['malfunction'], replay.malfunction, 'malfunction') - print(step, agent.moving, agent.malfunction_data['fixed'], agent.malfunction_data['malfunction']) + print(step) _, rewards_dict, _, info_dict = env.step(action_dict) if rendering: renderer.render_env(show=True, show_observations=True)