From 581b73376362a7202790a25f7ea97d7942a190a7 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sat, 27 Aug 2022 11:35:57 +0200 Subject: [PATCH] Elasticity now configurable using args --- columbus/env.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/columbus/env.py b/columbus/env.py index 00b01ea..bec6fbc 100644 --- a/columbus/env.py +++ b/columbus/env.py @@ -45,7 +45,7 @@ def parseObs(obsConf): class ColumbusEnv(gym.Env): metadata = {'render.modes': ['human']} - def __init__(self, observable=observables.Observable(), fps=60, env_seed=3.1, start_pos=(0.5, 0.5), start_score=0, speed_fac=0.01, acc_fac=0.02, die_on_zero=False, return_on_score=-1, reward_mult=1, agent_drag=0, controll_type='SPEED', aux_reward_max=1, aux_penalty_max=0, aux_reward_discretize=0, void_is_type_barrier=True, void_damage=1, torus_topology=False): + def __init__(self, observable=observables.Observable(), fps=60, env_seed=3.1, start_pos=(0.5, 0.5), start_score=0, speed_fac=0.01, acc_fac=0.02, die_on_zero=False, return_on_score=-1, reward_mult=1, agent_drag=0, controll_type='SPEED', aux_reward_max=1, aux_penalty_max=0, aux_reward_discretize=0, void_is_type_barrier=True, void_damage=1, torus_topology=False, default_collision_elasticity=1): super(ColumbusEnv, self).__init__() self.action_space = spaces.Box( low=-1, high=1, shape=(2,), dtype=np.float32) @@ -87,7 +87,7 @@ class ColumbusEnv(gym.Env): self.void_barrier = void_is_type_barrier self.void_damage = void_damage self.torus_topology = torus_topology - self.default_collision_elasticity = 1 + self.default_collision_elasticity = default_collision_elasticity self.paused = False self.keypress_timeout = 0