-
Notifications
You must be signed in to change notification settings - Fork 0
/
launch_experiment.sh
46 lines (40 loc) · 1.19 KB
/
launch_experiment.sh
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
39
40
41
42
43
44
45
46
#!/bin/bash
# Define the file name patterns
file_names=(
"30_constraints_1000_polygons_10_facilities"
"30_constraints_1000_polygons_30_facilities"
"30_constraints_1000_polygons_60_facilities"
"60_constraints_1000_polygons_10_facilities"
"60_constraints_1000_polygons_30_facilities"
"60_constraints_1000_polygons_60_facilities"
"90_constraints_1000_polygons_10_facilities"
"90_constraints_1000_polygons_30_facilities"
"90_constraints_1000_polygons_60_facilities"
)
# Define the task ranges
task_ranges=(
"1,250"
"250,500"
"501,750"
"751,1000"
)
# task_ranges=(
# "1,2"
# "3,4"
# "5,6"
# )
# Loop through file names
for file_name in "${file_names[@]}"; do
# Loop through task ranges
for range in "${task_ranges[@]}"; do
# Split range into start and stop
IFS=',' read -r start stop <<< "$range"
# Construct and execute the Python command in the background
python_command="python evolutionary_solve.py --task_start=$start --task_stop=$stop --task_set='$file_name'"
# print the command
echo $python_command
eval $python_command &
done
done
# Wait for all background processes to finish
wait