Skip to main content
. 2023 Jan 9;25(1):135. doi: 10.3390/e25010135
Algorithm 3 Pseudo code for Vehicle controller Algorithm (Code Listing 3: Hand Crafted vehicle controller)
1 vehicle-controller-policy (st){
2 vbrake ← 20
3 vmax ← 18
4 ɸthreshold ← 0.05
5 acc ← Do nothing
6 steer ← Do nothing
if (vt > brake){
8     acc ← Brake
else if (vt < Vmax){
10    acc ← Accelerate
11 else if (ɸt > ɸthreshold){
12    steer ← TurnLeft}
13 else if (ɸt < −ɸthreshold){
14    steer ← TurnRight
15    return (acc, steer)
16   }
17   }
18 }