79 #define DEBUG_COND (false) 81 #define DEBUG_COND2(obj) ((obj != 0 && (obj)->isSelected())) 195 for (MSLinkCont::iterator i =
myLinks.begin(); i !=
myLinks.end(); ++i) {
226 (*veh)->addReminder(rem);
236 std::cout <<
SIMTIME <<
" setPartialOccupation. lane=" <<
getID() <<
" veh=" << v->
getID() <<
"\n";
249 std::cout <<
SIMTIME <<
" resetPartialOccupation. lane=" <<
getID() <<
" veh=" << v->
getID() <<
"\n";
268 std::cout <<
SIMTIME <<
" setManeuverReservation. lane=" <<
getID() <<
" veh=" << v->
getID() <<
"\n";
279 std::cout <<
SIMTIME <<
" resetManeuverReservation(): lane=" <<
getID() <<
" veh=" << v->
getID() <<
"\n";
324 leader = leaderInfo.first;
336 if (leaderBack >= frontGapNeeded) {
337 pos =
MIN2(pos, leaderBack - frontGapNeeded);
351 bool adaptableSpeed =
true;
360 if (missingRearGap > 0) {
361 if (minPos + missingRearGap <=
myLength) {
368 return isInsertionSuccess(&veh, mspeed, minPos + missingRearGap, posLat, adaptableSpeed, notification);
373 return isInsertionSuccess(&veh, mspeed, minPos, posLat, adaptableSpeed, notification);
380 const double speed = adaptableSpeed ? leader->
getSpeed() : mspeed;
382 if (leaderPos >= frontGapNeeded) {
392 MSLane::VehCont::iterator predIt =
myVehicles.begin();
403 double speed = mspeed;
404 if (adaptableSpeed && leader != 0) {
413 frontMax = leaderRearPos - frontGapNeeded;
421 if (frontMax > minPos && backMin +
POSITION_EPS < frontMax) {
490 bool patchSpeed =
true;
507 for (
int i = 0; i < 10; i++) {
533 for (
int i = 0; i < 10; i++) {
564 MSLane::checkFailure(
const MSVehicle* aVehicle,
double& speed,
double& dist,
const double nspeed,
const bool patchSpeed,
const std::string errorMsg)
const {
565 if (nspeed < speed) {
567 speed =
MIN2(nspeed, speed);
569 }
else if (speed > 0) {
573 if (emergencyBrakeGap <= dist) {
576 WRITE_WARNING(
"Vehicle '" + aVehicle->
getID() +
"' is inserted in emergency situation.");
581 if (errorMsg !=
"") {
582 WRITE_ERROR(
"Vehicle '" + aVehicle->
getID() +
"' will not be able to depart using the given velocity (" + errorMsg +
")!");
594 double speed,
double pos,
double posLat,
bool patchSpeed,
599 aVehicle->
getID() +
"'. Inserting at lane end instead.");
603 #ifdef DEBUG_INSERTION 605 std::cout <<
"\nIS_INSERTION_SUCCESS\n" 607 <<
" veh '" << aVehicle->
getID() <<
"'\n";
615 std::vector<MSLane*>::const_iterator ri = bestLaneConts.begin();
623 if (nextStop.
lane ==
this) {
624 std::stringstream msg;
625 msg <<
"scheduled stop on lane '" <<
myID <<
"' too close";
626 const double distToStop = nextStop.
pars.
endPos - pos;
628 patchSpeed, msg.str())) {
638 MSLane* currentLane =
this;
641 while (seen < dist && ri != bestLaneConts.end()) {
643 MSLinkCont::const_iterator link =
succLinkSec(*aVehicle, nRouteSuccs, *currentLane, bestLaneConts);
649 patchSpeed,
"arrival speed too low")) {
657 patchSpeed,
"junction too close")) {
666 || !(*link)->havePriority()) {
668 std::string errorMsg =
"";
669 const LinkState state = (*link)->getState();
675 errorMsg =
"unpriorised junction too close";
678 patchSpeed, errorMsg)) {
682 #ifdef DEBUG_INSERTION 684 std::cout <<
"trying insertion before minor link: " 685 <<
"insertion speed = " << speed <<
" dist=" << dist
692 nextLane = (*link)->getViaLaneOrLane();
700 if (nextStop.
lane == nextLane) {
701 std::stringstream msg;
702 msg <<
"scheduled stop on lane '" << nextStop.
lane->
getID() <<
"' too close";
703 const double distToStop = seen + nextStop.
pars.
endPos;
705 patchSpeed, msg.str())) {
716 #ifdef DEBUG_INSERTION 718 <<
" leader on lane '" << nextLane->
getID() <<
"': " << leaders.
toString() <<
" nspeed=" << nspeed <<
"\n";
722 #ifdef DEBUG_INSERTION 724 <<
" isInsertionSuccess lane=" <<
getID()
725 <<
" veh=" << aVehicle->
getID()
727 <<
" posLat=" << posLat
728 <<
" patchSpeed=" << patchSpeed
729 <<
" speed=" << speed
730 <<
" nspeed=" << nspeed
731 <<
" nextLane=" << nextLane->
getID()
734 <<
" failed (@641)!\n";
744 if (nspeed < speed) {
750 WRITE_ERROR(
"Vehicle '" + aVehicle->
getID() +
"' will not be able to depart using the given velocity (slow lane ahead)!");
759 if ((*link)->hasApproachingFoe(arrivalTime, leaveTime, speed, cfModel.
getMaxDecel())) {
767 currentLane = nextLane;
768 if ((*link)->getViaLane() == 0) {
782 #ifdef DEBUG_INSERTION 784 <<
" isInsertionSuccess lane=" <<
getID()
785 <<
" veh=" << aVehicle->
getID()
787 <<
" posLat=" << posLat
788 <<
" patchSpeed=" << patchSpeed
789 <<
" speed=" << speed
790 <<
" nspeed=" << nspeed
791 <<
" nextLane=" << nextLane->
getID()
792 <<
" leaders=" << leaders.
toString()
793 <<
" failed (@700)!\n";
797 #ifdef DEBUG_INSERTION 799 <<
" speed = " << speed
800 <<
" nspeed = " << nspeed
805 for (
int i = 0; i < followers.
numSublanes(); ++i) {
806 const MSVehicle* follower = followers[i].first;
809 if (followers[i].second < backGapNeeded) {
811 #ifdef DEBUG_INSERTION 813 <<
" isInsertionSuccess lane=" <<
getID()
814 <<
" veh=" << aVehicle->
getID()
816 <<
" posLat=" << posLat
817 <<
" patchSpeed=" << patchSpeed
818 <<
" speed=" << speed
819 <<
" nspeed=" << nspeed
820 <<
" follower=" << follower->
getID()
821 <<
" backGapNeeded=" << backGapNeeded
822 <<
" gap=" << followers[i].second
823 <<
" failure (@719)!\n";
835 #ifdef DEBUG_INSERTION 840 if (shadowLane != 0) {
842 for (
int i = 0; i < followers.
numSublanes(); ++i) {
843 const MSVehicle* follower = followers[i].first;
846 if (followers[i].second < backGapNeeded) {
848 #ifdef DEBUG_INSERTION 850 <<
" isInsertionSuccess shadowlane=" << shadowLane->
getID()
851 <<
" veh=" << aVehicle->
getID()
853 <<
" posLat=" << posLat
854 <<
" patchSpeed=" << patchSpeed
855 <<
" speed=" << speed
856 <<
" nspeed=" << nspeed
857 <<
" follower=" << follower->
getID()
858 <<
" backGapNeeded=" << backGapNeeded
859 <<
" gap=" << followers[i].second
860 <<
" failure (@812)!\n";
872 if (gap < gapNeeded) {
874 #ifdef DEBUG_INSERTION 876 <<
" isInsertionSuccess shadowlane=" << shadowLane->
getID()
877 <<
" veh=" << aVehicle->
getID()
879 <<
" posLat=" << posLat
880 <<
" patchSpeed=" << patchSpeed
881 <<
" speed=" << speed
882 <<
" nspeed=" << nspeed
883 <<
" leader=" << veh->
getID()
884 <<
" gapNeeded=" << gapNeeded
886 <<
" failure (@842)!\n";
897 if (missingRearGap > 0) {
899 #ifdef DEBUG_INSERTION 901 <<
" isInsertionSuccess lane=" <<
getID()
902 <<
" veh=" << aVehicle->
getID()
904 <<
" posLat=" << posLat
905 <<
" patchSpeed=" << patchSpeed
906 <<
" speed=" << speed
907 <<
" nspeed=" << nspeed
908 <<
" missingRearGap=" << missingRearGap
909 <<
" failure (@728)!\n";
916 #ifdef DEBUG_INSERTION 918 <<
" isInsertionSuccess lane=" <<
getID()
919 <<
" veh=" << aVehicle->
getID()
921 <<
" posLat=" << posLat
922 <<
" patchSpeed=" << patchSpeed
923 <<
" speed=" << speed
924 <<
" nspeed=" << nspeed
925 <<
" failed (@733)!\n";
931 #ifdef DEBUG_INSERTION 933 <<
" isInsertionSuccess lane=" <<
getID()
934 <<
" veh=" << aVehicle->
getID()
936 <<
" posLat=" << posLat
937 <<
" patchSpeed=" << patchSpeed
938 <<
" speed=" << speed
939 <<
" nspeed=" << nspeed
943 <<
"\n leaders=" << leaders.
toString()
961 double nspeed = speed;
962 #ifdef DEBUG_INSERTION 964 std::cout <<
SIMTIME <<
" safeInsertionSpeed veh=" << veh->
getID() <<
" speed=" << speed <<
"\n";
974 nspeed =
MIN2(nspeed,
976 #ifdef DEBUG_INSERTION 978 std::cout <<
" leader=" << leader->
getID() <<
" nspeed=" << nspeed <<
"\n";
993 int freeSublanes = 1;
998 while (freeSublanes > 0 && veh != 0) {
999 #ifdef DEBUG_PLAN_MOVE 1002 std::cout <<
" getLastVehicleInformation lane=" <<
getID() <<
" minPos=" << minPos <<
" veh=" << veh->
getID() <<
" pos=" << veh->
getPositionOnLane(
this) <<
"\n";
1008 #ifdef DEBUG_PLAN_MOVE 1016 if (ego == 0 && minPos == 0) {
1021 #ifdef DEBUG_PLAN_MOVE 1047 int freeSublanes = 1;
1049 while (freeSublanes > 0 && veh != 0) {
1050 #ifdef DEBUG_PLAN_MOVE 1052 std::cout <<
" veh=" << veh->
getID() <<
" pos=" << veh->
getPositionOnLane(
this) <<
" maxPos=" << maxPos <<
"\n";
1059 #ifdef DEBUG_PLAN_MOVE 1061 std::cout <<
" veh=" << veh->
getID() <<
" latOffset=" << latOffset <<
"\n";
1068 if (ego == 0 && maxPos == std::numeric_limits<double>::max()) {
1073 #ifdef DEBUG_PLAN_MOVE 1096 double cumulatedVehLength = 0.;
1100 VehCont::reverse_iterator veh =
myVehicles.rbegin();
1103 #ifdef DEBUG_PLAN_MOVE 1107 <<
" planMovements() lane=" <<
getID()
1115 #ifdef DEBUG_PLAN_MOVE 1117 std::cout <<
" plan move for: " << (*veh)->getID();
1121 #ifdef DEBUG_PLAN_MOVE 1123 std::cout <<
" leaders=" << leaders.
toString() <<
"\n";
1126 (*veh)->planMove(t, leaders, cumulatedVehLength);
1127 cumulatedVehLength += (*veh)->getVehicleType().getLengthWithGap();
1137 bool nextToConsiderIsPartial;
1140 while (moreReservationsAhead || morePartialVehsAhead) {
1141 if ((!moreReservationsAhead || (*vehRes)->getPositionOnLane(
this) <= veh->
getPositionOnLane())
1142 && (!morePartialVehsAhead || (*vehPart)->getPositionOnLane(
this) <= veh->
getPositionOnLane())) {
1148 if (moreReservationsAhead && !morePartialVehsAhead) {
1149 nextToConsiderIsPartial =
false;
1150 }
else if (morePartialVehsAhead && !moreReservationsAhead) {
1151 nextToConsiderIsPartial =
true;
1153 assert(morePartialVehsAhead && moreReservationsAhead);
1155 nextToConsiderIsPartial = (*vehPart)->getPositionOnLane(
this) > (*vehRes)->getPositionOnLane(
this);
1158 if (nextToConsiderIsPartial) {
1159 const double latOffset = (*vehPart)->getLatOffset(
this);
1160 #ifdef DEBUG_PLAN_MOVE 1162 std::cout <<
" partial ahead: " << (*vehPart)->getID() <<
" latOffset=" << latOffset <<
"\n";
1165 ahead.
addLeader(*vehPart,
false, latOffset);
1169 const double latOffset = (*vehRes)->getLatOffset(
this);
1170 #ifdef DEBUG_PLAN_MOVE 1172 std::cout <<
" reservation ahead: " << (*vehRes)->getID() <<
" latOffset=" << latOffset <<
"\n";
1175 ahead.
addLeader(*vehRes,
false, latOffset);
1185 #ifdef DEBUG_COLLISIONS 1187 std::vector<const MSVehicle*> all;
1189 all.push_back(*last);
1191 std::cout <<
SIMTIME <<
" detectCollisions stage=" << stage <<
" lane=" <<
getID() <<
":\n" 1194 <<
" all=" <<
toString(all) <<
"\n" 1202 std::set<const MSVehicle*, ComparatorIdLess> toRemove;
1203 std::set<const MSVehicle*> toTeleport;
1206 VehCont::iterator lastVeh =
myVehicles.end() - 1;
1207 for (VehCont::iterator veh =
myVehicles.begin(); veh != lastVeh; ++veh) {
1208 VehCont::iterator pred = veh + 1;
1228 if (lead == follow) {
1247 if (lead != 0 && lead != follow && shadowLane->
detectCollisionBetween(timestep, stage, follow, lead, toRemove, toTeleport)) {
1256 #ifdef DEBUG_JUNCTION_COLLISIONS 1258 std::cout <<
SIMTIME <<
" detect junction Collisions stage=" << stage <<
" lane=" <<
getID() <<
":\n" 1266 const std::vector<const MSLane*>& foeLanes =
myLinks.front()->getFoeLanes();
1271 for (std::vector<const MSLane*>::const_iterator it = foeLanes.begin(); it != foeLanes.end(); ++it) {
1272 const MSLane* foeLane = *it;
1277 if (victim == collider) {
1282 #ifdef DEBUG_JUNCTION_COLLISIONS 1284 std::cout <<
SIMTIME <<
" foe=" << victim->
getID() <<
" bound=" << colliderBoundary <<
" foeBound=" << victim->
getBoundingBox() <<
"\n";
1296 if (
myLinks.front()->getWalkingAreaFoe() != 0) {
1303 #ifdef DEBUG_PEDESTRIAN_COLLISIONS 1305 std::cout <<
SIMTIME <<
" detect pedestrian collisions stage=" << stage <<
" lane=" <<
getID() <<
"\n";
1315 #ifdef DEBUG_PEDESTRIAN_COLLISIONS 1317 std::cout <<
SIMTIME <<
" back=" << back <<
" right=" << right <<
" person=" <<
Named::getIDSecure(leader.first) <<
" dist=" << leader.second <<
"\n";
1320 if (leader.first != 0 && leader.second < length) {
1322 "Vehicle '" + v->
getID()
1323 +
"' collision with person '" + leader.first->getID()
1324 +
"', lane='" +
getID()
1325 +
"', gap=" +
toString(leader.second - length)
1327 +
" stage=" + stage +
".");
1334 for (std::set<const MSVehicle*, ComparatorIdLess>::iterator it = toRemove.begin(); it != toRemove.end(); ++it) {
1338 if (toTeleport.count(veh) > 0) {
1350 SUMOTime timestep,
const std::string& stage) {
1352 #ifdef DEBUG_PEDESTRIAN_COLLISIONS 1354 std::cout <<
SIMTIME <<
" detect pedestrian junction collisions stage=" << stage <<
" lane=" <<
getID() <<
" foeLane=" << foeLane->
getID() <<
"\n";
1358 for (std::vector<MSTransportable*>::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) {
1359 #ifdef DEBUG_PEDESTRIAN_COLLISIONS 1361 std::cout <<
" collider=" << collider->
getID()
1362 <<
" ped=" << (*it_p)->getID()
1363 <<
" colliderBoundary=" << colliderBoundary
1364 <<
" pedBoundary=" << (*it_p)->getBoundingBox()
1368 if (colliderBoundary.
overlapsWith((*it_p)->getBoundingBox())) {
1370 "Vehicle '" + collider->
getID()
1371 +
"' collision with person '" + (*it_p)->getID()
1372 +
"', lane='" +
getID()
1374 +
" stage=" + stage +
".");
1383 std::set<const MSVehicle*, ComparatorIdLess>& toRemove,
1384 std::set<const MSVehicle*>& toTeleport)
const {
1391 if (collider == victim) {
1398 std::swap(victim, collider);
1406 #ifdef DEBUG_COLLISIONS 1409 <<
" thisLane=" <<
getID()
1410 <<
" collider=" << collider->
getID()
1411 <<
" victim=" << victim->
getID()
1414 <<
" colliderPos=" << colliderPos
1419 <<
" minGapFactor=" << minGapFactor
1436 && victim->
getLane() !=
this) {
1449 double gap,
double latGap, std::set<const MSVehicle*, ComparatorIdLess>& toRemove,
1450 std::set<const MSVehicle*>& toTeleport)
const {
1452 "frontal collision" :
"collision");
1455 std::swap(collider, victim);
1457 std::string prefix =
"Vehicle '" + collider->
getID() +
"'; " + collisionType +
" with vehicle '" + victim->
getID() ;
1462 std::string dummyError;
1476 double victimSpeed = victim->
getSpeed();
1477 double colliderSpeed = collider->
getSpeed();
1480 if (collisionAngle < 45) {
1482 colliderSpeed =
MIN2(colliderSpeed, victimSpeed);
1483 }
else if (collisionAngle < 135) {
1500 victim->
addStop(stop, dummyError, 0,
true);
1507 collider->
addStop(stop, dummyError, 0,
true);
1518 prefix =
"Teleporting vehicle '" + collider->
getID() +
"'; " + collisionType +
" with vehicle '" + victim->
getID() ;
1519 toRemove.insert(collider);
1520 toTeleport.insert(collider);
1523 prefix =
"Removing " + collisionType +
" participants: vehicle '" + collider->
getID() +
"', vehicle '" + victim->
getID();
1524 bool removeCollider =
true;
1525 bool removeVictim =
true;
1529 toRemove.insert(victim);
1531 if (removeCollider) {
1532 toRemove.insert(collider);
1534 if (!removeVictim) {
1535 if (!removeCollider) {
1536 prefix =
"Keeping remote-controlled " + collisionType +
" participants: vehicle '" + collider->
getID() +
"', vehicle '" + victim->
getID();
1538 prefix =
"Removing " + collisionType +
" participant: vehicle '" + collider->
getID() +
"', keeping remote-controlled vehicle '" + victim->
getID();
1540 }
else if (!removeCollider) {
1541 prefix =
"Keeping remote-controlled " + collisionType +
" participant: vehicle '" + collider->
getID() +
"', removing vehicle '" + victim->
getID();
1550 +
"', lane='" +
getID()
1552 + (latGap == 0 ?
"" :
"', latGap=" +
toString(latGap))
1554 +
" stage=" + stage +
".");
1555 #ifdef DEBUG_COLLISIONS 1557 toRemove.erase(collider);
1558 toTeleport.erase(collider);
1561 toRemove.erase(victim);
1562 toTeleport.erase(victim);
1583 #ifdef DEBUG_EXEC_MOVE 1585 std::cout <<
SIMTIME <<
" veh " << veh->
getID() <<
" has arrived." << std::endl;
1590 }
else if (target != 0 && moved) {
1598 lanesWithVehiclesToIntegrate.push_back(target);
1608 WRITE_WARNING(
"Teleporting vehicle '" + veh->
getID() +
"'; beyond end of lane, target lane='" +
getID() +
"', time=" +
1634 i = VehCont::reverse_iterator(
myVehicles.erase(i.base()));
1645 const bool minorLink = !wrongLane && (link !=
myLinks.end()) && !((*link)->havePriority());
1646 const std::string reason = (wrongLane ?
" (wrong lane)" : (minorLink ?
" (yield)" :
" (jam)"));
1653 + (r2 ?
" (highway)" :
"")
1657 }
else if (minorLink) {
1673 lanesWithVehiclesToIntegrate.push_back(
this);
1695 const MSLane* firstInternal =
this;
1698 firstInternal = pred;
1702 return firstInternal;
1709 DictType::iterator it =
myDict.find(
id);
1710 if (it ==
myDict.end()) {
1712 myDict.insert(DictType::value_type(
id, ptr));
1721 DictType::iterator it =
myDict.find(
id);
1722 if (it ==
myDict.end()) {
1732 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); ++i) {
1741 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); ++i) {
1742 into.push_back((*i).first);
1747 template<
class RTREE>
void 1749 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); ++i) {
1753 const float cmin[2] = {(float) b.
xmin(), (float) b.
ymin()};
1754 const float cmax[2] = {(float) b.
xmax(), (float) b.
ymax()};
1755 into.Insert(cmin, cmax, l);
1759 template void MSLane::fill<NamedRTree>(
NamedRTree& into);
1777 return (link !=
myLinks.end());
1787 assert(veh->
getLane() ==
this);
1800 #ifdef DEBUG_VEHICLE_CONTAINER 1804 return wasInactive &&
myVehicles.size() != 0;
1819 #ifdef DEBUG_CONTEXT 1821 std::cout <<
"sortManeuverReservations on lane " <<
getID()
1826 #ifdef DEBUG_CONTEXT 1902 MSLinkCont::const_iterator
1904 const MSLane& succLinkSource,
const std::vector<MSLane*>& conts) {
1907 if (nRouteEdge == 0) {
1909 return succLinkSource.
myLinks.end();
1913 assert(succLinkSource.
myLinks.size() == 1);
1916 return succLinkSource.
myLinks.begin();
1927 MSLinkCont::const_iterator link;
1928 if (nRouteSuccs < (
int)conts.size()) {
1930 for (link = succLinkSource.
myLinks.begin(); link != succLinkSource.
myLinks.end(); ++link) {
1931 if ((*link)->getLane() != 0 && (*link)->getLane()->myEdge == nRouteEdge && (*link)->getLane()->allowsVehicleClass(veh.
getVehicleType().
getVehicleClass())) {
1933 if ((*link)->getLane() == conts[nRouteSuccs]) {
1940 return succLinkSource.
myLinks.end();
1943 #ifdef DEBUG_NO_CONNECTION 1945 WRITE_WARNING(
"Could not find connection between lane " + succLinkSource.
getID() +
" and lane " + conts[nRouteSuccs]->getID() +
1948 return succLinkSource.
myLinks.end();
1960 MSLinkCont::const_iterator l =
myLinks.begin();
1963 if ((*l)->getViaLane()->getID() == target->
getID()) {
1970 if ((*l)->getLane()->getID() == target->
getID()) {
1984 const MSLane*
internal =
this;
2023 assert(remVehicle->
getLane() ==
this);
2025 if (remVehicle == *it) {
2060 }
else if (!approachingEdge->
isInternal() && warnMultiCon) {
2063 WRITE_WARNING(
"Lane '" +
getID() +
"' is approached multiple times from edge '" + approachingEdge->
getID() +
"'. This may cause collisions.");
2077 std::map<MSEdge*, std::vector<MSLane*> >::const_iterator i =
myApproachingLanes.find(edge);
2081 const std::vector<MSLane*>& lanes = (*i).second;
2082 return find(lanes.begin(), lanes.end(), lane) != lanes.end();
2088 inline int operator()(
const std::pair<const MSVehicle*, double>& p1,
const std::pair<const MSVehicle*, double>& p2)
const {
2089 return p1.second < p2.second;
2101 const MSVehicle* v = followerInfo.first;
2119 std::pair<MSVehicle* const, double>
2120 MSLane::getLeader(
const MSVehicle* veh,
const double vehPos,
const std::vector<MSLane*>& bestLaneConts,
double dist,
bool checkTmpVehicles)
const {
2123 #ifdef DEBUG_CONTEXT 2128 if (checkTmpVehicles) {
2135 #ifdef DEBUG_CONTEXT 2137 std::cout << std::setprecision(
gPrecision) <<
" getLeader lane=" <<
getID() <<
" ego=" << veh->
getID() <<
" egoPos=" << vehPos <<
" pred=" << pred->
getID() <<
" predPos=" << pred->
getPositionOnLane() <<
"\n";
2151 #ifdef DEBUG_CONTEXT 2153 std::cout <<
" getLeader lane=" <<
getID() <<
" ego=" << veh->
getID() <<
" egoPos=" << vehPos
2163 if (bestLaneConts.size() > 0) {
2169 #ifdef DEBUG_CONTEXT 2171 std::cout <<
" getLeader lane=" <<
getID() <<
" seen=" << seen <<
" dist=" << dist <<
"\n";
2175 return std::pair<MSVehicle* const, double>(
static_cast<MSVehicle*
>(0), -1);
2179 return std::make_pair(static_cast<MSVehicle*>(0), -1);
2184 std::pair<MSVehicle* const, double>
2186 const std::vector<MSLane*>& bestLaneConts)
const {
2187 #ifdef DEBUG_CONTEXT 2189 std::cout <<
" getLeaderOnConsecutive lane=" <<
getID() <<
" ego=" << veh.
getID() <<
" seen=" << seen <<
" dist=" << dist <<
" conts=" <<
toString(bestLaneConts) <<
"\n";
2193 return std::make_pair(static_cast<MSVehicle*>(0), -1);
2201 #ifdef DEBUG_CONTEXT 2208 return std::pair<MSVehicle* const, double>(pred, gap);
2211 const MSLane* nextLane =
this;
2214 nextLane->getVehiclesSecure();
2216 MSLinkCont::const_iterator link =
succLinkSec(veh, view, *nextLane, bestLaneConts);
2217 if (nextLane->isLinkEnd(link) || !(*link)->opened(arrivalTime, speed, speed, veh.
getVehicleType().
getLength(),
2219 #ifdef DEBUG_CONTEXT 2221 std::cout <<
" cannot continue after nextLane=" << nextLane->getID() <<
"\n";
2224 nextLane->releaseVehicles();
2228 #ifdef DEBUG_CONTEXT 2234 #ifdef DEBUG_CONTEXT 2237 nextLane->releaseVehicles();
2238 if (linkLeaders.size() > 0) {
2239 std::pair<MSVehicle*, double> result;
2240 double shortestGap = std::numeric_limits<double>::max();
2241 for (
auto ll : linkLeaders) {
2242 double gap = ll.vehAndGap.second;
2248 #ifdef DEBUG_CONTEXT 2251 <<
" isLeader=" << ((*link)->isLeader(&veh, lVeh))
2252 <<
" gap=" << ll.vehAndGap.second
2253 <<
" gap+brakeing=" << gap
2257 if (lVeh != 0 && !(*link)->isLeader(&veh, lVeh,
false)) {
2260 if (gap < shortestGap) {
2262 result = ll.vehAndGap;
2265 if (shortestGap != std::numeric_limits<double>::max()) {
2266 #ifdef DEBUG_CONTEXT 2268 std::cout <<
" found linkLeader after nextLane=" << nextLane->getID() <<
"\n";
2274 bool nextInternal = (*link)->getViaLane() != 0;
2275 nextLane = (*link)->getViaLaneOrLane();
2276 if (nextLane == 0) {
2279 nextLane->getVehiclesSecure();
2280 MSVehicle* leader = nextLane->getLastAnyVehicle();
2282 #ifdef DEBUG_CONTEXT 2284 std::cout <<
" found leader " << leader->
getID() <<
" on nextLane=" << nextLane->getID() <<
"\n";
2288 nextLane->releaseVehicles();
2289 return std::make_pair(leader, dist);
2291 nextLane->releaseVehicles();
2292 if (nextLane->getVehicleMaxSpeed(&veh) < speed) {
2295 seen += nextLane->getLength();
2300 if (!nextInternal) {
2303 }
while (seen <= dist || nextLane->
isInternal());
2304 return std::make_pair(static_cast<MSVehicle*>(0), -1);
2308 std::pair<MSVehicle* const, double>
2310 #ifdef DEBUG_CONTEXT 2312 std::cout <<
SIMTIME <<
" getCriticalLeader. lane=" <<
getID() <<
" veh=" << veh.
getID() <<
"\n";
2316 std::pair<MSVehicle*, double> result = std::make_pair(static_cast<MSVehicle*>(0), -1);
2317 double safeSpeed = std::numeric_limits<double>::max();
2322 const MSLane* nextLane =
this;
2326 MSLinkCont::const_iterator link =
succLinkSec(veh, view, *nextLane, bestLaneConts);
2333 for (MSLink::LinkLeaders::const_iterator it = linkLeaders.begin(); it != linkLeaders.end(); ++it) {
2334 const MSVehicle* leader = (*it).vehAndGap.first;
2335 if (leader != 0 && leader != result.first) {
2339 const double tmpSpeed = veh.
getSafeFollowSpeed((*it).vehAndGap, seen, nextLane, (*it).distToCrossing);
2340 #ifdef DEBUG_CONTEXT 2342 std::cout <<
" linkLeader=" << leader->
getID() <<
" gap=" << result.second <<
" tmpSpeed=" << tmpSpeed <<
" safeSpeed=" << safeSpeed <<
"\n";
2345 if (tmpSpeed < safeSpeed) {
2346 safeSpeed = tmpSpeed;
2347 result = (*it).vehAndGap;
2351 bool nextInternal = (*link)->getViaLane() != 0;
2352 nextLane = (*link)->getViaLaneOrLane();
2353 if (nextLane == 0) {
2357 if (leader != 0 && leader != result.first) {
2360 if (tmpSpeed < safeSpeed) {
2361 safeSpeed = tmpSpeed;
2362 result = std::make_pair(leader, gap);
2373 if (!nextInternal) {
2376 }
while (seen <= dist || nextLane->
isInternal());
2389 for (MSEdgeVector::iterator i = pred.begin(); i != pred.end();) {
2398 if (pred.size() != 0) {
2400 MSEdge* best = *pred.begin();
2412 MSLane* cand = (*i).lane;
2413 if (&(cand->
getEdge()) == &fromEdge) {
2433 #ifdef DEBUG_LANE_SORTER 2434 std::cout <<
"\nBest predecessor lane for lane '" <<
myID <<
"': '" << best.lane->getID() <<
"'" << std::endl;
2449 std::vector<MSLink*> candidateLinks =
myLinks;
2452 MSLane* best = (*candidateLinks.begin())->getViaLaneOrLane();
2453 #ifdef DEBUG_LANE_SORTER 2454 std::cout <<
"\nBest successor lane for lane '" <<
myID <<
"': '" << best->getID() <<
"'" << std::endl;
2472 const std::vector<std::pair<const MSLane*, const MSEdge*> >
2474 std::vector<std::pair<const MSLane*, const MSEdge*> > result;
2476 assert(link->getLane() !=
nullptr);
2477 result.push_back(std::make_pair(link->getLane(), link->getViaLane() ==
nullptr ? nullptr : &link->getViaLane()->getEdge()));
2499 for (MSLinkCont::const_iterator i =
myLinks.begin(); i !=
myLinks.end(); ++i) {
2500 if ((*i)->getLane()->getEdge().isCrossing()) {
2501 return (
int)(i -
myLinks.begin());
2545 wtime += (*i)->getWaitingSeconds();
2558 for (VehCont::const_iterator i = vehs.begin(); i != vehs.end(); ++i) {
2559 v += (*i)->getSpeed();
2571 for (MSLane::VehCont::const_iterator i = vehs.begin(); i != vehs.end(); ++i) {
2572 ret += (*i)->getCO2Emissions();
2583 for (MSLane::VehCont::const_iterator i = vehs.begin(); i != vehs.end(); ++i) {
2584 ret += (*i)->getCOEmissions();
2595 for (MSLane::VehCont::const_iterator i = vehs.begin(); i != vehs.end(); ++i) {
2596 ret += (*i)->getPMxEmissions();
2607 for (MSLane::VehCont::const_iterator i = vehs.begin(); i != vehs.end(); ++i) {
2608 ret += (*i)->getNOxEmissions();
2619 for (MSLane::VehCont::const_iterator i = vehs.begin(); i != vehs.end(); ++i) {
2620 ret += (*i)->getHCEmissions();
2631 for (MSLane::VehCont::const_iterator i = vehs.begin(); i != vehs.end(); ++i) {
2632 ret += (*i)->getFuelConsumption();
2643 for (MSLane::VehCont::const_iterator i = vehs.begin(); i != vehs.end(); ++i) {
2644 ret += (*i)->getElectricityConsumption();
2655 if (vehs.size() == 0) {
2659 for (MSLane::VehCont::const_iterator i = vehs.begin(); i != vehs.end(); ++i) {
2660 double sv = (*i)->getHarmonoise_NoiseEmissions();
2661 ret += (double) pow(10., (sv / 10.));
2692 myLaneDir(e->getLanes()[0]->
getShape().angleAt2D(0)) {
2703 if (ae1 != 0 && ae1->size() != 0) {
2713 if (ae2 != 0 && ae2->size() != 0) {
2751 #ifdef DEBUG_LANE_SORTER 2752 std::cout <<
"\nincoming_lane_priority sorter()\n" 2753 <<
"noninternal predecessor for lane '" << laneInfo1.
lane->
getID()
2754 <<
"': '" << noninternal1->
getID() <<
"'\n" 2755 <<
"noninternal predecessor for lane '" << laneInfo2.
lane->
getID()
2756 <<
"': '" << noninternal2->
getID() <<
"'\n";
2764 bool priorized1 =
true;
2765 bool priorized2 =
true;
2767 std::vector<MSLink*>::const_iterator j;
2768 #ifdef DEBUG_LANE_SORTER 2769 std::cout <<
"FoeLinks of '" << noninternal1->
getID() <<
"'" << std::endl;
2772 #ifdef DEBUG_LANE_SORTER 2773 std::cout << (*j)->getLaneBefore()->getID() << std::endl;
2781 #ifdef DEBUG_LANE_SORTER 2782 std::cout <<
"FoeLinks of '" << noninternal2->
getID() <<
"'" << std::endl;
2785 #ifdef DEBUG_LANE_SORTER 2786 std::cout << (*j)->getLaneBefore()->getID() << std::endl;
2795 assert(priorized1 || priorized2);
2796 if (priorized1 != priorized2) {
2824 #ifdef DEBUG_LANE_SORTER 2825 std::cout <<
"\noutgoing_lane_priority sorter()\n" 2826 <<
"noninternal successors for lane '" <<
myLane->
getID()
2827 <<
"': '" << target1->
getID() <<
"' and " 2828 <<
"'" << target2->
getID() <<
"'\n";
2835 if (priority1 != priority2) {
2836 return priority1 > priority2;
2872 for (std::vector<std::string>::const_iterator it = vehIds.begin(); it != vehIds.end(); ++it) {
2901 bool allSublanes,
double searchDist,
bool ignoreMinorLinks)
const {
2904 #ifdef DEBUG_CONTEXT 2906 std::cout <<
SIMTIME <<
" getFollowers lane=" <<
getID() <<
" ego=" << ego->
getID() <<
" pos=" << egoPos <<
"\n";
2915 #ifdef DEBUG_CONTEXT 2925 #ifdef DEBUG_CONTEXT 2927 std::cout <<
" (1) added veh=" << veh->
getID() <<
" latOffset=" << latOffset <<
" result=" << result.
toString() <<
"\n";
2932 #ifdef DEBUG_CONTEXT 2934 std::cout <<
" result.numFreeSublanes=" << result.
numFreeSublanes() <<
"\n";
2942 if (searchDist == -1) {
2946 std::set<MSLane*> visited;
2947 std::vector<MSLane::IncomingLaneInfo> newFound;
2949 while (toExamine.size() != 0) {
2950 for (std::vector<MSLane::IncomingLaneInfo>::iterator it = toExamine.begin(); it != toExamine.end(); ++it) {
2951 MSLane* next = (*it).lane;
2955 #ifdef DEBUG_CONTEXT 2957 std::cout <<
" next=" << next->
getID() <<
" first=" << first.toString() <<
" firstFront=" << firstFront.
toString() <<
"\n";
2960 for (
int i = 0; i < first.numSublanes(); ++i) {
2963 if (v != 0 && v != ego) {
2970 agap = (*it).length - next->
getLength() + backOffset
2977 if (v != 0 && v != ego) {
2985 if (!(*it).viaLink->havePriority() && !ego->onFurtherEdge(&(*it).lane->getEdge())
2989 agap =
MAX2(agap, 0.0);
2993 #ifdef DEBUG_CONTEXT 3000 if ((*it).length < searchDist) {
3001 const std::vector<MSLane::IncomingLaneInfo>& followers = next->
getIncomingLanes();
3002 for (std::vector<MSLane::IncomingLaneInfo>::const_iterator j = followers.begin(); j != followers.end(); ++j) {
3003 if (visited.find((*j).lane) == visited.end() && ((*j).viaLink->havePriority() || !ignoreMinorLinks)) {
3004 visited.insert((*j).lane);
3006 ili.
lane = (*j).lane;
3007 ili.
length = (*j).length + (*it).length;
3009 newFound.push_back(ili);
3015 swap(newFound, toExamine);
3040 const MSLane* nextLane =
this;
3046 MSLinkCont::const_iterator link =
succLinkSec(*ego, view, *nextLane, bestLaneConts);
3053 if (linkLeaders.size() > 0) {
3059 #ifdef DEBUG_CONTEXT 3061 std::cout <<
" linkleader=" << veh->
getID() <<
" gap=" << ll.
vehAndGap.second <<
"\n";
3069 bool nextInternal = (*link)->getViaLane() != 0;
3070 nextLane = (*link)->getViaLaneOrLane();
3071 if (nextLane == 0) {
3076 #ifdef DEBUG_CONTEXT 3078 std::cout <<
SIMTIME <<
" getLeadersOnConsecutive lane=" <<
getID() <<
" nextLane=" << nextLane->
getID() <<
" leaders=" << leaders.
toString() <<
"\n";
3083 for (
int i = 0; i < iMax; ++i) {
3086 #ifdef DEBUG_CONTEXT 3106 if (!nextInternal) {
3121 #ifdef DEBUG_CONTEXT 3123 std::cout <<
SIMTIME <<
" getPartialBehind lane=" <<
getID() <<
" ego=" << ego->
getID() <<
" found=" << veh->
getID() <<
"\n";
3129 #ifdef DEBUG_CONTEXT 3164 if (opposite == 0) {
3166 throw ProcessError(
"Lane '" +
getID() +
"' cannot compute oppositePos as there is no opposite lane.");
3173 std::pair<MSVehicle* const, double>
3178 #ifdef DEBUG_CONTEXT 3180 std::cout <<
" getFollower lane=" <<
getID() <<
" egoPos=" << egoPos <<
" pred=" << pred->
getID() <<
" predPos=" << pred->
getPositionOnLane(
this) <<
"\n";
3189 return std::make_pair(const_cast<MSVehicle*>(result.first), result.second);
3192 std::pair<MSVehicle* const, double>
3194 #ifdef DEBUG_OPPOSITE 3196 <<
" ego=" << ego->
getID()
3200 <<
" oppositeDir=" << oppositeDir
3208 std::pair<MSVehicle* const, double> result =
getFollower(ego, egoPos + egoLength, dist,
true);
3215 std::pair<MSVehicle* const, double>
3217 #ifdef DEBUG_OPPOSITE 3219 <<
" ego=" << ego->
getID()
3229 if (result.first != 0) {
3230 if (result.first->getLaneChangeModel().isOpposite()) {
3231 result.second -= result.first->getVehicleType().getLength();
3235 return std::make_pair(static_cast<MSVehicle*>(0), -1);
3246 const std::string action = oc.
getString(
"collision.action");
3247 if (action ==
"none") {
3249 }
else if (action ==
"warn") {
3251 }
else if (action ==
"teleport") {
3253 }
else if (action ==
"remove") {
3256 WRITE_ERROR(
"Invalid collision.action '" + action +
"'.");
3294 #ifdef DEBUG_INSERTION 3296 std::cout <<
SIMTIME <<
" check for pedestrians on lane=" <<
getID() <<
" pos=" << pos <<
"\n";
3301 if (leader.first != 0) {
3304 if (gap < 0 ||
checkFailure(aVehicle, speed, dist, stopSpeed, patchSpeed,
"")) {
3306 #ifdef DEBUG_INSERTION 3308 <<
" isInsertionSuccess lane=" <<
getID()
3309 <<
" veh=" << aVehicle->
getID()
3312 <<
" patchSpeed=" << patchSpeed
3313 <<
" speed=" << speed
3314 <<
" stopSpeed=" << stopSpeed
3315 <<
" pedestrianLeader=" << leader.first->getID()
3316 <<
" failed (@796)!\n";
void detectPedestrianJunctionCollision(const MSVehicle *collider, const PositionVector &colliderBoundary, const MSLane *foeLane, SUMOTime timestep, const std::string &stage)
detect whether a vehicle collids with pedestrians on the junction
const std::vector< IncomingLaneInfo > & getIncomingLanes() const
bool gDebugFlag1
global utility flags for debugging
std::pair< MSVehicle *const, double > getFollower(const MSVehicle *ego, double egoPos, double dist, bool ignoreMinorLinks) const
Find follower vehicle for the given ego vehicle (which may be on the opposite direction lane) ...
bool isChangingLanes() const
return true if the vehicle currently performs a lane change maneuver
double getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
double getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
void loadState(std::vector< std::string > &vehIDs, MSVehicleControl &vc)
Loads the state of this segment with the given parameters.
static double gLateralResolution
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
SVCPermissions myPermissions
The vClass permissions for this lane.
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
double ymin() const
Returns minimum y-coordinate.
VehCont myVehicles
The lane's vehicles. This container holds all vehicles that have their front (longitudinally) and the...
double getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
double brakeGap(const double speed) const
Returns the distance the vehicle needs to halt including driver's reaction time tau (i...
saves leader/follower vehicles and their distances relative to an ego vehicle
virtual double freeSpeed(const MSVehicle *const veh, double speed, double seen, double maxSpeed, const bool onInsertion=false) const
Computes the vehicle's safe speed without a leader.
double xmax() const
Returns maximum x-coordinate.
double getNOxEmissions() const
Returns the sum of last step NOx emissions.
MSEdge & getEdge() const
Returns the lane's edge.
A free lateral position is chosen.
Representation of a vehicle in the micro simulation.
MSVehicle * getFirstFullVehicle() const
returns the first vehicle for which this lane is responsible or 0
At the leftmost side of the lane.
virtual int addLeader(const MSVehicle *veh, bool beyond, double latOffset=0)
MSLane(const std::string &id, double maxSpeed, double length, MSEdge *const edge, int numericalID, const PositionVector &shape, double width, SVCPermissions permissions, int index, bool isRampAccel)
Constructor.
int getPriority() const
Returns the priority of the edge.
double getAngle() const
Returns the vehicle's direction in radians.
void informVehicleStateListener(const SUMOVehicle *const vehicle, VehicleState to, const std::string &info="")
Informs all added listeners about a vehicle's state change.
PositionVector getBoundingPoly() const
get bounding polygon
int operator()(MSVehicle *v1, MSVehicle *v2) const
Comparing operator.
void sortManeuverReservations()
sorts myManeuverReservations
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
const MSEdge * getNextNormal() const
Returns the lane's follower if it is an internal lane, the edge of the lane otherwise.
std::string containerstop
(Optional) container stop if one is assigned to the stop
static void insertIDs(std::vector< std::string > &into)
Adds the ids of all stored lanes into the given vector.
void enterLaneAtInsertion(MSLane *enteredLane, double pos, double speed, double posLat, MSMoveReminder::Notification notification)
Update when the vehicle enters a new lane in the emit step.
void updateLeaderInfo(const MSVehicle *veh, VehCont::reverse_iterator &vehPart, VehCont::reverse_iterator &vehRes, MSLeaderInfo &ahead) const
This updates the MSLeaderInfo argument with respect to the given MSVehicle. All leader-vehicles on th...
Sorts lanes (IncomingLaneInfos) by their priority or, if this doesn't apply, wrt. the angle differenc...
MSLane * parallelLane(const MSLane *const lane, int offset) const
Returns the lane with the given offset parallel to the given lane one or 0 if it does not exist...
virtual bool hasPedestrians(const MSLane *lane)
whether the given lane has pedestrians on it
virtual void removeParking(MSVehicle *veh)
remove parking vehicle. This must be syncrhonized when running with GUI
std::pair< MSVehicle *const, double > getOppositeLeader(const MSVehicle *ego, double dist, bool oppositeDir) const
bool parking
whether the vehicle is removed from the net while stopping
MSLane * getLane() const
Returns the connected lane.
double getMaxSpeedFactor() const
return the maximum speed factor for all vehicles that ever entered the network
begin/end of the description of a single lane
bool hasDeparted() const
Returns whether this vehicle has already departed.
bool checkFailure(const MSVehicle *aVehicle, double &speed, double &dist, const double nspeed, const bool patchSpeed, const std::string errorMsg) const
int myI2
index for myPartialVehicles
bool resumeFromStopping()
MSLane * getLane() const
Returns the lane the vehicle is on.
double getFuelConsumption() const
Returns the sum of last step fuel consumption.
SUMOTime duration
The stopping duration.
bool isInsertionSuccess(MSVehicle *vehicle, double speed, double pos, double posLat, bool recheckNextLanes, MSMoveReminder::Notification notification)
Tries to insert the given vehicle with the given state (speed and pos)
void registerTeleportYield()
register one non-collision-related teleport
static void fill(RTREE &into)
Fills the given RTree with lane instances.
double getMaximumBrakeDist() const
compute maximum braking distance on this lane
int gPrecision
the precision for floating point outputs
The vehicle arrived at a junction.
void setMaxSpeed(double val)
Sets a new maximum speed for the lane (used by TraCI and MSCalibrator)
const SUMOVehicleParameter::Stop pars
The stop parameter.
void recalcCache()
Recalculates the cached values.
This is an uncontrolled, minor link, has to stop.
const MSEdgeVector & getPredecessors() const
static bool haveLateralDynamics()
whether any kind of lateral dynamics is active
std::vector< IncomingLaneInfo > myIncomingLanes
All direct predecessor lanes.
The car-following model abstraction.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
int myI2End
end index for myPartialVehicles
double getPositionOnLane() const
Get the vehicle's position along the lane.
void addLink(MSLink *link)
Delayed initialization.
MSLane * myCanonicalPredecessorLane
Similar to LogicalPredecessorLane,.
int myIndex
The lane index.
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
virtual bool integrateNewVehicle(SUMOTime t)
Insert buffered vehicle into the real lane.
The lateral position is chosen randomly.
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
static double myCollisionMinGapFactor
SUMOTime myLeaderInfoTime
time step for which myLeaderInfo was last updated
If a fixed number of random choices fails, a free lateral position is chosen.
SUMOVehicle * getVehicle(const std::string &id) const
Returns the vehicle with the given id.
bool operator()(const MSVehicle *cmp, double pos) const
compares vehicle position to the detector position
AnyVehicleIterator is a structure, which manages the iteration through all vehicles on the lane...
static SUMOTime myCollisionStopTime
Notification
Definition of a vehicle state.
virtual void resetManeuverReservation(MSVehicle *v)
Unregisters a vehicle, which previously registered for maneuvering into this lane.
std::string time2string(SUMOTime t)
A RT-tree for efficient storing of SUMO's Named objects.
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
double myBruttoVehicleLengthSum
The current length of all vehicles on this lane, including their minGaps.
MSVehicle * getFirstAnyVehicle() const
returns the first vehicle that is fully or partially on this lane
const std::vector< MSLane * > * allowedLanes(const MSEdge &destination, SUMOVehicleClass vclass=SVC_IGNORING) const
Get the allowed lanes to reach the destination-edge.
const MSEdge *const myEdge
std::map< long long, SVCPermissions > myPermissionChanges
void addIncomingLane(MSLane *lane, MSLink *viaLink)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double getPMxEmissions() const
Returns the sum of last step PMx emissions.
by_connections_to_sorter(const MSEdge *const e)
constructor
double getLength() const
Returns the lane's length.
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
const PositionVector & getShape() const
Returns this lane's shape.
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
The speed is chosen randomly.
PositionVector getBoundingBox() const
get bounding rectangle
bool isLinkEnd(MSLinkCont::const_iterator &i) const
static void initCollisionOptions(const OptionsCont &oc)
virtual void addMoveReminder(MSMoveReminder *rem)
Add a move-reminder to move-reminder container.
const MSRoute & getRoute() const
Returns the current route.
MSLink * getLinkTo(const MSLane *) const
returns the link to the given lane or 0, if it is not connected
double getCollisionMinGapFactor() const
Get the factor of minGap that must be maintained to avoid a collision event.
The vehicle got vaporized.
void leftByLaneChange(MSVehicle *v)
SUMOTime until
The time at which the vehicle may continue its journey.
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, bool collision=false, MSRouteIterator *searchStart=0)
Adds a stop.
double getRightSideOnLane() const
Get the vehicle's lateral position on the lane:
const MSEdge * getLastEdge() const
returns the destination edge
MSLane * getCanonicalPredecessorLane() const
This is an uncontrolled, right-before-left link.
bool executeMove()
Executes planned vehicle movements with regards to right-of-way.
double getSafeFollowSpeed(const std::pair< const MSVehicle *, double > leaderInfo, const double seen, const MSLane *const lane, double distToCrossing) const
compute safe speed for following the given leader
void addNeigh(const std::string &id)
Adds a neighbor to this lane.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
const std::string & getID() const
Returns the id.
const SVCPermissions SVCAll
all VClasses are allowed
void gotActive(MSLane *l)
Informs the control that the given lane got active.
virtual double insertionStopSpeed(const MSVehicle *const veh, double speed, double gap) const
Computes the vehicle's safe speed for approaching an obstacle at insertion without constraints due to...
virtual double setPartialOccupation(MSVehicle *v)
Sets the information about a vehicle lapping into this lane.
VehCont myPartialVehicles
The lane's partial vehicles. This container holds all vehicles that are partially on this lane but wh...
std::vector< MSTransportable * > getSortedPersons(SUMOTime timestep, bool includeRiding=false) const
Returns this edge's persons sorted by pos.
The position is chosen randomly.
static bool myCheckJunctionCollisions
This is an uncontrolled, all-way stop link.
virtual void setManeuverReservation(MSVehicle *v)
Registers the lane change intentions (towards this lane) for the given vehicle.
double getWidth() const
Returns the lane's width.
int myI1End
end index for myVehicles
bool hasArrived() const
Returns whether this vehicle has already arived (reached the arrivalPosition on its final edge) ...
A class that stores a 2D geometrical boundary.
virtual double insertionFollowSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const
Computes the vehicle's safe speed (no dawdling) This method is used during the insertion stage...
int myDirection
index delta
std::string parkingarea
(Optional) parking area if one is assigned to the stop
PositionVector myShape
The shape of the lane.
#define WRITE_WARNING(msg)
int myI3
index for myTmpVehicles
MSLane * getCanonicalSuccessorLane() const
std::set< const MSVehicle * > myParkingVehicles
void getLeadersOnConsecutive(double dist, double seen, double speed, const MSVehicle *ego, const std::vector< MSLane *> &bestLaneConts, MSLeaderDistanceInfo &result) const
Returns the immediate leaders and the distance to them (as getLeaderOnConsecutive but for the sublane...
bool myDownstream
iteration direction
MSAbstractLaneChangeModel & getLaneChangeModel()
bool isVaporizing() const
Returns whether vehicles on this edge shall be vaporized.
bool isFrontOnLane(const MSLane *lane) const
Returns the information whether the front of the vehicle is on the given lane.
std::vector< std::string > myNeighs
LinkState getState() const
Returns the current state of the link.
static CollisionAction myCollisionAction
the action to take on collisions
const std::string & getEdgeType() const
Returns the type of the edge.
std::map< std::string, MSLane *> DictType
definition of the static dictionary type
static CollisionAction getCollisionAction()
virtual void detectCollisions(SUMOTime timestep, const std::string &stage)
Check if vehicles are too close.
static DictType myDict
Static dictionary to associate string-ids with objects.
Sorts lanes (their origin link) by the priority of their noninternal target edges or...
std::string busstop
(Optional) bus stop if one is assigned to the stop
void addApproachingLane(MSLane *lane, bool warnMultiCon)
double departSpeed
(optional) The initial speed of the vehicle
virtual const MSEdge * succEdge(int nSuccs) const =0
Returns the nSuccs'th successor of edge the vehicle is currently at.
A road/street connecting two junctions.
void leaveLane(const MSMoveReminder::Notification reason, const MSLane *approachedLane=0)
Update of members if vehicle leaves a new lane in the lane change step or at arrival.
virtual int addLeader(const MSVehicle *veh, double gap, double latOffset=0, int sublane=-1)
double getLatOffset(const MSLane *lane) const
Get the offset that that must be added to interpret myState.myPosLat for the given lane...
bool insertVehicle(MSVehicle &v)
Tries to insert the given vehicle.
No information given; use default.
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
double myLength
Lane length [m].
void resetPermissions(long long transientID)
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
VehCont myTmpVehicles
Container for lane-changing vehicles. After completion of lane-change- process, the containers will b...
void setPermissions(SVCPermissions permissions, long long transientID)
Sets the permissions to the given value. If a transientID is given, the permissions are recored as te...
int operator()(const IncomingLaneInfo &lane1, const IncomingLaneInfo &lane2) const
comparing operator
MSLink * getEntryLink() const
Returns the entry link if this is an internal lane, else 0.
const MSVehicle * operator*()
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
int getCrossingIndex() const
return the index of the link to the next crossing if this is walkingArea, else -1 ...
The vehicle is involved in a collision.
virtual void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
double getCO2Emissions() const
Returns the sum of last step CO2 emissions.
const bool myIsRampAccel
whether this lane is an acceleration lane
virtual double getSecureGap(const double speed, const double leaderSpeed, const double leaderMaxDecel) const
Returns the minimum gap to reserve if the leader is braking at maximum (>=0)
Representation of a vehicle.
double startPos
The stopping position start.
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
int operator()(const std::pair< const MSVehicle *, double > &p1, const std::pair< const MSVehicle *, double > &p2) const
void setLength(double val)
Sets a new length for the lane (used by TraCI only)
static MSPModel * getModel()
This is an uncontrolled, minor link, has to brake.
Sorts vehicles by their position (descending)
double myRightSideOnEdge
the combined width of all lanes with lower index on myEdge
std::string chargingStation
(Optional) charging station if one is assigned to the stop
bool lastInsertion(MSVehicle &veh, double mspeed, double posLat, bool patchSpeed)
inserts vehicle as close as possible to the last vehicle on this lane (or at the end of the lane if t...
SVCPermissions myOriginalPermissions
The original vClass permissions for this lane (before temporary modifications)
outgoing_lane_priority_sorter(const MSLane *sourceLane)
constructor
void updateBestLanes(bool forceRebuild=false, const MSLane *startLane=0)
computes the best lanes to use in order to continue the route
void enteredByLaneChange(MSVehicle *v)
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the best sequence of lanes to continue the route starting at myLane.
double getEmergencyDecel() const
Get the vehicle type's maximal phisically possible deceleration [m/s^2].
const MSLeaderInfo & getLastVehicleInformation(const MSVehicle *ego, double latOffset, double minPos=0, bool allowCached=true) const
Returns the last vehicles on the lane.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
const std::set< MSTransportable * > & getPersons() const
Returns this edge's persons set.
double getCenterOnEdge(const MSLane *lane=0) const
Get the vehicle's lateral position on the edge of the given lane (or its current edge if lane == 0) ...
double getMinDeceleration() const
return the minimum deceleration capability for all vehicles that ever entered the network ...
const std::map< SUMOVehicleClass, double > * myRestrictions
The vClass speed restrictions for this lane.
bool triggered
whether an arriving person lets the vehicle continue
std::pair< MSVehicle *const, double > getOppositeFollower(const MSVehicle *ego) const
bool checkForPedestrians(const MSVehicle *aVehicle, double &speed, double &dist, double pos, bool patchSpeed) const
check whether pedestrians on this lane interfere with vehicle insertion
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
ConstMSEdgeVector::const_iterator MSRouteIterator
The vehicle arrived at its destination (is deleted)
double safeInsertionSpeed(const MSVehicle *veh, double seen, const MSLeaderInfo &leaders, double speed)
return the maximum safe speed for insertion behind leaders (a negative value indicates that safe inse...
double getSpeedLimit() const
Returns the lane's maximum allowed speed.
const std::map< SUMOVehicleClass, double > * getRestrictions(const std::string &id) const
Returns the restrictions for an edge type If no restrictions are present, 0 is returned.
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
int operator()(const MSLink *link1, const MSLink *link2) const
comparing operator
Sorts edges by their angle relative to the given edge (straight comes first)
The maximum speed is used.
std::string toString() const
print a debugging representation
void forceVehicleInsertion(MSVehicle *veh, double pos, MSMoveReminder::Notification notification, double posLat=0)
Inserts the given vehicle at the given position.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
SUMOTime string2time(const std::string &r)
MSVehicle * getPartialBehind(const MSVehicle *ego) const
double xmin() const
Returns minimum x-coordinate.
AnyVehicleIterator anyVehiclesEnd() const
end iterator for iterating over all vehicles touching this lane in downstream direction ...
void add(const SUMOTime t, MSVehicle *veh)
Adds a vehicle to this transfer object.
AnyVehicleIterator anyVehiclesBegin() const
begin iterator for iterating over all vehicles touching this lane in downstream direction ...
std::vector< LinkLeader > LinkLeaders
LinkState getIncomingLinkState() const
get the state of the link from the logical predecessor to this lane
double getImpatience() const
Returns this vehicles impatience.
No information given; use default.
virtual bool executeMovements(SUMOTime t, std::vector< MSLane *> &lanesWithVehiclesToIntegrate)
Executes planned vehicle movements with regards to right-of-way.
std::pair< MSVehicle *const, double > getLeader(const MSVehicle *veh, const double vehPos, const std::vector< MSLane *> &bestLaneConts, double dist=-1, bool checkTmpVehicles=false) const
Returns the immediate leader of veh and the distance to veh starting on this lane.
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
std::pair< MSVehicle *, double > vehAndGap
virtual PersonDist nextBlocking(const MSLane *lane, double minPos, double minRight, double maxLeft, double stopTime=0)
returns the next pedestrian beyond minPos that is laterally between minRight and maxLeft or 0 ...
Boundary & grow(double by)
extends the boundary by the given amount
bool hasInfluencer() const
int myRightmostSublane
the index of the rightmost sublane of this lane on myEdge
MSLane * myLogicalPredecessorLane
double endPos
The stopping position end.
double getMinGap() const
Get the free space in front of vehicles of this class.
SUMOTime collisionStopTime() const
Returns the remaining time a vehicle needs to stop due to a collision. A negative value indicates tha...
Something on a lane to be noticed about vehicle movement.
const std::vector< std::pair< const MSLane *, const MSEdge * > > getOutgoingViaLanes() const
get the list of outgoing lanes
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
double basePos(const MSEdge *edge) const
departure position where the vehicle fits fully onto the edge (if possible)
MSLane * getOpposite() const
return the opposite direction lane for lane changing or 0
bool overlapsWith(const AbstractPoly &poly, double offset=0) const
Returns the information whether the given polygon overlaps with this.
AnyVehicleIterator anyVehiclesUpstreamBegin() const
begin iterator for iterating over all vehicles touching this lane in upstream direction ...
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
bool isInternal() const
return whether this edge is an internal edge
void registerTeleportJam()
register one non-collision-related teleport
double getHCEmissions() const
Returns the sum of last step HC emissions.
If a fixed number of random choices fails, a free position is chosen.
std::map< MSEdge *, std::vector< MSLane * > > myApproachingLanes
All direct internal and direct (disregarding internal predecessors) non-internal predecessor lanes of...
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
std::vector< MSVehicle * > VehCont
Container for vehicles.
const MSLane * lane
The lane to stop at.
bool containerTriggered
whether an arriving container lets the vehicle continue
static MSLinkCont::const_iterator succLinkSec(const SUMOVehicle &veh, int nRouteSuccs, const MSLane &succLinkSource, const std::vector< MSLane *> &conts)
int operator()(const MSEdge *const e1, const MSEdge *const e2) const
comparing operator
Base class for objects which have an id.
std::map< SVCPermissions, double > myStopOffsets
int myNumericalID
Unique numerical ID (set on reading by netload)
std::vector< MSMoveReminder *> myMoveReminders
This lane's move reminder.
VehCont myManeuverReservations
The vehicles which registered maneuvering into the lane within their current action step...
const MSLane *const myLane
double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
double getRightSideOnEdge() const
incoming_lane_priority_sorter(const MSLane *targetLane)
constructor
MSLeaderInfo getPartialBeyond() const
get all vehicles that are inlapping from consecutive edges
std::string lane
The lane to stop at.
void initRestrictions()
initialized vClass-specific speed limits
AnyVehicleIterator & operator++()
static MSVehicleTransfer * getInstance()
Returns the instance of this object.
double departPosLat
(optional) The lateral position the vehicle shall depart from
std::pair< const MSPerson *, double > PersonDist
MSVehicle * getLastFullVehicle() const
returns the last vehicle for which this lane is responsible or 0
void sortPartialVehicles()
sorts myPartialVehicles
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
bool freeInsertion(MSVehicle &veh, double speed, double posLat, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Tries to insert the given vehicle on any place.
virtual std::string toString() const
print a debugging representation
double getElectricityConsumption() const
Returns the sum of last step electricity consumption.
double departPos
(optional) The position the vehicle shall depart from
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
static SUMOTime gTimeToGridlockHighways
std::pair< const MSVehicle *, double > CLeaderDist
int addFollower(const MSVehicle *veh, const MSVehicle *ego, double gap, double latOffset=0, int sublane=-1)
std::string myID
The name of the object.
const std::vector< MSLink * > & getFoeLinks() const
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
The vehicle has departed (was inserted into the network)
Influencer & getInfluencer()
Returns the velocity/lane influencer.
void scheduleVehicleRemoval(SUMOVehicle *veh)
Removes a vehicle after it has ended.
double getCOEmissions() const
Returns the sum of last step CO emissions.
Structure representing possible vehicle parameter.
std::pair< MSVehicle *const, double > getLeaderOnConsecutive(double dist, double seen, double speed, const MSVehicle &veh, const std::vector< MSLane *> &bestLaneConts) const
Returns the immediate leader and the distance to him.
int myI1
index for myVehicles
double getOppositePos(double pos) const
return the corresponding position on the opposite lane
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
static bool gUnitTests
whether unit tests are being run
double processNextStop(double currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
void setTentativeLaneAndPosition(MSLane *lane, double pos, double posLat=0)
set tentative lane and position during insertion to ensure that all cfmodels work (some of them requi...
static MSLink * getConnectingLink(const MSLane &from, const MSLane &to)
Returns the link connecting both lanes Both lanes have to be non-internal; 0 may be returned if no co...
MSInsertionControl & getInsertionControl()
Returns the insertion control.
static void clear()
Clears the dictionary.
const MSLane * getFirstInternalInConnection(double &offset) const
Returns 0 if the lane is not internal. Otherwise the first part of the connection (sequence of intern...
bool nextIsMyVehicles() const
int myI3End
end index for myTmpVehicles
MSEdge *const myEdge
The lane's edge, for routing only.
Definition of vehicle stop (position and duration)
At the rightmost side of the lane.
bool detectCollisionBetween(SUMOTime timestep, const std::string &stage, MSVehicle *collider, MSVehicle *victim, std::set< const MSVehicle *, ComparatorIdLess > &toRemove, std::set< const MSVehicle *> &toTeleport) const
detect whether there is a collision between the two vehicles
At the center of the lane.
const MSLane * myLane
the lane that is being iterated
A storage for options typed value containers)
double angleAt2D(int pos) const
get angle in certain position of position vector
int index
at which position in the stops list
MSVehicle * getLastAnyVehicle() const
returns the last vehicle that is fully or partially on this lane
bool isApproachedFrom(MSEdge *const edge)
double getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
double getStopOffset(const MSVehicle *veh) const
Returns vehicle class specific stopOffset for the vehicle.
std::pair< MSVehicle *const, double > getCriticalLeader(double dist, double seen, double speed, const MSVehicle &veh) const
Returns the most dangerous leader and the distance to him.
static SUMOTime gTimeToGridlock
double getLength() const
Get vehicle's length [m].
AnyVehicleIterator anyVehiclesUpstreamEnd() const
end iterator for iterating over all vehicles touching this lane in upstream direction ...
const MSLeaderInfo & getFirstVehicleInformation(const MSVehicle *ego, double latOffset, bool onlyFrontOnLane, double maxPos=std::numeric_limits< double >::max(), bool allowCached=true) const
analogue to getLastVehicleInformation but in the upstream direction
const MSEdge * succEdge(int nSuccs) const
Returns the nSuccs'th successor of edge the vehicle is currently at.
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
int operator()(MSVehicle *v1, MSVehicle *v2) const
Comparing operator.
bool isRemoteAffected(SUMOTime t) const
void saveState(OutputDevice &out)
Saves the state of this lane into the given stream.
MSLeaderInfo myLeaderInfo
leaders on all sublanes as seen by approaching vehicles (cached)
const MSLane *const myLane
double getBackPositionOnLane(const MSLane *lane) const
Get the vehicle's position relative to the given lane.
MSLane * myCanonicalSuccessorLane
Main successor lane,.
Static storage of an output device and its base (abstract) implementation.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
void registerCollision()
registers one collision-related teleport
MSEdgeControl & getEdgeControl()
Returns the edge control.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
double myNettoVehicleLengthSum
The current length of all vehicles on this lane, excluding their minGaps.
double getMeanSpeed() const
Returns the mean speed on this lane.
MSLeaderInfo myFollowerInfo
followers on all sublanes as seen by vehicles on consecutive lanes (cached)
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
virtual ~MSLane()
Destructor.
MSLane * getShadowLane() const
Returns the lane the vehicle's shadow is on during continuous/sublane lane change.
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
void addParking(MSVehicle *veh)
add parking vehicle. This should only used during state loading
int numFreeSublanes() const
bool isStopped() const
Returns whether the vehicle is at a stop.
No information given; use default.
A free position is chosen.
The class responsible for building and deletion of vehicles.
double getMissingRearGap(const MSVehicle *leader, double backOffset, double leaderSpeed) const
return by how much further the leader must be inserted to avoid rear end collisions ...
const double myLengthGeometryFactor
precomputed myShape.length / myLength
std::vector< MSEdge * > MSEdgeVector
MSLeaderInfo myLeaderInfoTmp
Insert behind the last vehicle as close as possible to still allow the specified departSpeed. Fallback to DEPART_POS_BASE if there is no vehicle on the departLane yet.
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
double getRightSideOnEdge(const MSLane *lane=0) const
Get the vehicle's lateral position on the edge of the given lane (or its current edge if lane == 0) ...
const std::vector< LaneQ > & getBestLanes() const
Returns the description of best lanes to use in order to continue the route.
VehCont myVehBuffer
Buffer for vehicles that moved from their previous lane onto this one. Integrated after all vehicles ...
static double angleDiff(const double angle1, const double angle2)
Returns the difference of the second angle to the first angle in radiants.
bool isParking() const
Returns whether the vehicle is parking.
double getDepartPosLat(const MSVehicle &veh)
double getSpeed() const
Returns the vehicle's current speed.
static const long CHANGE_PERMISSIONS_PERMANENT
MSLeaderDistanceInfo getFollowersOnConsecutive(const MSVehicle *ego, double backOffset, bool allSublanes, double searchDist=-1, bool ignoreMinorLinks=false) const
return the sublane followers with the largest missing rear gap among all predecessor lanes (within di...
double ymax() const
Returns maximum y-coordinate.
SUMOTime myFollowerInfoTime
time step for which myFollowerInfo was last updated
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
void handleCollisionBetween(SUMOTime timestep, const std::string &stage, MSVehicle *collider, MSVehicle *victim, double gap, double latGap, std::set< const MSVehicle *, ComparatorIdLess > &toRemove, std::set< const MSVehicle *> &toTeleport) const
take action upon collision
static SUMOTime gLaneChangeDuration
double myMaxSpeed
Lane-wide speedlimit [m/s].
double getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
static double sum(double val)
Computes the resulting noise.
const std::string & getID() const
Returns the name of the vehicle.
void registerTeleportWrongLane()
register one non-collision-related teleport
Representation of a lane in the micro simulation.
double getWaitingSeconds() const
Returns the overall waiting time on this lane.
virtual const std::string & getID() const =0
Get the vehicle's ID.
void descheduleDeparture(const SUMOVehicle *veh)
stops trying to emit the given vehicle (and delete it)
const double myWidth
Lane width [m].
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
virtual double stopSpeed(const MSVehicle *const veh, const double speed, double gap) const =0
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling) ...
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
virtual void incorporateVehicle(MSVehicle *veh, double pos, double speed, double posLat, const MSLane::VehCont::iterator &at, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Inserts the vehicle into this lane, and informs it about entering the network.
virtual bool appropriate(const MSVehicle *veh)
The vehicle is being teleported.
virtual void planMovements(const SUMOTime t)
Compute safe velocities for all vehicles based on positions and speeds from the last time step...
MSLane * getParallelLane(int offset) const
Returns the lane with the given offset parallel to this one or 0 if it does not exist.
Definition of vehicle stop (position and duration)
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
double getDepartSpeed(const MSVehicle &veh, bool &patchSpeed)
DepartPosLatDefinition departPosLatProcedure
Information how the vehicle shall choose the lateral departure position.