Skip to content

Commit

Permalink
NEMA split fix
Browse files Browse the repository at this point in the history
Signed-off-by: Max <[email protected]>
  • Loading branch information
mschrader15 committed May 5, 2024
1 parent 9b6fb50 commit 58cc79a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions sumo_pipelines/blocks/simulation_complex/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ def update(self, e3_subs, veh_subs, sim_time):
self.veh_speed_factor += max(
veh_subs[_id][tc.VAR_SPEED] * (self.truck_speed_factor * truck + 1), 0
)

wt = sim_time - self.accumulated_wtime_holder[(_id, truck)]
if wt > 150:
wt = 1e6

self.accumulated_wtime += max(
(
(sim_time - self.accumulated_wtime_holder[(_id, truck)])
* (veh_subs[_id][tc.VAR_SPEED] < 3)
)
* (self.truck_waiting_time_factor * truck + 1),
(wt) * (self.truck_waiting_time_factor * truck + 1),
0,
)

Expand Down Expand Up @@ -285,8 +286,8 @@ def upstream_factor(tl, phase, signal_subs):

combo_scores[-1][combo] = sum(
weights[0] * phase_holders[phase].veh_speed_factor
+ weights[1] * phase_holders[phase].accumulated_wtime
+ weights[2]
+ weights[2] * phase_holders[phase].accumulated_wtime * 60
+ weights[1] * 60
- weights[3] * (str(phase) not in signal_subs[tl][tc.VAR_NAME])
for phase in combo
)
Expand Down

0 comments on commit 58cc79a

Please sign in to comment.