Registering StateObservable-based envs
This commit is contained in:
parent
519c57bb64
commit
1354a0a853
@ -179,6 +179,7 @@ class ColumbusEnv(gym.Env):
|
|||||||
self.setup()
|
self.setup()
|
||||||
self.entities.append(self.agent) # add it last, will be drawn on top
|
self.entities.append(self.agent) # add it last, will be drawn on top
|
||||||
self._seed(self.env_seed)
|
self._seed(self.env_seed)
|
||||||
|
self.observable._entities = None
|
||||||
return self.observable.get_observation()
|
return self.observable.get_observation()
|
||||||
|
|
||||||
def _draw_entities(self):
|
def _draw_entities(self):
|
||||||
@ -338,9 +339,9 @@ class ColumbusEasierObstacles(ColumbusEnv):
|
|||||||
self.entities.append(enemy)
|
self.entities.append(enemy)
|
||||||
|
|
||||||
|
|
||||||
class ColumbusRewardEnemyPID(ColumbusEnv):
|
class ColumbusJustState(ColumbusEnv):
|
||||||
def __init__(self, observable=observables.StateObservable(), fps=30, env_seed=None):
|
def __init__(self, observable=observables.StateObservable(), fps=30, env_seed=None):
|
||||||
super(ColumbusRewardEnemyPID, self).__init__(
|
super(ColumbusJustState, self).__init__(
|
||||||
observable=observable, fps=fps)
|
observable=observable, fps=fps)
|
||||||
self.aux_reward_max = 0.1
|
self.aux_reward_max = 0.1
|
||||||
|
|
||||||
@ -359,10 +360,10 @@ class ColumbusRewardEnemyPID(ColumbusEnv):
|
|||||||
self.entities.append(reward)
|
self.entities.append(reward)
|
||||||
|
|
||||||
|
|
||||||
class ColumbusRewardEnemyPIDWithBarriers(ColumbusEnv):
|
class ColumbusStateWithBarriers(ColumbusEnv):
|
||||||
def __init__(self, observable=observables.StateObservable(), fps=30, env_seed=3.1):
|
def __init__(self, observable=observables.StateObservable(coordsAgent=True, speedAgent=False, coordsRelativeToAgent=False, coordsRewards=True, rewardsWhitelist=None, coordsEnemys=True, enemysWhitelist=None, enemysNoBarriers=True, rewardsTimeouts=False, include_rand=True), fps=30, env_seed=3.1):
|
||||||
super(ColumbusRewardEnemyPIDWithBarriers, self).__init__(
|
super(ColumbusStateWithBarriers, self).__init__(
|
||||||
observable=observable, fps=fps)
|
observable=observable, fps=fps, env_seed=env_seed)
|
||||||
self.aux_reward_max = 0.01
|
self.aux_reward_max = 0.01
|
||||||
self.start_pos = (0.5, 0.5)
|
self.start_pos = (0.5, 0.5)
|
||||||
|
|
||||||
@ -418,3 +419,9 @@ register(
|
|||||||
entry_point=ColumbusEasyObstacles,
|
entry_point=ColumbusEasyObstacles,
|
||||||
max_episode_steps=30*60*2,
|
max_episode_steps=30*60*2,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
register(
|
||||||
|
id='ColumbusStateWithBarriers-v0',
|
||||||
|
entry_point=ColumbusStateWithBarriers,
|
||||||
|
max_episode_steps=30*60*2,
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user