40 #ifdef CHECK_MEMORY_LEAKS
42 #endif // CHECK_MEMORY_LEAKS
54 #ifndef HAVE_INTERNAL_LANES
60 myRequestIdx(0), myRespondIdx(0),
61 myState(state), myDirection(dir), myLength(length) {}
67 myRequestIdx(0), myRespondIdx(0),
68 myState(state), myDirection(dir), myLength(length),
69 myJunctionInlane(via) {}
78 const std::vector<MSLink*>& foeLinks,
79 const std::vector<MSLane*>& foeLanes) {
108 if ((*i)->isBlockingAnyone()) {
138 return arrivalTime +
TIME2STEPS((
getLength() + vehicleLength) / (0.5 * (arrivalSpeed + leaveSpeed)));
159 if ((*i)->blockedAtTime(arrivalTime, leaveTime, arrivalSpeed, leaveSpeed,
myLane == (*i)->getLane())) {
169 bool sameTargetLane)
const {
171 if (!(*i).willPass) {
174 if ((*i).leavingTime < arrivalTime) {
176 if (sameTargetLane &&
unsafeHeadwayTime(arrivalTime - (*i).leavingTime, (*i).leaveSpeed, arrivalSpeed)) {
179 }
else if ((*i).arrivalTime > leaveTime) {
181 if (sameTargetLane &&
unsafeHeadwayTime((*i).arrivalTime - leaveTime, leaveSpeed, (*i).arrivalSpeed)) {
224 assert(distLeft > 0);
235 if ((*i)->blockedAtTime(arrivalTime, leaveTime, speed, speed,
myLane == (*i)->getLane())) {
240 if ((*i)->getVehicleNumber() > 0 || (*i)->getPartialOccupator() != 0) {
266 #ifdef HAVE_INTERNAL_LANES
268 MSLink::getViaLane()
const {
269 return myJunctionInlane;
273 std::pair<MSVehicle*, SUMOReal>
274 MSLink::getLeaderInfo(
const std::map<const MSLink*, std::string>& previousLeaders,
SUMOReal dist)
const {
280 std::map<const MSLink*, std::string>::const_iterator it = previousLeaders.find(
this);
281 if (it != previousLeaders.end()) {
284 return std::make_pair(leader,
290 assert((*i)->getLinkCont().size() == 1);
291 MSLink* exitLink = (*i)->getLinkCont()[0];
292 if (
myLane == exitLink->getLane()) {
293 MSVehicle* leader = (*i)->getLastVehicle();
295 return std::make_pair(leader,
301 return std::make_pair<MSVehicle*, SUMOReal>(0, 0);
308 #ifdef HAVE_INTERNAL_LANES
309 if (myJunctionInlane != 0) {
310 return myJunctionInlane;