More configurability of ColumbusSingle

This commit is contained in:
Dominik Moritz Roth 2022-08-16 20:03:12 +02:00
parent 7facadfb87
commit 878a9fd2a2

View File

@ -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)