bk.Queue.clear() # East Elane_in = bk.Lane(lane_length) Elane_out = bk.Lane(lane_length) EDisplay = bk.RoadDisplay(left_lane=Elane_out, right_lane=Elane_in, axes=ax[1,2], horizontal=True) Erate = {end_time:bk.Rate(0.3)} Esource = bk.Source(vehicle_velocity = 16.67, target_node = Elane_in.IN, rate_schedule=Erate) print('Scheduling Eastern arrivals...') Esource.setup_arrivals(end_time) print('..done!') Erecord = bk.Record(Elane_out.OUT) # West Wlane_in = bk.Lane(lane_length) Wlane_out = bk.Lane(lane_length) WDisplay = bk.RoadDisplay(left_lane=Wlane_in, right_lane=Wlane_out, axes=ax[1,0], horizontal=True) Wrate = {end_time:bk.Rate(0.5)} Wsource = bk.Source(vehicle_velocity = 16.67, # 60 km/h target_node = Wlane_in.IN, rate_schedule=Wrate) print('Scheduling Western arrivals...') Wsource.setup_arrivals(end_time) print('..done!') Wrecord = bk.Record(Wlane_out.OUT)
bk.Queue.clear() # North: Nlane_in = bk.Lane(lane_length) Nlane_out = bk.Lane(lane_length) NDisplay = bk.RoadDisplay(left_lane=Nlane_out, right_lane=Nlane_in, axes=ax[0, 0], horizontal=False) Nrate = {end_time: bk.Rate(2)} Nsource = bk.Source(vehicle_velocity=16.67, target_node=Nlane_in.IN, rate_schedule=Nrate) print('Scheduling Northern arrivals...') Nsource.setup_arrivals(end_time) print('..done!') Nrecord = bk.Record(Nlane_out.OUT) # South Slane_in = bk.Lane(lane_length) Slane_out = bk.Lane(lane_length) SDisplay = bk.RoadDisplay(left_lane=Slane_in, right_lane=Slane_out, axes=ax[2, 0], horizontal=False) Srate = {end_time: bk.Rate(2)} Ssource = bk.Source(vehicle_velocity=16.67, target_node=Slane_in.IN, rate_schedule=Srate) print('Scheduling Southern arrivals...') Ssource.setup_arrivals(end_time) print('..done!') Srecord = bk.Record(Slane_out.OUT)
bk.Queue.clear() # North: Nlane_in = bk.Lane(lane_length) Nlane_out = bk.Lane(lane_length) NDisplay = bk.RoadDisplay(left_lane=Nlane_out, right_lane=Nlane_in, axes=ax[0,1], horizontal=False) Nrate = {end_time:bk.Rate(1.5)} Nsource = bk.Source(vehicle_velocity = 16.67, target_node = Nlane_in.IN, rate_schedule=Nrate) print('Scheduling Northern arrivals...') Nsource.setup_arrivals(end_time) print('..done!') Nrecord = bk.Record(Nlane_out.OUT) # East Elane_in = bk.Lane(lane_length) Elane_out = bk.Lane(lane_length) EDisplay = bk.RoadDisplay(left_lane=Elane_out, right_lane=Elane_in, axes=ax[1,2], horizontal=True) Erate = {end_time:bk.Rate(0.3)} Esource = bk.Source(vehicle_velocity = 16.67, target_node = Elane_in.IN, rate_schedule=Erate) print('Scheduling Eastern arrivals...') Esource.setup_arrivals(end_time) print('..done!') Erecord = bk.Record(Elane_out.OUT)