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
func = switcher[params["scenario"]]
// Execute the function
return func(data, params, dt, num_steps)
def _merge(data, params, dt, num_steps):
Generate position and speed data for the merge.
After Change
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"]]
// Execute the function
pos, speed = func(data, params, all_time)
return pos, speed, all_time
def _merge(data, params, all_time):
Generate position and speed data for the merge.