Elasticity now configurable using args

This commit is contained in:
Dominik Moritz Roth 2022-08-27 11:35:57 +02:00
parent 5cd9bd394c
commit 581b733763

View File

@ -45,7 +45,7 @@ def parseObs(obsConf):
class ColumbusEnv(gym.Env): class ColumbusEnv(gym.Env):
metadata = {'render.modes': ['human']} 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__() super(ColumbusEnv, self).__init__()
self.action_space = spaces.Box( self.action_space = spaces.Box(
low=-1, high=1, shape=(2,), dtype=np.float32) 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_barrier = void_is_type_barrier
self.void_damage = void_damage self.void_damage = void_damage
self.torus_topology = torus_topology self.torus_topology = torus_topology
self.default_collision_elasticity = 1 self.default_collision_elasticity = default_collision_elasticity
self.paused = False self.paused = False
self.keypress_timeout = 0 self.keypress_timeout = 0