-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_flocking.sh
More file actions
executable file
·81 lines (75 loc) · 1.58 KB
/
run_flocking.sh
File metadata and controls
executable file
·81 lines (75 loc) · 1.58 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
source venv/bin/activate
# Default values
LAYOUT_PATH="layouts/processed_space.pkl"
STEPS=10000
ARRIVAL_RATE=0.1
TEMPERATURE=0.8
COHESION=0.5
SEPARATION=0.5
ALIGNMENT=0.5
PERCEPTION=20
MAX_FORCE=1.0
GENERATE_HEATMAP=false
# Process command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--layout)
LAYOUT_PATH="$2"
shift 2
;;
--steps)
STEPS="$2"
shift 2
;;
--arrival)
ARRIVAL_RATE="$2"
shift 2
;;
--temp)
TEMPERATURE="$2"
shift 2
;;
--cohesion)
COHESION="$2"
shift 2
;;
--separation)
SEPARATION="$2"
shift 2
;;
--alignment)
ALIGNMENT="$2"
shift 2
;;
--perception)
PERCEPTION="$2"
shift 2
;;
--max_force)
MAX_FORCE="$2"
shift 2
;;
--heatmap)
GENERATE_HEATMAP=true
shift
;;
*)
echo "Unknown parameter: $1"
exit 1
;;
esac
done
# Build the command
CMD="python src/flocking_simulation.py --layout \"$LAYOUT_PATH\" --steps $STEPS --arrival_rate $ARRIVAL_RATE --cohesion $COHESION --separation $SEPARATION --alignment $ALIGNMENT --perception $PERCEPTION --max_force $MAX_FORCE"
# Add heatmap flag and temperature if needed
if [ "$GENERATE_HEATMAP" = true ]; then
CMD="$CMD --heatmap --temperature $TEMPERATURE"
else
# Temperature is only used for heatmap generation
echo "Note: Temperature parameter ($TEMPERATURE) will only be used with --heatmap option"
fi
# Print and execute the command
echo "Running: $CMD"
eval $CMD
echo "Process complete!"