Adding the envs from my thesis

This commit is contained in:
Dominik Moritz Roth 2022-11-13 20:00:15 +01:00
parent d8856e7dc9
commit 06bfcfe065
6 changed files with 202 additions and 2 deletions

View File

@ -21,7 +21,8 @@ Contains the ColumbusEnv.
There exist two ways to implement new envs: There exist two ways to implement new envs:
- Subclassing ColumbusEnv and expanding _init_ and overriding _setup_. - Subclassing ColumbusEnv and expanding _init_ and overriding _setup_.
- Using the ColumbusConfigDefined with a desired configuration. This makes configuring ColumbusEnvs via ClusterWorks2-configs possible. (See ColumbusConfigDefinedExample.yaml for an example of how the parameters are supposed to look like (uses yaml format), I don't have time to write a better documentation right now...) (To test this run 'python humanPlayer.py', select 5, give path to ColumbusConfigDefinedExample.yaml, select 0) - Using the ColumbusConfigDefined with a desired configuration. This makes configuring ColumbusEnvs via ClusterWorks2-configs possible. (See configs/example.yaml for an example of how the parameters are supposed to look like (uses yaml format)
- The environments used in my thesis can also be found in configs/
##### Some caveats / infos ##### Some caveats / infos

View File

@ -91,11 +91,11 @@ class ColumbusEnv(gym.Env):
self.terminate_on_reward = terminate_on_reward self.terminate_on_reward = terminate_on_reward
self.agent_draw_path = agent_draw_path self.agent_draw_path = agent_draw_path
self.clear_path_on_reset = clear_path_on_reset self.clear_path_on_reset = clear_path_on_reset
if value_color_mapper == 'atan': if value_color_mapper == 'atan':
def value_color_mapper(x): return th.atan(x*2)/0.786/2 def value_color_mapper(x): return th.atan(x*2)/0.786/2
elif value_color_mapper == 'tanh': elif value_color_mapper == 'tanh':
def value_color_mapper(x): return th.tanh(x*2)/0.762/2 def value_color_mapper(x): return th.tanh(x*2)/0.762/2
self.value_color_mapper = value_color_mapper self.value_color_mapper = value_color_mapper
self.max_steps = max_steps self.max_steps = max_steps

View File

@ -0,0 +1,78 @@
name: "DEFAULT"
params:
task:
task: columbus
env_name: ColumbusConfigDefined-v0
env_args:
observable:
- type: State
coordsAgent: True
speedAgent: True
coordsRelativeToAgent: False
coordsRewards: True
coordsEnemys: False
enemysNoBarriers: True
rewardsTimeouts: False
include_rand: True
- type: State
coordsAgent: False
speedAgent: False
coordsRelativeToAgent: True
coordsRewards: True
coordsEnemys: False
enemysNoBarriers: True
rewardsTimeouts: False
include_rand: True
- type: Compass
- type: RayCast
num_rays: 6
chans: [Enemy]
entities:
- type: RectBarrier
damage: 1 #1
width: 300
height: 120 # 360 - 5%(720)
pos: [0, 0]
- type: RectBarrier
damage: 1 #1
width: 300
height: 1000
pos: [0, 0.25]
- type: RectBarrier
damage: 1 #1
width: 250
height: 30
pos: [0.55, 0.6]
- type: RectBarrier
damage: 1 #1
width: 30
height: 120
pos: [0.856, 0.475]
- type: RectBarrier
num: 0
damage: 1 #1
width: 50
width_rand: 100
height: 25
height_rand: 100
- type: OnceReward
reward: 100
radius: 20
pos: [0.9, 0.8]
start_pos: [0.1, 0.21]
default_collision_elasticity: 0.8
start_score: 10
speed_fac: 0.01
acc_fac: 0.1
die_on_zero: False #True
agent_drag: 0.1 # 0.05
controll_type: ACC # SPEED
aux_reward_max: 1
aux_penalty_max: 0.01
void_damage: 5 #1
terminate_on_reward: True
agent_draw_path: True
clear_path_on_reset: False
max_steps: 450 # 1800
---

View File

@ -0,0 +1,54 @@
name: "DEFAULT"
params:
task:
task: columbus
num_envs: 8
env_args:
observable:
- type: State
coordsAgent: True
speedAgent: True
coordsRelativeToAgent: False
coordsRewards: True
coordsEnemys: False
enemysNoBarriers: True
rewardsTimeouts: False
include_rand: True
- type: State
coordsAgent: False
speedAgent: False
coordsRelativeToAgent: True
coordsRewards: True
coordsEnemys: False
enemysNoBarriers: True
rewardsTimeouts: False
include_rand: True
- type: Compass
- type: RayCast
num_rays: 8
chans: [Enemy]
entities:
- type: CircleBarrier
num: 8
num_rand: 6
damage: 20 #20
radius: 25
radius_rand: 75
- type: TeleportingReward
num: 1
reward: 100 #100
radius: 20
default_collision_elasticity: 0.8
start_score: 50
speed_fac: 0.01
acc_fac: 0.1
die_on_zero: True
agent_drag: 0.07 # 0.05
controll_type: ACC # SPEED
aux_reward_max: 1
aux_penalty_max: 0.1
void_damage: 5 #1
#master_seed: 3.14
max_steps: 900 # 30 sec
---

View File

@ -0,0 +1,67 @@
name: "DEFAULT"
params:
task:
task: columbus
env_name: ColumbusConfigDefined-v0
env_args:
observable:
- type: State
coordsAgent: True
speedAgent: True
coordsRelativeToAgent: False
coordsRewards: True
coordsEnemys: False
enemysNoBarriers: True
rewardsTimeouts: False
include_rand: True
- type: State
coordsAgent: False
speedAgent: False
coordsRelativeToAgent: True
coordsRewards: True
coordsEnemys: False
enemysNoBarriers: True
rewardsTimeouts: False
include_rand: True
- type: RayCast
num_rays: 6
chans: [Enemy]
entities:
- type: RectBarrier
damage: 10 #1
width: 25
height: 120 # 360 - 5%(720)
pos: [0.45, 0]
- type: RectBarrier
damage: 10 #1
width: 25
height: 1000
pos: [0.45, 0.25]
- type: RectBarrier
damage: 10 #1
width: 25
height: 520 # 360 - 5%(720)
pos: [0.55, 0]
- type: RectBarrier
damage: 10 #1
width: 25
height: 200
pos: [0.55, 0.80]
- type: LoopReward
num: 1
reward: 100 #25
radius: 20
loop: [[0.125, 0.5, 0.1, 0.5], [0.875, 0.5, 0.1, 0.5]]
default_collision_elasticity: 0.8
start_score: 10
speed_fac: 0.01
acc_fac: 0.1
die_on_zero: False #True
agent_drag: 0.1 # 0.05
controll_type: ACC # SPEED
aux_reward_max: 1
aux_penalty_max: 0.01
void_damage: 5 #1
agent_draw_path: True
---