-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_exp.sh
More file actions
38 lines (35 loc) · 2.35 KB
/
test_exp.sh
File metadata and controls
38 lines (35 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
file_name=$(awk '/EXP_NAME/{print $2}' test_config.yml)
num_obstacles=$(awk '/NUM_OBSTACLES/{print $2}' test_config.yml)
num_robots=$(awk '/NUM_ROBOTS/{print $2}' test_config.yml)
max_num_robot_failures=$(awk '/MAX_NUM_ROBOT_FAILURES/{print $2}' test_config.yml)
chance_failure=$(awk '/CHANCE_FAILURE/{print $2}' test_config.yml)
num_episodes=$(awk '/NUM_EPISODES/{print $2}' test_config.yml)
port=$(awk '/PORT/{print $2}' test_config.yml)
gate=$(awk '/USE_GATE/{print $2}' test_config.yml)
gate_curriculum=$(awk '/GATE_CURRICULUM/{print $2}' test_config.yml)
seed=$(awk '/SEED/{print $2}' test_config.yml)
argos_filename=$(awk '/ARGOS_FILE_NAME/{print $2}' test_config.yml)
gate_minimum=$(awk '/GATE_MIN/{print $2}' test_config.yml)
model_num=$(awk '/MODEL_NUM/{print $2}' test_config.yml)
use_prisms=$(awk '/USE_PRISMS/{print $2}' test_config.yml)
random_objs=$(awk '/RANDOM_OBJECTS/{print $2}' test_config.yml)
test_prism=$(awk '/TEST_PRISM/{print $2}' test_config.yml)
# gate_curriculum_step=$(awk '/GATE_CURRICULUM_STEP/{print $2}' test_config.yml)
# gate_curriculum_update_freq=$(awk '/GATE_CURRICULUM_UPDATE_FREQ/{print $2}' test_config.yml)
cd argos
python generate_argos.py --num_obstacles $num_obstacles --num_robots $num_robots --max_num_robot_failures $max_num_robot_failures --chance_failure $chance_failure --num_episodes $num_episodes --pytorch_port $port --use_gate $gate --gate_curriculum $gate_curriculum --seed $seed --argos_filename $argos_filename --gate_minimum $gate_minimum --use_prisms $use_prisms --random_objs $random_objs --test_prism $test_prism
cd ..
test_file_path=testing_model_${model_num}_num_robots_${num_robots}_num_obstacles_${num_obstacles}_gate_$gate
mkdir rl_code/Data/$file_name/$test_file_path
mkdir rl_code/Data/$file_name/$test_file_path/Data
mkdir rl_code/Data/$file_name/$test_file_path/plots
echo rl_code/Data/$file_name/$test_file_path
cp test_config.yml rl_code/Data/$file_name/$test_file_path/agent_config.yml
cp argos/$argos_filename rl_code/Data/$file_name/$test_file_path/$argos_filename
argos3 -c argos/$argos_filename &
cd rl_code
python Main.py Data/$file_name/$test_file_path --test --model_path Data/$file_name/Models/Episode_$model_num
wait $!
cd src/plotting
python viz.py ../../Data/$file_name/$test_file_path/ >> ../../Data/$file_name/$test_file_path/testing_data.txt
python make_cylinder_trajectory.py ../../Data/$file_name/$test_file_path/