From 1bf587c4dab6c6943600d04b2bace1e15c8ed4f2 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Tue, 6 Dec 2022 12:25:20 +0100 Subject: [PATCH] Allow units for 'start_pos' (initial agent position) --- columbus/env.py | 2 ++ configs/Example_Units.yaml | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/columbus/env.py b/columbus/env.py index 7c3d400..28fcfc3 100644 --- a/columbus/env.py +++ b/columbus/env.py @@ -504,6 +504,8 @@ class ColumbusConfigDefined(ColumbusEnv): super().__init__( observable=observable, fps=fps, env_seed=env_seed, **kw) self.entities_definitions = entities + self.start_pos = self.conv_unit(self.start_pos[0], target='em', axis='x'), self.conv_unit( + self.start_pos[1], target='em', axis='y') def is_unit(self, s): if type(s) in [int, float]: diff --git a/configs/Example_Units.yaml b/configs/Example_Units.yaml index 4e621a4..4499b74 100644 --- a/configs/Example_Units.yaml +++ b/configs/Example_Units.yaml @@ -65,14 +65,14 @@ params: pos: [0.75em, 60px] - type: RectBarrier num: 1 - width: 2ct - height: 3ct + width: 20 # defaults to rx (px scaled from x-axis) + height: 10 # defaults to ry (px scaled from y-axis) pos: [0.75em, 90px] - type: OnceReward reward: 100 radius: 3ct - pos: [0.3, 0.8] - start_pos: [0.1, 0.21] + pos: [0.3, 0.8] # defaults to em + start_pos: [90ct, 20ct] default_collision_elasticity: 0.8 start_score: 10 speed_fac: 0.01