77 #include <mesosim/MESegment.h>
78 #include <mesosim/MELoop.h>
82 #ifdef CHECK_MEMORY_LEAKS
84 #endif // CHECK_MEMORY_LEAKS
87 #ifdef DEBUG_VEHICLE_GUI_SELECTION
94 #define BUS_STOP_OFFSET 0.5
96 #define CRLL_LOOK_AHEAD 5
127 return (myPos != state.
myPos ||
139 myPos(pos), mySpeed(speed) {}
147 mySpeedAdaptationStarted(true),
148 myConsiderSafeVelocity(true),
149 myConsiderMaxAcceleration(true),
150 myConsiderMaxDeceleration(true),
151 myAmVTDControlled(false),
165 mySpeedAdaptationStarted =
true;
166 mySpeedTimeLine = speedTimeLine;
172 myLaneTimeLine = laneTimeLine;
179 myOriginalSpeed = speed;
181 while (mySpeedTimeLine.size() == 1 || (mySpeedTimeLine.size() > 1 && currentTime > mySpeedTimeLine[1].first)) {
182 mySpeedTimeLine.erase(mySpeedTimeLine.begin());
185 if (mySpeedTimeLine.size() < 2 || currentTime < mySpeedTimeLine[0].first) {
189 if (!mySpeedAdaptationStarted) {
190 mySpeedTimeLine[0].second = speed;
191 mySpeedAdaptationStarted =
true;
195 speed = mySpeedTimeLine[0].second - (mySpeedTimeLine[0].second - mySpeedTimeLine[1].second) * td;
196 if (myConsiderSafeVelocity) {
197 speed =
MIN2(speed, vSafe);
199 if (myConsiderMaxAcceleration) {
200 speed =
MIN2(speed, vMax);
202 if (myConsiderMaxDeceleration) {
203 speed =
MAX2(speed, vMin);
212 while (myLaneTimeLine.size() == 1 || (myLaneTimeLine.size() > 1 && currentTime > myLaneTimeLine[1].first)) {
213 myLaneTimeLine.erase(myLaneTimeLine.begin());
217 if (myLaneTimeLine.size() >= 2 && currentTime >= myLaneTimeLine[0].first) {
218 const unsigned int destinationLaneIndex = myLaneTimeLine[1].second;
219 if (destinationLaneIndex < (
unsigned int)currentEdge.
getLanes().size()) {
220 if (currentLaneIndex > destinationLaneIndex) {
222 }
else if (currentLaneIndex < destinationLaneIndex) {
234 mode = myStrategicLC;
236 mode = myCooperativeLC;
238 mode = mySpeedGainLC;
240 mode = myRightDriveLC;
248 state &= ~LCA_WANTS_LANECHANGE_OR_STAY;
256 state &= ~LCA_WANTS_LANECHANGE_OR_STAY;
277 switch (changeRequest) {
293 assert(myLaneTimeLine.size() >= 2);
294 assert(currentTime >= myLaneTimeLine[0].first);
295 return STEPS2TIME(myLaneTimeLine[1].first - currentTime);
301 myConsiderSafeVelocity = value;
307 myConsiderMaxAcceleration = value;
323 myConsiderMaxDeceleration = value;
331 if (myVTDRoute.size() != 0) {
335 if (myVTDPos > myVTDLane->getLength()) {
336 myVTDPos = myVTDLane->getLength();
338 myVTDLane->forceVehicleInsertion(v, myVTDPos);
340 myAmVTDControlled =
false;
354 (*i)->resetPartialOccupation(
this);
358 if ((*i).myLink != 0) {
359 (*i).myLink->removeApproaching(
this);
394 for (std::vector<SUMOVehicleParameter::Stop>::iterator i = pars->
stops.begin(); i != pars->
stops.end(); ++i) {
397 "' on lane '" + i->lane +
"' is not downstream the current route.");
400 for (std::vector<SUMOVehicleParameter::Stop>::const_iterator i = route->
getStops().begin(); i != route->
getStops().end(); ++i) {
403 "' on lane '" + i->lane +
"' is not downstream the current route.");
406 const MSLane*
const depLane = (*myCurrEdge)->getDepartLane(*
this);
408 throw ProcessError(
"Invalid departlane definition for vehicle '" + pars->
id +
"'.");
412 WRITE_WARNING(
"Choosing new speed factor for vehicle '" + pars->
id +
"' to match departure speed.");
416 "' is too high for the departure lane '" + depLane->
getID() +
"'.");
421 "' is too high for the vehicle type '" + type->
getID() +
"'.");
432 if ((*i).myLink != 0) {
433 (*i).myLink->removeApproaching(
this);
477 for (std::list<Stop>::iterator iter =
myStops.begin(); iter !=
myStops.end();) {
478 if (find(edges.begin(), edges.end(), &iter->lane->getEdge()) == edges.end()) {
481 iter->edge = find(edges.begin(), edges.end(), &iter->lane->getEdge());
537 if (!rem->first->notifyMove(*
this, oldPos + rem->second, newPos + rem->second, newSpeed)) {
539 if (myTraceMoveReminders) {
540 traceMoveReminder(
"notifyMove", rem->first, rem->second,
false);
546 if (myTraceMoveReminders) {
547 traceMoveReminder(
"notifyMove", rem->first, rem->second,
true);
562 rem->second += oldLaneLength;
564 if (myTraceMoveReminders) {
565 traceMoveReminder(
"adaptedPos", rem->first, rem->second,
true);
587 if (offset == 0. && !changingLanes) {
610 atan2(p1.
x() - p2.
x(), p2.
y() - p1.
y()) * 180. /
PI :
631 if (stop.
until != -1) {
632 stop.
until += untilOffset;
644 std::list<Stop>::iterator iter =
myStops.begin();
647 prevStopEdge =
myStops.back().edge;
648 prevStopPos =
myStops.back().endPos;
654 while (iter !=
myStops.end() && (iter->edge < stop.
edge ||
655 (iter->endPos < stop.
endPos && iter->edge == stop.
edge))) {
656 prevStopEdge = iter->edge;
657 prevStopPos = iter->endPos;
661 int index = stopPar.
index;
663 prevStopEdge = iter->edge;
664 prevStopPos = iter->endPos;
672 (prevStopEdge == stop.
edge && prevStopPos > stop.
endPos)) {
685 pos += (*myCurrEdge)->getLength();
722 return currentVelocity;
733 for (std::vector<MSPerson*>::const_iterator i = persons.begin(); i != persons.end(); ++i) {
775 bool busStopsMustHaveSpace =
true;
780 busStopsMustHaveSpace =
false;
789 if (stop.
until >= 0) {
805 return currentVelocity;
819 #ifdef DEBUG_VEHICLE_GUI_SELECTION
825 for (DriveItemVector::iterator i = lfLinks.begin(); i != lfLinks.end(); ++i) {
826 if ((*i).myLink != 0) {
827 (*i).myLink->removeApproaching(
this);
831 #ifdef HAVE_INTERNAL_LANES
832 myLinkLeaders.clear();
854 assert(bestLaneConts.size() > 0);
855 #ifdef HAVE_INTERNAL_LANES
856 bool hadNonInternal =
false;
858 bool hadNonInternal =
true;
863 unsigned int view = 0;
873 std::pair<const MSVehicle*, SUMOReal> leaderInfo = std::make_pair(pred, gap);
879 adaptToLeader(leaderInfo, seen, lastLink, lane, v, vLinkPass);
890 v =
MIN2(v, stopSpeed);
897 MSLinkCont::const_iterator link =
myLane->
succLinkSec(*
this, view + 1, *lane, bestLaneConts);
936 (*link)->getViaLaneOrLane()->getParallelLane(-
getLaneChangeModel().getLaneChangeDirection()) == 0)) {
938 const SUMOReal va = seen / timeRemaining;
946 const bool setRequest = v > 0;
956 #ifdef HAVE_INTERNAL_LANES
959 for (MSLink::LinkLeaders::const_iterator it = linkLeaders.begin(); it != linkLeaders.end(); ++it) {
962 if (leader->myLinkLeaders.count(
getID()) == 0) {
964 myLinkLeaders.insert(leader->
getID());
981 if (!(*link)->havePriority() && stopDist > cfModel.
getMaxDecel()) {
987 + (seen - (v1 * v1 - arrivalSpeed * arrivalSpeed) * 0.5 / cfModel.
getMaxDecel()) / vLinkWait);
990 const SUMOReal accelTime = (vLinkPass - v) / accel;
991 const SUMOReal accelWay = accelTime * (vLinkPass + v) * 0.5;
1003 arrivalSpeedBraking = arrivalSpeed;
1008 arrivalSpeedBraking =
MIN2(arrivalSpeedBraking, arrivalSpeed);
1009 arrivalTimeBraking =
MAX2(arrivalTime, t +
TIME2STEPS(seen / ((v + arrivalSpeedBraking) * 0.5)));
1012 arrivalTime, arrivalSpeed,
1013 arrivalTimeBraking, arrivalSpeedBraking,
1016 #ifdef HAVE_INTERNAL_LANES
1017 if ((*link)->getViaLane() == 0) {
1018 hadNonInternal =
true;
1025 if (!setRequest || ((v <= 0 || seen > dist) && hadNonInternal && seenNonInternal > vehicleLength *
CRLL_LOOK_AHEAD)) {
1029 lane = (*link)->getViaLaneOrLane();
1041 lastLink = &lfLinks.back();
1051 if (leaderInfo.first != 0) {
1054 if (leaderInfo.second >= 0) {
1055 vsafeLeader = cfModel.
followSpeed(
this,
getSpeed(), leaderInfo.second, leaderInfo.first->getSpeed(), leaderInfo.first->getCarFollowModel().getMaxDecel());
1061 if (lastLink != 0) {
1064 v =
MIN2(v, vsafeLeader);
1065 vLinkPass =
MIN2(vLinkPass, vsafeLeader);
1072 #ifdef DEBUG_VEHICLE_GUI_SELECTION
1093 DriveItemVector::iterator i;
1094 bool braking =
false;
1095 bool lastWasGreenCont =
false;
1097 MSLink* link = (*i).myLink;
1099 if (link != 0 && (*i).mySetRequest) {
1105 vSafe = (*i).myVLinkWait;
1107 lastWasGreenCont =
false;
1112 const bool opened = yellow || link->
opened((*i).myArrivalTime, (*i).myArrivalSpeed, (*i).getLeaveSpeed(),
1115 if (opened && !lastWasGreenCont && !link->
havePriority()) {
1117 vSafe = (*i).myVLinkWait;
1119 lastWasGreenCont =
false;
1137 vSafe = (*i).myVLinkPass;
1144 lastWasGreenCont =
false;
1145 vSafe = (*i).myVLinkWait;
1153 vSafe = (*i).myVLinkWait;
1209 std::vector<MSLane*> passedLanes;
1211 passedLanes.push_back(*i);
1213 if (passedLanes.size() == 0 || passedLanes.back() !=
myLane) {
1214 passedLanes.push_back(
myLane);
1229 MSLink* link = (*i).myLink;
1239 if (approachedLane !=
myLane && approachedLane != 0) {
1247 WRITE_WARNING(
"Vehicle '" +
getID() +
"' could not finish continuous lane change (turn lane) time=" +
1258 passedLanes.push_back(approachedLane);
1264 (*i)->resetPartialOccupation(
this);
1284 std::vector<MSLane*>::reverse_iterator i = passedLanes.rbegin() + 1;
1285 while (leftLength > 0 && i != passedLanes.rend()) {
1287 leftLength -= (*i)->setPartialOccupation(
this, leftLength);
1309 for (MSLane::VehCont::const_iterator i = vehs.begin(); i != vehs.end(); ++i) {
1311 foundStopped =
true;
1312 const SUMOReal ret = (*i)->getPositionOnLane() - (*i)->getVehicleType().getLengthWithGap() - lengths;
1316 lengths += (*i)->getVehicleType().getLengthWithGap();
1325 #ifdef DEBUG_VEHICLE_GUI_SELECTION
1333 #ifdef HAVE_INTERNAL_LANES
1335 bool hadVehicle =
false;
1336 SUMOReal seenSpace = -lengthsInFront;
1338 bool foundStopped =
false;
1341 for (
unsigned int i = 0; i < lfLinks.size(); ++i) {
1344 if (item.
myLink == 0 || foundStopped) {
1350 const MSLane* approachedLane = item.
myLink->getViaLane();
1351 if (approachedLane != 0) {
1375 foundStopped =
true;
1378 seenSpace += approachedLane->
getLength();
1392 foundStopped =
true;
1400 #ifdef DEBUG_VEHICLE_GUI_SELECTION
1406 for (
int i = (
int)(lfLinks.size() - 1); i > 0; --i) {
1412 bool allowsContinuation = item.
myLink == 0 || item.
myLink->
isCont() || !lfLinks[i].hadVehicle || opened;
1413 if (!opened && item.
myLink != 0) {
1417 allowsContinuation =
true;
1421 if (allowsContinuation) {
1427 int removalBegin = -1;
1428 for (
unsigned int i = 0; hadVehicle && i < lfLinks.size() && removalBegin < 0; ++i) {
1442 if (leftSpace < 0/* && item.myLink->willHaveBlockedFoe()*/) {
1449 if (leftSpace < -impatienceCorrection / 10. && item.myLink->isCrossing()) {
1457 while (removalBegin < (
int)(lfLinks.size())) {
1459 lfLinks[removalBegin].myVLinkPass = lfLinks[removalBegin].myVLinkWait;
1461 lfLinks[removalBegin].mySetRequest =
false;
1470 for (DriveItemVector::iterator i = lfLinks.begin(); i != lfLinks.end(); ++i) {
1471 if ((*i).myLink != 0) {
1475 (*i).myLink->setApproaching(
this, (*i).myArrivalTime, (*i).myArrivalSpeed, (*i).getLeaveSpeed(),
1476 (*i).mySetRequest, (*i).myArrivalTimeBraking, (*i).myArrivalSpeedBraking,
getWaitingTime());
1485 if (rem->first->getLane() != 0 && rem->first->getLane() !=
getLane()) {
1487 if (myTraceMoveReminders) {
1488 traceMoveReminder(
"notifyEnter_skipped", rem->first, rem->second,
true);
1493 if (rem->first->notifyEnter(*
this, reason)) {
1495 if (myTraceMoveReminders) {
1496 traceMoveReminder(
"notifyEnter", rem->first, rem->second,
true);
1502 if (myTraceMoveReminders) {
1503 traceMoveReminder(
"notifyEnter", rem->first, rem->second,
false);
1533 if (!onTeleporting) {
1569 while (i != route.
begin() && leftLength > 0) {
1576 leftLength -= (lane)->setPartialOccupation(
this, leftLength);
1617 MSLane* clane = enteredLane;
1618 while (leftLength > 0) {
1624 leftLength -= (clane)->setPartialOccupation(
this, leftLength);
1632 if (rem->first->notifyLeave(*
this,
myState.
myPos + rem->second, reason)) {
1634 if (myTraceMoveReminders) {
1635 traceMoveReminder(
"notifyLeave", rem->first, rem->second,
true);
1641 if (myTraceMoveReminders) {
1642 traceMoveReminder(
"notifyLeave", rem->first, rem->second,
false);
1650 (*i)->resetPartialOccupation(
this);
1672 const std::vector<MSVehicle::LaneQ>&
1674 #ifdef DEBUG_VEHICLE_GUI_SELECTION
1681 if (startLane == 0) {
1684 assert(startLane != 0);
1687 std::vector<LaneQ>::iterator i;
1688 for (i = lanes.begin(); i != lanes.end(); ++i) {
1690 for (std::vector<MSLane*>::const_iterator j = (*i).bestContinuations.begin() + 1; j != (*i).bestContinuations.end(); ++j) {
1691 nextOccupation += (*j)->getBruttoVehLenSum();
1693 (*i).nextOccupation = nextOccupation;
1694 if ((*i).lane == startLane) {
1713 std::vector<LaneQ>& lanes = *it;
1714 assert(lanes.size() > 0);
1715 if (&(lanes[0].lane->getEdge()) == nextEdge) {
1717 std::vector<LaneQ> oldLanes = lanes;
1719 const std::vector<MSLane*>& sourceLanes = startLane->
getEdge().
getLanes();
1720 for (std::vector<MSLane*>::const_iterator it_source = sourceLanes.begin(); it_source != sourceLanes.end(); ++it_source) {
1721 for (std::vector<LaneQ>::iterator it_lane = oldLanes.begin(); it_lane != oldLanes.end(); ++it_lane) {
1722 if ((*it_source)->getLinkCont()[0]->getLane() == (*it_lane).lane) {
1723 lanes.push_back(*it_lane);
1730 for (
int i = 0; i < (
int)lanes.size(); ++i) {
1731 if (i + lanes[i].bestLaneOffset < 0) {
1732 lanes[i].bestLaneOffset = -i;
1734 if (i + lanes[i].bestLaneOffset >= (
int)lanes.size()) {
1735 lanes[i].bestLaneOffset = (
int)lanes.size() - i - 1;
1737 assert(i + lanes[i].bestLaneOffset >= 0);
1738 assert(i + lanes[i].bestLaneOffset < (
int)lanes.size());
1739 if (lanes[i].bestContinuations[0] != 0) {
1741 lanes[i].bestContinuations.insert(lanes[i].bestContinuations.begin(), (
MSLane*)0);
1743 if (startLane->
getLinkCont()[0]->getLane() == lanes[i].lane) {
1746 assert(&(lanes[i].lane->getEdge()) == nextEdge);
1758 myLastBestLanesEdge = &startLane->
getEdge();
1762 const MSEdge* nextStopEdge = 0;
1763 const MSLane* nextStopLane = 0;
1767 nextStopLane = nextStop.
lane;
1768 nextStopEdge = &nextStopLane->
getEdge();
1776 if (nextStopEdge != 0) {
1785 bool progress =
true;
1787 std::vector<LaneQ> currentLanes;
1788 const std::vector<MSLane*>* allowed = 0;
1789 const MSEdge* nextEdge = 0;
1791 nextEdge = *(ce + 1);
1794 const std::vector<MSLane*>& lanes = (*ce)->getLanes();
1795 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
1802 q.
allowsContinuation = allowed == 0 || find(allowed->begin(), allowed->end(), cl) != allowed->end();
1803 currentLanes.push_back(q);
1806 if (nextStopEdge == *ce) {
1808 for (std::vector<LaneQ>::iterator q = currentLanes.begin(); q != currentLanes.end(); ++q) {
1809 if (nextStopLane != 0 && nextStopLane != (*q).lane) {
1810 (*q).allowsContinuation =
false;
1811 (*q).length = nextStopPos;
1818 seenLength += currentLanes[0].lane->getLength();
1820 progress &= (seen <= 4 || seenLength < 3000);
1821 progress &= seen <= 8;
1833 int bestThisIndex = 0;
1836 for (std::vector<LaneQ>::iterator j = last.begin(); j != last.end(); ++j, ++index) {
1837 if ((*j).length > bestLength) {
1838 bestLength = (*j).length;
1839 bestThisIndex = index;
1843 for (std::vector<LaneQ>::iterator j = last.begin(); j != last.end(); ++j, ++index) {
1844 if ((*j).length < bestLength) {
1845 (*j).bestLaneOffset = bestThisIndex - index;
1852 for (std::vector<std::vector<LaneQ> >::reverse_iterator i =
myBestLanes.rbegin() + 1; i !=
myBestLanes.rend(); ++i) {
1853 std::vector<LaneQ>& nextLanes = (*(i - 1));
1854 std::vector<LaneQ>& clanes = (*i);
1855 MSEdge& cE = clanes[0].lane->getEdge();
1859 for (std::vector<LaneQ>::iterator j = nextLanes.begin(); j != nextLanes.end(); ++j, ++index) {
1860 if ((*j).lane->isApproachedFrom(&cE) && bestConnectedLength < (*j).length) {
1861 bestConnectedLength = (*j).length;
1863 if (bestLength < (*j).length) {
1864 bestLength = (*j).length;
1868 int bestThisIndex = 0;
1869 if (bestConnectedLength > 0) {
1871 for (std::vector<LaneQ>::iterator j = clanes.begin(); j != clanes.end(); ++j, ++index) {
1872 LaneQ bestConnectedNext;
1873 bestConnectedNext.
length = -1;
1874 if ((*j).allowsContinuation) {
1875 for (std::vector<LaneQ>::const_iterator m = nextLanes.begin(); m != nextLanes.end(); ++m) {
1876 if ((*m).lane->isApproachedFrom(&cE, (*j).lane)) {
1877 if (bestConnectedNext.
length < (*m).length || (bestConnectedNext.
length == (*m).length &&
abs(bestConnectedNext.
bestLaneOffset) >
abs((*m).bestLaneOffset))) {
1878 bestConnectedNext = *m;
1883 (*j).
length += bestLength;
1885 (*j).length += bestConnectedNext.
length;
1889 if (clanes[bestThisIndex].length < (*j).length || (clanes[bestThisIndex].length == (*j).length &&
abs(clanes[bestThisIndex].bestLaneOffset) >
abs((*j).bestLaneOffset))) {
1890 bestThisIndex = index;
1896 int bestNextIndex = 0;
1897 int bestDistToNeeded = (
int) clanes.size();
1899 for (std::vector<LaneQ>::iterator j = clanes.begin(); j != clanes.end(); ++j, ++index) {
1900 if ((*j).allowsContinuation) {
1902 for (std::vector<LaneQ>::const_iterator m = nextLanes.begin(); m != nextLanes.end(); ++m, ++nextIndex) {
1903 if ((*m).lane->isApproachedFrom(&cE, (*j).lane)) {
1904 if (bestDistToNeeded >
abs((*m).bestLaneOffset)) {
1905 bestDistToNeeded =
abs((*m).bestLaneOffset);
1906 bestThisIndex = index;
1907 bestNextIndex = nextIndex;
1913 clanes[bestThisIndex].length += nextLanes[bestNextIndex].length;
1914 copy(nextLanes[bestNextIndex].bestContinuations.begin(), nextLanes[bestNextIndex].bestContinuations.end(), back_inserter(clanes[bestThisIndex].bestContinuations));
1919 for (std::vector<LaneQ>::iterator j = clanes.begin(); j != clanes.end(); ++j, ++index) {
1920 if ((*j).length < clanes[bestThisIndex].length || ((*j).length == clanes[bestThisIndex].length &&
abs((*j).bestLaneOffset) >
abs(clanes[bestThisIndex].bestLaneOffset))) {
1921 (*j).bestLaneOffset = bestThisIndex - index;
1923 (*j).bestLaneOffset = 0;
1929 std::vector<LaneQ>& currLanes = *
myBestLanes.begin();
1930 std::vector<LaneQ>::iterator i;
1931 for (i = currLanes.begin(); i != currLanes.end(); ++i) {
1933 for (std::vector<MSLane*>::const_iterator j = (*i).bestContinuations.begin() + 1; j != (*i).bestContinuations.end(); ++j) {
1934 nextOccupation += (*j)->getBruttoVehLenSum();
1936 (*i).nextOccupation = nextOccupation;
1937 if ((*i).lane == startLane) {
1945 const std::vector<MSLane*>&
1950 return (*myCurrentLaneInBestLanes).bestContinuations;
1954 const std::vector<MSLane*>&
1965 if ((*i).lane == lane) {
1966 return (*i).bestContinuations;
1978 return (*myCurrentLaneInBestLanes).bestLaneOffset;
1996 #ifdef DEBUG_VEHICLE_GUI_SELECTION
2001 if (
isOnRoad() && destEdge != NULL) {
2065 unsigned int numExpected = (
unsigned int)
myStops.front().awaitedPersons.size();
2066 if (numExpected != 0) {
2071 numExpected = (
unsigned int)
myStops.front().awaitedPersons.size();
2073 if (numExpected == 0) {
2099 switch ((*link)->getDirection()) {
2144 for (std::list<Stop>::iterator iter =
myStops.begin(); iter !=
myStops.end(); iter++) {
2145 if (iter->lane == lane && fabs(iter->endPos - pos) <
POSITION_EPS) {
2146 if (duration == 0 && !iter->reached) {
2149 iter->duration = duration;
2222 std::vector<int> internals;
2235 throw ProcessError(
"Error: Invalid vehicles in state (may be a meso state)!");
2237 unsigned int routeOffset;
2242 myDeparture -= offset;
void resetRoutePosition(unsigned int index)
bool signalSet(int which) const
Returns whether the given signal is on.
static SUMOReal computeCO(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted CO given the vehicle type and state (in mg/s)
const MSLane * myLastBestLanesInternalLane
The link is a partial left direction.
const std::string & getID() const
returns the person id
The link has green light, may pass.
virtual const std::vector< LaneQ > & getBestLanes(bool forceRebuild=false, MSLane *startLane=0) const
Returns the description of best lanes to use in order to continue the route.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
const MSVehicleType * myType
This Vehicle's type.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
SUMOReal getSpeedAfterMaxDecel(SUMOReal v) const
Returns the velocity after maximum deceleration.
void addWaiting(const MSEdge *const edge, SUMOVehicle *vehicle)
bool enterLaneAtMove(MSLane *enteredLane, bool onTeleporting=false)
Update when the vehicle enters a new lane in the move step.
MSEdge & getEdge() const
Returns the lane's edge.
Representation of a vehicle in the micro simulation.
bool isLinkEnd(MSLinkCont::const_iterator &i) const
SUMOReal getMaxSpeed() const
Get vehicle's maximum speed [m/s].
bool amVehicleSpecific() const
Returns whether this type belongs to a single vehicle only (was modified)
SUMOReal speed() const
Speed of this state.
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
void removePerson(MSPerson *p)
const SUMOReal SUMO_const_laneWidth
MSEdgeWeightsStorage * myEdgeWeights
MoveReminderCont myMoveReminders
Current lane's move reminder.
SUMOReal myArrivalPos
the position on the destination lane where the vehicle stops
static SUMOReal computeHC(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted HC given the vehicle type and state (in mg/s)
SUMOReal getHBEFA_HCEmissions() const
Returns HC emission of the current state.
const MSEdge * myLastBestLanesEdge
LaneChangeMode
modes for resolving conflicts between external control (traci) and vehicle control over lane changing...
MSAbstractLaneChangeModel * myLaneChangeModel
bool myAmOnNet
Whether the vehicle is on the network (not parking, teleported, vaporized, or arrived) ...
SUMOReal getImpatience() const
Returns this vehicles impatience.
Position positionAtOffset(SUMOReal pos) const
Returns the position at the given length.
std::vector< std::vector< LaneQ > > myBestLanes
bool parking
whether the vehicle is removed from the net while stopping
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
State myState
This Vehicles driving state (pos and speed)
bool isChangingLanes() const
return true if the vehicle currently performs a lane change maneuver
void endLaneChangeManeuver()
bool boardAnyWaiting(MSEdge *edge, MSVehicle *vehicle)
board any applicable persons Boards any people who wait on that edge for the given vehicle and remove...
const Position geometryPositionAtOffset(SUMOReal offset) const
DriveItemVector myLFLinkLanes
Container for used Links/visited Lanes during lookForward.
SUMOReal pos() const
Position of this state.
bool resumeFromStopping()
bool myAmRegisteredAsWaitingForPerson
Whether this vehicle is registered as waiting for a person (for deadlock-recognition) ...
bool hasInfluencer() const
SUMOTime duration
The stopping duration.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
The action is done to help someone else.
SUMOReal getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
int bestLaneOffset
The (signed) number of lanes to be crossed to get to the lane which allows to continue the drive...
void setBlinkerInformation()
SUMOReal getHBEFA_NOxEmissions() const
Returns NOx emission of the current state.
SUMOReal getLeaveSpeed() const
SUMOReal myAcceleration
The current acceleration after dawdling in m/s.
MSEdgeVector::const_iterator MSRouteIterator
SUMOReal getSpeedWithoutTraciInfluence() const
Returns the uninfluenced velocity.
The vehicle arrived at a junction.
std::vector< std::pair< MSVehicle *, SUMOReal > > LinkLeaders
bool isVTDControlled() const
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
virtual SUMOReal followSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const =0
Computes the vehicle's safe speed (no dawdling)
This is an uncontrolled, minor link, has to stop.
SUMOReal getLength() const
Returns the lane's length.
Position getPosition(const SUMOReal offset=0) const
Return current position (x/y, cartesian)
SUMOReal departSpeed
(optional) The initial speed of the vehicle
virtual SUMOReal maxNextSpeed(SUMOReal speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
bool hasArrived() const
Returns whether this vehicle has already arived (reached the arrivalPosition on its final edge) ...
static MSDevice_Person * buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into)
Build devices for the given vehicle, if needed.
The car-following model abstraction.
virtual MSLinkCont::const_iterator succLinkSec(const SUMOVehicle &veh, unsigned int nRouteSuccs, const MSLane &succLinkSource, const std::vector< MSLane * > &conts) const
SUMOReal arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
The link is a 180 degree turn.
State(SUMOReal pos, SUMOReal speed)
Constructor.
std::vector< MSVehicle * > VehCont
Container for vehicles.
Notification
Definition of a vehicle state.
static SUMOReal rand()
Returns a random real number in [0, 1)
std::string time2string(SUMOTime t)
SUMOReal getLength() const
Get vehicle's length [m].
Changes the wished vehicle speed / lanes.
const MSEdgeVector & getEdges() const
bool reached
Information whether the stop has been reached.
bool replaceRouteEdges(const MSEdgeVector &edges, bool onInit=false)
Replaces the current route by the given edges.
State & operator=(const State &state)
Assignment operator.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const MSRoute & getRoute() const
Returns the current route.
vehicle doesn't want to change
unsigned int getPersonNumber() const
Returns the number of persons.
TraciLaneChangePriority
modes for prioritizing traci lane change requests
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
const MSRoute * myRoute
This Vehicle's route.
unsigned int myNumberReroutes
The number of reroutings.
bool hasDeparted() const
Returns whether this vehicle has already departed.
The vehicle got vaporized.
void postProcessVTD(MSVehicle *v)
SUMOReal estimateLeaveSpeed(const MSLink *const link, const SUMOReal vLinkPass) const
estimate leaving speed when accelerating across a link
SUMOTime until
The time at which the vehicle may continue its journey.
SUMOReal mySpeed
the stored speed
Definition of vehicle stop (position and duration)
This is an uncontrolled, right-before-left link.
void removeWaiting(const MSEdge *const edge, SUMOVehicle *vehicle)
unsigned int personNumber
The number of persons in the vehicle.
LinkDirection getDirection() const
Returns the direction the vehicle passing this link take.
bool executeMove()
Executes planned vehicle movements with regards to right-of-way.
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
SUMOReal getPositionOnLane() const
Get the vehicle's position along the lane.
const SUMOVehicleParameter * myParameter
This Vehicle's parameter.
SUMOReal getDistanceBetween(SUMOReal fromPos, SUMOReal toPos, const MSEdge *fromEdge, const MSEdge *toEdge) const
Compute the distance between 2 given edges on this route, including the length of internal lanes...
const std::vector< SUMOVehicleParameter::Stop > & getStops() const
Returns the stops.
The base class for microscopic and mesoscopic vehicles.
bool myHaveToWaitOnNextLink
SUMOReal processNextStop(SUMOReal currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
The action is due to a TraCI request.
A storage for edge travel times and efforts.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step (in s)
SUMOReal x() const
Returns the x-position.
This is an uncontrolled, all-way stop link.
SUMOReal length
The overall length which may be driven when using this lane without a lane change.
SUMOReal getBruttoVehLenSum() const
Returns the sum of lengths of vehicles, including their minGaps, which were on the lane during the la...
The action is urgent (to be defined by lc-model)
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
#define UNUSED_PARAMETER(x)
std::string getBusStopID(const MSLane *lane, const SUMOReal pos) const
Returns the bus stop close to the given position.
int influenceChangeDecision(const SUMOTime currentTime, const MSEdge ¤tEdge, const unsigned int currentLaneIndex, int state)
Applies stored LaneChangeMode information and laneTimeLine.
void enterLaneAtLaneChange(MSLane *enteredLane)
Update when the vehicle enters a new lane in the laneChange step.
The link is a (hard) left direction.
#define WRITE_WARNING(msg)
SUMOReal getBeginLanePosition() const
Returns the begin position of this bus stop.
The car-following model and parameter.
bool triggered
whether an arriving person lets the vehicle continue
virtual void saveState(OutputDevice &out)
Saves the (common) state of a vehicle.
MSAbstractLaneChangeModel & getLaneChangeModel()
MSCFModel::VehicleVariables * myCFVariables
The per vehicle variables of the car following model.
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
Right blinker lights are switched on.
std::vector< Stop > stops
List of the stops the vehicle will make.
SUMOReal getPartialOccupatorEnd() const
Returns the position of the in-lapping vehicle's end.
void enter(SUMOVehicle *what, SUMOReal beg, SUMOReal end)
Called if a vehicle enters this stop.
The vehicles starts to stop.
void enterLaneAtInsertion(MSLane *enteredLane, SUMOReal pos, SUMOReal speed, MSMoveReminder::Notification notification)
Update when the vehicle enters a new lane in the emit step.
static SUMOReal computeNoise(SUMOEmissionClass c, double v, double a)
Returns the noise produced by the a vehicle of the given type at the given speed. ...
std::string busstop
(Optional) bus stop if one is assigned to the stop
SUMOReal influenceSpeed(SUMOTime currentTime, SUMOReal speed, SUMOReal vSafe, SUMOReal vMin, SUMOReal vMax)
Applies stored velocity information on the speed to use.
bool operator!=(const State &state)
Operator !=.
const std::string & getID() const
Returns the id.
A road/street connecting two junctions.
The vehicle changes lanes (micro only)
Position getPositionAtDistance(SUMOReal offset) const
MSLane * lane
The described lane.
void checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector &lfLinks) const
SUMOReal getLength() const
return the length of the edge
Left blinker lights are switched on.
MSLane * getLogicalPredecessorLane() const
void continueLaneChangeManeuver(bool moved)
SUMOReal getHBEFA_COEmissions() const
Returns CO emission of the current state.
SUMOReal brakeGap(const SUMOReal speed) const
Returns the distance the vehicle needs to halt including driver's reaction time.
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
SUMOReal getSpeedDeviation() const
Returns this type's speed deviation.
SUMOReal startPos
The stopping position start.
The vehicle got a new route.
void workOnMoveReminders(SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Processes active move reminder.
vehicle want's to change to right lane
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification)
remove the vehicle from this lane
bool addTraciStop(MSLane *lane, SUMOReal pos, SUMOReal radius, SUMOTime duration, bool parking, bool triggered)
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
Encapsulated SAX-Attributes.
SUMOReal getMinGap() const
Get the free space in front of vehicles of this class.
std::vector< const MSEdge * > MSEdgeVector
bool replaceRoute(const MSRoute *route, bool onInit=false)
Replaces the current route by the given one.
void setLaneTimeLine(const std::vector< std::pair< SUMOTime, unsigned int > > &laneTimeLine)
Sets a new lane timeline.
ChangeRequest
Requests set via TraCI.
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the subpart of best lanes that describes the vehicle's current lane and their successors...
A point in 2D or 3D with translation and scaling methods.
SUMOReal endPos
The stopping position end.
MSLane * getLane() const
Returns the connected lane.
bool willPass(const MSEdge *const edge) const
Returns whether the vehicle wil pass the given edge.
void addPerson(MSPerson *person)
Add a passenger.
static void clear()
Clears the dictionary.
virtual SUMOReal getFloat(int id) const =0
Returns the SUMOReal-value of the named (by its enum-value) attribute.
Position myCachedPosition
static SUMOReal computeCO2(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted CO2 given the vehicle type and state (in mg/s)
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
const MSLane * lane
The lane to stop at.
static SUMOReal gap(SUMOReal predPos, SUMOReal predLength, SUMOReal pos)
Uses the given values to compute the brutto-gap.
bool triggered
whether an arriving person lets the vehicle continue
std::list< Stop > myStops
The vehicle's list of stops.
bool contains(const MSEdge *const edge) const
bool isStopped() const
Returns whether the vehicle is at a stop.
std::pair< MSVehicle *, SUMOReal > getLastVehicleInformation() const
Returns the last vehicle which is still on the lane.
int arrivalLane
(optional) The lane the vehicle shall arrive on (not used yet)
void adaptLeaveSpeed(const SUMOReal v)
MSLane * myLane
The lane the vehicle is on.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
Influencer * myInfluencer
An instance of a velicty/lane influencing instance; built in "getInfluencer".
std::vector< LaneQ >::iterator myCurrentLaneInBestLanes
SUMOReal getSpaceTillLastStanding(const MSLane *l, bool &foundStopped) const
SUMOTime duration
The stopping duration.
bool isRoundabout() const
MSVehicle()
invalidated default constructor
bool isVaporizing() const
Returns whether vehicles on this edge shall be vaporized.
The link is a (hard) right direction.
SUMOReal getHBEFA_PMxEmissions() const
Returns PMx emission of the current state.
virtual SUMOReal stopSpeed(const MSVehicle *const veh, const SUMOReal speed, SUMOReal gap2pred) const =0
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling) ...
SUMOReal getSpeedLimit() const
Returns the lane's maximum allowed speed.
SUMOReal estimateSpeedAfterDistance(const SUMOReal dist, const SUMOReal v, const SUMOReal accel) const
A structure representing the best lanes for continuing the route.
void loadState(const SUMOSAXAttributes &attrs, const SUMOTime offset)
Loads the state of this vehicle from the given description.
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
const std::vector< MSPerson * > & getPersons() const
Returns the list of persons using this vehicle.
static MTRand myVehicleParamsRNG
A random number generator used to choose from vtype/route distributions and computing the speed facto...
SUMOReal getMaxDecel() const
Get the vehicle type's maximum deceleration [m/s^2].
MSBusStop * getBusStop(const std::string &id) const
Returns the named bus stop.
SUMOReal changeRequestRemainingSeconds(const SUMOTime currentTime) const
Return the remaining number of seconds of the current laneTimeLine assuming one exists.
virtual MSVehicle * getLastVehicle() const
returns the last vehicle
void leaveFrom(SUMOVehicle *what)
Called if a vehicle leaves this stop.
MSLane * getShadowLane() const
Returns the lane the vehicles shadow is on during continuouss lane change.
bool addStop(const SUMOVehicleParameter::Stop &stopPar, SUMOTime untilOffset=0)
Adds a stop.
SUMOTime myWaitingTime
The time the vehicle waits (is not faster than 0.1m/s) in seconds.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
The link is a partial right direction.
SUMOReal computeChosenSpeedDeviation(MTRand &rng, const SUMOReal minDevFactor=0.2) const
Computes and returns the speed deviation.
virtual SUMOReal getHeadwayTime() const
Get the driver's reaction time [s].
void addReference() const
increments the reference counter for the route
bool isParking() const
Returns whether the vehicle is parking.
SUMOReal getLaneChangeCompletion() const
return whether the vehicle passed the midpoint of a continuous lane change maneuver ...
bool allowsContinuation
Whether this lane allows to continue the drive.
SUMOReal getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
Container that holds the vehicles driving state (position+speed).
void unregisterOneWaitingForPerson()
decreases the count of vehicles waiting for a person to allow recogniztion of person related deadlock...
void registerOneWaitingForPerson()
increases the count of vehicles waiting for a person to allow recogniztion of person related deadlock...
void saveState(OutputDevice &out)
Saves the states of a vehicle.
void planMoveInternal(const SUMOTime t, const MSVehicle *pred, DriveItemVector &lfLinks) const
SUMOReal getOriginalSpeed() const
Returns the originally longitudinal speed to use.
std::string lane
The lane to stop at.
SUMOReal getHBEFA_FuelConsumption() const
Returns fuel consumption of the current state.
SUMOReal getLastFreePos(const SUMOVehicle &forVehicle) const
Returns the last free position on this stop.
MSEdgeWeightsStorage & _getWeightsStorage() const
void leaveLane(const MSMoveReminder::Notification reason)
Update of members if vehicle leaves a new lane in the lane change step or at arrival.
SUMOReal getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
unsigned int getVehicleNumber() const
Returns the number of vehicles on this lane.
SUMOReal getSpeedFactor() const
Returns this type's speed factor.
SUMOReal rotationDegreeAtOffset(SUMOReal pos) const
Returns the rotation at the given length.
const std::vector< MSLane * > * allowedLanes(const MSEdge &destination, SUMOVehicleClass vclass=SVC_UNKNOWN) const
Get the allowed lanes to reach the destination-edge.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
vehicle want's to change to left lane
The action is needed to follow the route (navigational lc)
SUMOReal myChosenSpeedFactor
A precomputed factor by which the driver wants to be faster than the speed limit. ...
void setSpeedTimeLine(const std::vector< std::pair< SUMOTime, SUMOReal > > &speedTimeLine)
Sets a new velocity timeline.
EdgeBasicFunction getPurpose() const
Returns the edge type (EdgeBasicFunction)
LaneChangeModel getLaneChangeModel() const
Influencer & getInfluencer()
Returns the velocity/lane influencer.
Structure representing possible vehicle parameter.
virtual SUMOReal freeSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal seen, SUMOReal maxSpeed) const
Computes the vehicle's safe speed without a leader.
bool havePriority() const
Returns whether this link is a major link.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
virtual VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting...
virtual MSPersonControl & getPersonControl()
Returns the person control.
The link has yellow light, may pass.
void setConsiderMaxDeceleration(bool value)
Sets whether the maximum deceleration shall be regarded.
bool fixPosition()
repair errors in vehicle position after changing between internal edges
bool isLaneChangeMidpointPassed() const
return whether the vehicle passed the midpoint of a continuous lane change maneuver ...
MSLane * getViaLaneOrLane() const
return the via lane if it exists and the lane otherwise
int mySignals
State of things of the vehicle that can be on or off.
std::vector< MSLane * > bestContinuations
Consecutive lane that can be followed without a lane change (contribute to length and occupation) ...
SUMOReal interpolateLanePosToGeometryPos(SUMOReal lanePos) const
Definition of vehicle stop (position and duration)
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
SUMOReal y() const
Returns the y-position.
The action is due to the default of keeping right "Rechtsfahrgebot".
The link has red light (must brake)
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
SUMOTime until
The time at which the vehicle may continue its journey.
void setConsiderSafeVelocity(bool value)
Sets whether the safe velocity shall be regarded.
int index
at which position in the stops list
void calculateArrivalPos()
(Re-)Calculates the arrival position from the vehicle parameters
static SUMOReal computeNOx(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted NOx given the vehicle type and state (in mg/s)
MSRouteIterator edge
The edge in the route to stop at.
SUMOReal getDistanceToPosition(SUMOReal destPos, const MSEdge *destEdge)
const SUMOReal SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
The arrival lane is given.
Needs to stay on the current lane.
const std::string & getID() const
Returns the name of the vehicle type.
The vehicle ends to stop.
SUMOReal getSpeed() const
Returns the vehicle's current speed.
void resetMoved()
reset the flag whether a vehicle already moved to false
static SUMOTime gTimeToGridlock
SUMOReal departPos
(optional) The position the vehicle shall depart from
void adaptToLeader(const std::pair< const MSVehicle *, SUMOReal > leaderInfo, const SUMOReal seen, DriveProcessItem *const lastLink, const MSLane *const lane, SUMOReal &v, SUMOReal &vLinkPass) const
void informVehicleStateListener(const SUMOVehicle *const vehicle, VehicleState to)
Informs all added listeners about a vehicle's state change.
bool isCrossing() const
Returns whether this link belongs to a junction where more than one edge is incoming.
void setLaneChangeMode(int value)
Sets lane changing behavior.
SUMOReal myPos
the stored position
virtual void prepareStep()
MSBusStop * busstop
(Optional) bus stop if one is assigned to the stop
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
std::vector< DriveProcessItem > DriveItemVector
static SUMOReal computeFuel(SUMOEmissionClass c, double v, double a)
Returns the amount of consumed fuel given the vehicle type and state (in ml/s)
void planMove(const SUMOTime t, const MSVehicle *pred, const SUMOReal lengthsInFront)
Compute safe velocities for the upcoming lanes based on positions and speeds from the last time step...
const PositionVector & getShape() const
Returns this lane's shape.
SUMOReal endPos
The stopping position end.
void move2side(SUMOReal amount)
vehicle want's to keep the current lane
LinkState getState() const
Returns the current state of the link.
bool hasValidRoute(std::string &msg) const
Validates the current route.
static SUMOReal computePMx(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted PMx given the vehicle type and state (in mg/s)
MSVehicle * getPartialOccupator() const
Returns the vehicle which laps into this lane.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
void switchOffSignal(int signal)
Switches the given signal off.
void switchOnSignal(int signal)
Switches the given signal on.
static std::vector< MSLane * > myEmptyLaneVector
void removeApproaching(const SUMOVehicle *veh)
removes the vehicle from myApproachingVehicles
MSRouteIterator myCurrEdge
Iterator to current route-edge.
virtual ~MSVehicle()
Destructor.
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
No information given; use default.
The link has yellow light, has to brake anyway.
void release() const
deletes the route if there are no further references to it
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
MSLane * getLane() const
Returns the lane the vehicle is on.
int influenceChangeDecision(int state)
allow TraCI to influence a lane change decision
void activateReminders(const MSMoveReminder::Notification reason)
"Activates" all current move reminder
The edge is an internal edge.
static SUMOTime gLaneChangeDuration
const std::vector< MSMoveReminder * > & getMoveReminders() const
Return the list of this lane's move reminders.
SUMOReal getHBEFA_CO2Emissions() const
Returns CO2 emission of the current state.
void addPerson(MSPerson *person)
Adds a passenger.
static MSAbstractLaneChangeModel * build(LaneChangeModel lcm, MSVehicle &vehicle)
Factory method for instantiating new lane changing models.
SUMOReal startPos
The stopping position start.
GUISelectedStorage gSelected
A global holder of selected objects.
void addReminder(MSMoveReminder *rem)
Adds a MoveReminder dynamically.
Representation of a lane in the micro simulation.
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle's internal edge travel times/efforts container.
std::vector< MSDevice * > myDevices
The devices this vehicle has.
void adaptLaneEntering2MoveReminder(const MSLane &enteredLane)
Adapts the vehicle's entering of a new lane.
unsigned int size() const
Return the number of passengers.
bool opened(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength, SUMOReal impatience, SUMOReal decel, SUMOTime waitingTime, std::vector< const SUMOVehicle * > *collectFoes=0) const
Returns the information whether the link may be passed.
unsigned int getRoutePosition() const
Interface for lane-change models.
MSDevice_Person * myPersonDevice
The passengers this vehicle may have.
int getBestLaneOffset() const
returns the current offset from the best lane
void setConsiderMaxAcceleration(bool value)
Sets whether the maximum acceleration shall be regarded.
SUMOTime myDeparture
The real departure time.
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
std::string id
The vehicle's id.
bool parking
whether the vehicle is removed from the net while stopping
static const Position INVALID
The vehicle is being teleported.
int getLaneChangeDirection() const
return the direction of the current lane change maneuver
SUMOReal getAngle() const
Returns the vehicle's direction in degrees.
const std::string & getID() const
Returns the name of the vehicle.
The action is due to the wish to be faster (tactical lc)
unsigned int getLaneIndex() const