Skip to content

Commit

Permalink
Change arena config indices and add combinor dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kozzy97 committed Nov 21, 2022
1 parent 9f08df3 commit 82dc2ec
Show file tree
Hide file tree
Showing 12,556 changed files with 13,425 additions and 13,387 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
29 changes: 29 additions & 0 deletions config_combinor/Combine-Config.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Combine-Configs function

# This function takes an input path to a directory containing some configs, a regex for which files to include, a regex for which files to exclude, an output path, and a name for a the combined file.
# It outputs a combined YML config at the path of your choice.
# input and output paths default to the current working directory, and regexes default to all '.yml' or '.yaml' files in the working directory

function Combine-Configs{
param(
$inputpath = cd
$regexinclude = '*.yml|*.yaml'
$regexexclude = "!"
$outputpath = cd
$name
)
$AllYAMLs = Get-ChildItem -include $regexinclude -exclude $regexexclude
Write-Host "Number of files found"
Write-Host $AllYAMLs.Count
Write-Host "Combining files"
$outputpathname = $outputpath + $name
foreach ($i in $AllYAMLs){
$filename = Split-Path $i -Leaf
$content = Get-Content $i
$content = $content.Replace("!ArenaConfig", "`# $filename")
$content = $content.Replace("arenas:", "")
$content = $content.Replace("0: !Arena", "$index`: !Arena")
$content = $content.Replace("-1: !Arena", "$index`: !Arena")
Add-Content -Path 'C:\Users\kvoud\OneDrive - University of Cambridge\Documents\PhD Year 2\Animal-AI OP Battery Building\O-PIAAGETS\OP_configs\V3_Configs\Combined2022-03-15b.yml' -Value $content
}
}
9 changes: 9 additions & 0 deletions config_combinor/Combinor_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Combination Scripts

To make training and testing run faster, it is necessary to combine multiple configs into a single file, so that we only need load the AAI environment once.

In this folder, there is a PowerShell function for combining YML files flexibly and quickly. The function combines YML files with `-1` as the index for the `arenas` Item. This means that configs are presented in a random order once the environment is loaded. You may set a seed in the Python call to fix the order of presentation, for reproducibility.

If you wish to do curriculum learning, at the moment, we advise creating separate configs for each stage of the curriculum, and recalling the environment with each config as the curriculum progresses.

A function that generates configs in order is in development.
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 30} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 30} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 38, y: 0, z: 35} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 2, y: 0, z: 35} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 38, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 2, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 38, y: 0, z: 30} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 2, y: 0, z: 30} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 38, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 2, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 30} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 30} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 30} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 30} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ arenas:
- !Vector3 {x: 28.1, y: 27, z: 28}
sizes:
- !Vector3 {x: 2, y: 2, z: 2}
- !Vector3 {x: 1, y: 1, z: 1}
- !Vector3 {x: 1, y: 1, z: 1}
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ arenas:
- !Vector3 {x: 11.9, y: 27, z: 28}
sizes:
- !Vector3 {x: 2, y: 2, z: 2}
- !Vector3 {x: 1, y: 1, z: 1}
- !Vector3 {x: 1, y: 1, z: 1}
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ arenas:
- !Vector3 {x: 28.1, y: 27, z: 28}
sizes:
- !Vector3 {x: 2, y: 2, z: 2}
- !Vector3 {x: 1, y: 1, z: 1}
- !Vector3 {x: 1, y: 1, z: 1}
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ arenas:
- !Vector3 {x: 11.9, y: 27, z: 28}
sizes:
- !Vector3 {x: 2, y: 2, z: 2}
- !Vector3 {x: 1, y: 1, z: 1}
- !Vector3 {x: 1, y: 1, z: 1}
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ arenas:
- !Vector3 {x: 28.1, y: 27, z: 28}
sizes:
- !Vector3 {x: 1, y: 1, z: 1}
- !Vector3 {x: 2, y: 2, z: 2}
- !Vector3 {x: 2, y: 2, z: 2}
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ arenas:
- !Vector3 {x: 11.9, y: 27, z: 28}
sizes:
- !Vector3 {x: 1, y: 1, z: 1}
- !Vector3 {x: 2, y: 2, z: 2}
- !Vector3 {x: 2, y: 2, z: 2}
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ arenas:
- !Vector3 {x: 28.1, y: 27, z: 28}
sizes:
- !Vector3 {x: 1, y: 1, z: 1}
- !Vector3 {x: 2, y: 2, z: 2}
- !Vector3 {x: 2, y: 2, z: 2}
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ arenas:
- !Vector3 {x: 11.9, y: 27, z: 28}
sizes:
- !Vector3 {x: 1, y: 1, z: 1}
- !Vector3 {x: 2, y: 2, z: 2}
- !Vector3 {x: 2, y: 2, z: 2}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ arenas:
- !Vector3 {x: 38.5, y: 0, z: 28} #GoodGoalMulti
rotations: [270] #GoodGoalMulti
sizes: #GoodGoalMulti
- !Vector3 {x: 1, y: 1, z: 1} #GoodGoalMulti
- !Vector3 {x: 1, y: 1, z: 1} #GoodGoalMulti
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ arenas:
- !Vector3 {x: 1.5, y: 0, z: 28} #GoodGoalMulti
rotations: [90] #GoodGoalMulti
sizes: #GoodGoalMulti
- !Vector3 {x: 1, y: 1, z: 1} #GoodGoalMulti
- !Vector3 {x: 1, y: 1, z: 1} #GoodGoalMulti
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ arenas:
- !Vector3 {x: 1.5, y: 0, z: 25} #GoodGoal
rotations: [90] #GoodGoal
sizes: #GoodGoal
- !Vector3 {x: 1, y: 1, z: 1} #GoodGoal Size
- !Vector3 {x: 1, y: 1, z: 1} #GoodGoal Size
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ arenas:
- !Vector3 {x: 38.5, y: 0, z: 25} #GoodGoal
rotations: [270] #GoodGoal
sizes: #GoodGoal
- !Vector3 {x: 1, y: 1, z: 1} #GoodGoal Size
- !Vector3 {x: 1, y: 1, z: 1} #GoodGoal Size
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ arenas:
- !Vector3 {x: 1.5, y: 0, z: 35} #GoodGoal
rotations: [90] #GoodGoal
sizes: #GoodGoal
- !Vector3 {x: 1, y: 1, z: 1} #GoodGoal Size
- !Vector3 {x: 1, y: 1, z: 1} #GoodGoal Size
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ arenas:
- !Vector3 {x: 38.5, y: 0, z: 35} #GoodGoal
rotations: [270] #GoodGoal
sizes: #GoodGoal
- !Vector3 {x: 1, y: 1, z: 1} #GoodGoal Size
- !Vector3 {x: 1, y: 1, z: 1} #GoodGoal Size
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 35} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 35} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 35} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 35} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 35} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 35} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 35} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 35} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 39, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ arenas:
positions: #decoy
- !Vector3 {x: 1, y: 0, z: 25} #decoy
sizes: #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
- !Vector3 {x: 1, y: 1, z: 1} #decoy
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ arenas:
# - !Vector3 {x: 38.5, y: 27, z: 28} # Goal 3
# sizes: # Goal 3
# - !Vector3 {x: 1, y: 1, z: 1} # Goal 3
# rotations: [270] # Goal 3
# rotations: [270] # Goal 3
Loading

0 comments on commit 82dc2ec

Please sign in to comment.