Skip to content

Commit

Permalink
Fix monitor option in python adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellmatthis committed Apr 14, 2024
1 parent 6f59f46 commit 1775569
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions benchmarks/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def to_flags_and_vals(self):
val = getattr(self, field.name)
if val == None:
continue
if type(val) is list:
val = ",".join(map(lambda v : str(v), val))
flags_and_vals.extend([f"--{field.name.replace('_', '-')}", str(val)])
return flags_and_vals

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/max_speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
deaccelerations = []

for max_speed in max_speeds:
metrics = run_average(SimulationOptions(max_speed=max_speed, traffic_density=0.4, dilly_dally_probability=0.0), SIMULATIONS_EACH)
metrics = run_average(SimulationOptions(max_speed=max_speed, traffic_density=0.4, dilly_dally_probability=0.0, monitor=[0, 10, 20]), SIMULATIONS_EACH)
average_speeds.append(metrics.average_speed_kilometers_per_hour)
first_cell_flows.append(metrics.monitor_cells_flow_cars_per_minute[0])
accelerations.append(metrics.average_accelerations_n_per_car_per_round)
Expand Down

0 comments on commit 1775569

Please sign in to comment.