diff --git a/columbus/env.py b/columbus/env.py index 1814915..acc8651 100644 --- a/columbus/env.py +++ b/columbus/env.py @@ -855,6 +855,8 @@ class ColumbusConfigDefined(ColumbusEnv): if type(s) in [int, float]: return s if s.replace('.', '', 1).isdigit(): + if target == 'px': + return int(s) return float(s) num, unit = s[:-2], s[-2:] num = float(num) @@ -876,7 +878,7 @@ class ColumbusConfigDefined(ColumbusEnv): if target == 'em': return em elif target == 'px': - return em * ({'x': self.width, 'y': self.height}[axis]) + return int(em * ({'x': self.width, 'y': self.height}[axis])) def setup(self): self.agent.pos = self.start_pos diff --git a/configs/Example_Units.yaml b/configs/Example_Units.yaml index 14c005e..4e621a4 100644 --- a/configs/Example_Units.yaml +++ b/configs/Example_Units.yaml @@ -63,6 +63,11 @@ params: width: 25ry height: 25rx pos: [0.75em, 60px] + - type: RectBarrier + num: 1 + width: 2ct + height: 3ct + pos: [0.75em, 90px] - type: OnceReward reward: 100 radius: 3ct