diff --git a/examples/demo.py b/examples/demo.py index fa897713e1987082ffecf1b1bc824d1329c44342..ae19cedce053da18fdf971059743690c6e7e52d3 100644 --- a/examples/demo.py +++ b/examples/demo.py @@ -96,6 +96,7 @@ class Demo: for iAgent in range(self.env.get_num_agents()): # allways walk straight forward action = 2 + action = np.random.choice([0, 1, 2, 3], 1, p=[0.0, 0.5, 0.5, 0.0])[0] # update the actions action_dict.update({iAgent: action}) @@ -161,7 +162,7 @@ class Demo: @staticmethod def run_complex_scene(): - demo_001 = Demo(Scenario_Generator.load_scenario('complex_scene.pkl')) + demo_001 = Demo(Scenario_Generator.load_scenario('demo_001.pkl')) demo_001.set_record_frames(os.path.join(__file_dirname__, '..', 'rendering', 'frame_{:04d}.bmp')) demo_001.run_demo(120) diff --git a/flatland/utils/editor.py b/flatland/utils/editor.py index 081cf02c804f5a8d64542b2cfdc75c664bc479a9..d385f41e22ebd6191589dad1e1bf243aec3d4096 100644 --- a/flatland/utils/editor.py +++ b/flatland/utils/editor.py @@ -722,6 +722,7 @@ class EditorModel(object): agent_static = EnvAgentStatic(rcCell, 0, rcCell, moving=False) self.iSelectedAgent = self.env.add_agent_static(agent_static) self.player = None # will need to start a new player + self.view.oRT.update_background() else: # Move the selected agent to this cell agent_static = self.env.agents_static[self.iSelectedAgent] @@ -745,6 +746,7 @@ class EditorModel(object): if self.iSelectedAgent is not None: self.env.agents_static[self.iSelectedAgent].target = rcCell self.init_agents_static = None + self.view.oRT.update_background() self.redraw() def step(self): diff --git a/notebooks/Scene_Editor.ipynb b/notebooks/Scene_Editor.ipynb index 444c1ebf023a06294b04f58a4f180a46608f6d96..18b18a1fbe10ee6e75bf215b3172c14244af822a 100644 --- a/notebooks/Scene_Editor.ipynb +++ b/notebooks/Scene_Editor.ipynb @@ -100,7 +100,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "140f16d2c9a643e39d68c6421e50b9bd", + "model_id": "485775e396784212ae3b33c820f3ec25", "version_major": 2, "version_minor": 0 },