def condition_bus_arrived_at_target_bus_stop(target_bus_stop, vehicle_status): targets_vehicle_statuses = list( filter(lambda x: Target.is_same_id(x, target_bus_stop), vehicle_status.schedule.targets)) if 0 < len(targets_vehicle_statuses): if vehicle_status.schedule.event == SIM_BUS.TRIGGER.STOP: return True return False
def condition_bus_approached_target_bus_stop(vehicle_status, target_bus_stop): return 0 < len( list( filter(lambda x: Target.is_same_id(target_bus_stop, x), vehicle_status.schedule.targets)))