Пример #1
0
bool
MSE3Collector::MSE3EntryReminder::notifyEnter(SUMOVehicle& veh, Notification reason, const MSLane* enteredLane) {
    if (reason != NOTIFICATION_JUNCTION) {
        const double posOnLane = veh.getBackPositionOnLane(enteredLane) + veh.getVehicleType().getLength();
        if (posOnLane > myPosition) {
            // if the vehicle changes into a covered section we assume it was already registred on another lane
            return false;
        }
    }
    return true;
}
Пример #2
0
bool
MSE3Collector::MSE3LeaveReminder::notifyEnter(SUMOVehicle& veh, Notification reason, const MSLane* enteredLane) {
    if (reason != NOTIFICATION_JUNCTION) {
        const double backPosOnLane = veh.getBackPositionOnLane(enteredLane);
        if (backPosOnLane > myPosition) {
            // if the vehicle changes into a covered section we assume it was already registred on another lane
            // however, if it is not fully past the detector we still need to track it
            return false;
        }
    }
    return true;
}