dt = params["sim"].sim_step
// number of simulation steps
max_time = max(max(data[veh_id]["time"]) for veh_id in data.keys())
min_time = min(min(data[veh_id]["time"]) for veh_id in data.keys())
num_steps = int((max_time - min_time)/dt)
// Get the function from switcher dictionary
After Change
}
// Collect a list of all the unique times.
all_time = []
for veh_id in data.keys():
all_time.extend(data[veh_id]["time"])
all_time = np.sort(np.unique(all_time))
// Get the function from switcher dictionary
func = switcher[params["scenario"]]