From 878a9fd2a231fc5c49df627c206316ff49831a26 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Tue, 16 Aug 2022 20:03:12 +0200 Subject: [PATCH] More configurability of ColumbusSingle --- columbus/env.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/columbus/env.py b/columbus/env.py index 855ac16..40807f8 100644 --- a/columbus/env.py +++ b/columbus/env.py @@ -456,21 +456,24 @@ class ColumbusComp(ColumbusEnv): class ColumbusSingle(ColumbusEnv): - def __init__(self, observable=observables.CompositionalObservable([observables.RayObservable(num_rays=6, chans=[entities.Enemy]), observables.StateObservable(coordsAgent=False, speedAgent=False, coordsRelativeToAgent=True, coordsRewards=True, rewardsWhitelist=None, coordsEnemys=False, enemysWhitelist=None, enemysNoBarriers=True, rewardsTimeouts=False, include_rand=True)]), hide_map=False, fps=30, env_seed=None, aux_reward_max=10, **kw): + def __init__(self, observable=observables.CompositionalObservable([observables.RayObservable(num_rays=6, chans=[entities.Enemy]), observables.StateObservable(coordsAgent=False, speedAgent=False, coordsRelativeToAgent=True, coordsRewards=True, rewardsWhitelist=None, coordsEnemys=False, enemysWhitelist=None, enemysNoBarriers=True, rewardsTimeouts=False, include_rand=True)]), hide_map=False, fps=30, env_seed=None, aux_reward_max=10, enemy_damage=1, reward_reward=25, void_damage=1, **kw): super().__init__( - observable=observable, fps=fps, env_seed=env_seed, aux_reward_max=aux_reward_max, **kw) + observable=observable, fps=fps, env_seed=env_seed, aux_reward_max=aux_reward_max, void_damage=void_damage**kw) self.draw_entities = not hide_map + self._enemy_damage = enemy_damage + self._reward_reward = reward_reward def setup(self): self.agent.pos = self.start_pos for i in range(4 + math.floor(self.random()*4)): enemy = entities.CircleBarrier(self) enemy.radius = 30 + self.random()*70 + enemy.damage = self._enemy_damage self.entities.append(enemy) for i in range(1): reward = entities.TeleportingReward(self) reward.radius = 30 - reward.reward *= 2 + reward.reward = self._reward_reward self.entities.append(reward)