Allow units for 'start_pos' (initial agent position)

This commit is contained in:
Dominik Moritz Roth 2022-12-06 12:25:20 +01:00
parent 6d465c69c9
commit 1bf587c4da
2 changed files with 6 additions and 4 deletions

View File

@ -504,6 +504,8 @@ class ColumbusConfigDefined(ColumbusEnv):
super().__init__( super().__init__(
observable=observable, fps=fps, env_seed=env_seed, **kw) observable=observable, fps=fps, env_seed=env_seed, **kw)
self.entities_definitions = entities 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): def is_unit(self, s):
if type(s) in [int, float]: if type(s) in [int, float]:

View File

@ -65,14 +65,14 @@ params:
pos: [0.75em, 60px] pos: [0.75em, 60px]
- type: RectBarrier - type: RectBarrier
num: 1 num: 1
width: 2ct width: 20 # defaults to rx (px scaled from x-axis)
height: 3ct height: 10 # defaults to ry (px scaled from y-axis)
pos: [0.75em, 90px] pos: [0.75em, 90px]
- type: OnceReward - type: OnceReward
reward: 100 reward: 100
radius: 3ct radius: 3ct
pos: [0.3, 0.8] pos: [0.3, 0.8] # defaults to em
start_pos: [0.1, 0.21] start_pos: [90ct, 20ct]
default_collision_elasticity: 0.8 default_collision_elasticity: 0.8
start_score: 10 start_score: 10
speed_fac: 0.01 speed_fac: 0.01