42#define DEBUG_COND (vehicle->getLaneChangeModel().debugVehicle())
58 if (
myChanger.front().lane->isInternal()) {
61 if (ce != ce2 && ce->lane->getIncomingLanes().front().lane == ce2->lane->getIncomingLanes().front().lane) {
63 ce->siblings.push_back(ce2->lane->getIndex() - ce->lane->getIndex());
78 ce->ahead = ce->lane->getPartialBeyond();
79 ce->outsideBounds.clear();
95 myCandi->outsideBounds.push_back(lead);
97 myCandi->ahead.addLeader(lead,
false, 0);
104 (
myChanger.begin() + shadowLane->
getIndex())->ahead.addLeader(lead,
false, latOffset);
120#ifdef DEBUG_ACTIONSTEPS
122 std::cout <<
"\n" <<
SIMTIME <<
" CHANGE veh=" << vehicle->
getID() <<
" lane=" << vehicle->
getLane()->
getID() <<
"\n";
125 assert(vehicle->
getLane() == (*myCandi).lane);
130 myCandi->lastStopped = vehicle;
135#ifdef DEBUG_ACTIONSTEPS
137 std::cout <<
SIMTIME <<
" veh '" << vehicle->
getID() <<
"' skips regular change checks." << std::endl;
147#ifdef DEBUG_ACTIONSTEPS
159#ifdef DEBUG_ACTIONSTEPS
161 std::cout <<
"\n" <<
SIMTIME <<
" veh '" << vehicle->
getID() <<
"' plans lanechange maneuver." << std::endl;
167 for (
int i = 0; i < (int)
myChanger.size(); ++i) {
176 int sublaneIndex = 0;
179 for (
int offset : ce->siblings) {
182 if (ceSib->lane->allowsVehicleClass(vehicle->
getVClass())) {
186 sublaneIndex += ce->ahead.numSublanes();
190#ifdef DEBUG_ACTIONSTEPS
203 || traciRequestOpposite
208 if (leaders.
hasVehicles() || isOpposite || stopOpposite || traciRequestOpposite) {
211 if ((leader.first !=
nullptr || isOpposite || stopOpposite || traciRequestOpposite)
241 std::cout <<
SIMTIME <<
" veh '" << vehicle->
getID() <<
"' performing sublane change..." << std::endl;
267 std::cout <<
SIMTIME <<
" veh '" << vehicle->
getID() <<
"' aborts LC-continuation."
288 if (updatedSpeedLat) {
306 result.
dir = laneOffset;
308 (
myCandi + laneOffset)->lastBlocked = vehicle;
309 if ((
myCandi + laneOffset)->firstBlocked ==
nullptr) {
310 (
myCandi + laneOffset)->firstBlocked = vehicle;
324 if (remLatDist == 0) {
331 std::cout <<
SIMTIME <<
" vehicle '" << vehicle->
getID() <<
"' continueChangeSublane()"
332 <<
" remLatDist=" << remLatDist <<
" nextLatDist=" << nextLatDist
347 MSLane* source = from->lane;
352 std::swap(distToRightLaneBorder, distToLeftLaneBorder);
356 if (latDist > 0 && latDist > distToLeftLaneBorder) {
358 }
else if (latDist < 0 && -latDist > distToRightLaneBorder) {
365 std::cout <<
SIMTIME <<
" vehicle '" << vehicle->
getID() <<
"' latDist=" << latDist <<
" maneuverDist=" << maneuverDist
366 <<
" distRight=" << distToRightLaneBorder <<
" distLeft=" << distToLeftLaneBorder
367 <<
" dir=" << direction <<
" cDir=" << changerDirection <<
" mayChange=" <<
mayChange(changerDirection) <<
"\n";
371 to = from + changerDirection;
372 }
else if (changerDirection == 1 && source->
getOpposite() !=
nullptr) {
402 std::cout <<
SIMTIME <<
" vehicle '" << vehicle->
getID() <<
"' with maneuverDist=" << maneuverDist
404 <<
" increments lateral position by latDist=" << latDist << std::endl;
407#ifdef DEBUG_SURROUNDING
409 std::cout <<
SIMTIME <<
" vehicle '" << vehicle->
getID() <<
"'\n to->ahead=" << to->ahead.toString()
410 <<
"'\n to->aheadNext=" << to->aheadNext.toString()
415 const bool completedManeuver = fabs(maneuverDist - latDist) < NUMERICAL_EPS;
423 std::cout <<
SIMTIME <<
" vehicle '" << vehicle->
getID()
424 <<
"' completedPriorManeuver=" << completedPriorManeuver
425 <<
" completedManeuver=" << completedManeuver
429 <<
" maneuverDist=" << maneuverDist
430 <<
" latDist=" << latDist
434 if (!completedManeuver && !completedPriorManeuver && priorReason != 0 &&
436 || priorReason != reason)) {
455 if (shadowLane !=
nullptr && shadowLane != oldShadowLane
459 (
myChanger.begin() + shadowLane->
getIndex())->ahead.addLeader(vehicle,
false, latOffset);
461 if (completedManeuver) {
467 if (!changedToNewLane && targetLane !=
nullptr
474 const double latOffset = vehicle->
getLatOffset(targetLane) + actionStepDist;
475 target->ahead.addLeader(vehicle,
false, latOffset);
491 std::cout <<
SIMTIME <<
" startChangeSublane"
492 <<
" oldLane=" << from->lane->getID()
493 <<
" newLane=" << to->lane->getID()
494 <<
" shadowLane=" << (shadowLane !=
nullptr ? shadowLane->
getID() :
"NULL")
495 <<
" targetLane=" << (targetLane !=
nullptr ? targetLane->
getID() :
"NULL")
497 <<
" latDist=" << latDist
500 <<
" laneA=" <<
RAD2DEG(laneAngle)
503 <<
" changedToNewLane=" << changedToNewLane
507 vehicle->
setAngle(laneAngle, completedManeuver);
519 from->lane->requireCollisionCheck();
520 to->lane->requireCollisionCheck();
521 return changedToNewLane;
527 const bool opposite = (&from->lane->getEdge() != &to->lane->getEdge());
528 const bool changedToNewLane = (to->lane != from->lane
530 && (
mayChange(direction * oppositeSign) || opposite));
531 if (changedToNewLane) {
532 vehicle->
myState.
myPosLat -= direction * 0.5 * (from->lane->getWidth() + to->lane->getWidth()) * oppositeSign;
534 to->lane->myTmpVehicles.insert(to->lane->myTmpVehicles.begin(), vehicle);
550 to->ahead.addLeader(vehicle,
false, 0);
553 from->ahead.addLeader(vehicle,
false, 0);
555 return changedToNewLane;
602#ifdef DEBUG_SURROUNDING
604 std::cout <<
SIMTIME <<
" getLeaders lane=" << target->lane->getID() <<
" ego=" << vehicle->
getID() <<
" ahead=" << target->ahead.toString() <<
"\n";
608 int sublaneShift = 0;
609 if (target->lane == vehicle->
getLane()) {
617 for (
int i = 0; i < target->ahead.numSublanes(); ++i) {
619 if (
veh !=
nullptr) {
621#ifdef DEBUG_SURROUNDING
626 if (i + sublaneShift >= 0 && i + sublaneShift < result.
numSublanes()) {
631 if (sublaneShift != 0) {
632 for (
MSVehicle* cand : target->outsideBounds) {
637#ifdef DEBUG_SURROUNDING
639 std::cout <<
" outsideBounds=" <<
toString(target->outsideBounds) <<
" result=" << result.
toString() <<
"\n";
652 const std::vector<MSVehicle::LaneQ>& preb,
654 double& maneuverDist)
const {
658 const MSLane& neighLane = *(target->lane);
670 for (
int offset :
myCandi->siblings) {
677 if (ceSib->aheadNext.hasVehicles()) {
680#ifdef DEBUG_SURROUNDING
682 std::cout <<
SIMTIME <<
" ego=" << vehicle->
getID() <<
" ahead=" <<
myCandi->aheadNext.toString() <<
" sib=" << ceSib->lane->getID() <<
" sibAhead=" << ceSib->aheadNext.toString() <<
" leaders=" << leaders.
toString() <<
"\n";
686 for (
int offset : target->siblings) {
693 if (ceSib->aheadNext.hasVehicles()) {
696#ifdef DEBUG_SURROUNDING
698 std::cout <<
SIMTIME <<
" ego=" << vehicle->
getID() <<
" neighAhead=" << target->aheadNext.toString() <<
" sib=" << ceSib->lane->getID() <<
" sibAhead=" << ceSib->aheadNext.toString() <<
" neighLeaders=" << neighLeaders.
toString() <<
"\n";
704 if (laneOffset == -1 && neighLeaders.
hasVehicles()) {
708#ifdef DEBUG_SURROUNDING
710 <<
" checkChangeSublane: veh=" << vehicle->
getID()
711 <<
" laneOffset=" << laneOffset
712 <<
"\n leaders=" << leaders.
toString()
713 <<
"\n neighLeaders=" << neighLeaders.
toString()
714 <<
"\n followers=" << followers.
toString()
715 <<
"\n neighFollowers=" << neighFollowers.
toString()
721 laneOffset, alternatives,
722 leaders, followers, blockers,
723 neighLeaders, neighFollowers, neighBlockers,
725 &(
myCandi->lastBlocked), &(
myCandi->firstBlocked), latDist, maneuverDist, blocked);
734 if (link2 !=
nullptr) {
736 if (api !=
nullptr) {
737 if (!link2->
opened(api->arrivalTime, api->arrivalSpeed, api->leaveSpeed, vehicle->
getLength(),
739 nullptr,
false, vehicle, api->dist)) {
748 int state = blocked | wish;
755 const int oldstate = state;
764 if (laneOffset != 0) {
776 const std::pair<MSVehicle* const, double>& leader,
777 const std::pair<MSVehicle* const, double>& neighLead,
778 const std::pair<MSVehicle* const, double>& neighFollow,
779 const std::vector<MSVehicle::LaneQ>& preb) {
786 const MSLane& neighLane = *targetLane;
806 targetLane->
addLeaders(vehicle, posOnTarget, neighLeaders);
807 neighLeaders.
patchGaps(2 * POSITION_EPS);
808 int sublaneIndex = 0;
809 for (
int i = 0; i < targetLane->
getIndex(); i++) {
817 targetLane->
addLeaders(vehicle, backPosOnTarget, neighFollowers,
true);
824#ifdef DEBUG_CHANGE_OPPOSITE
826 <<
" checkChangeOppositeSublane: veh=" << vehicle->
getID()
828 <<
" laneOffset=" << laneOffset
829 <<
"\n leaders=" << leaders.
toString()
830 <<
"\n neighLeaders=" << neighLeaders.
toString()
831 <<
"\n followers=" << followers.
toString()
832 <<
"\n neighFollowers=" << neighFollowers.
toString()
841 double maneuverDist = 0;
843 laneOffset, alternatives,
844 leaders, followers, blockers,
845 neighLeaders, neighFollowers, neighBlockers,
847 &(
myCandi->lastBlocked), &(
myCandi->firstBlocked), latDist, maneuverDist, blocked);
848 int state = blocked | wish;
850 const int oldstate = state;
852#ifdef DEBUG_CHANGE_OPPOSITE
858 if (laneOffset != 0) {
864#ifdef DEBUG_CHANGE_OPPOSITE
866 std::cout <<
SIMTIME <<
" veh '" << vehicle->
getID() <<
"' performing sublane change latDist=" << latDist <<
" maneuverDist=" << maneuverDist <<
"\n";
877std::pair<MSVehicle*, double>
880 std::pair<MSVehicle*, double> leader(
nullptr, std::numeric_limits<double>::max());
883 if (cand.first !=
nullptr) {
884 double rightSide = cand.first->getRightSideOnLane();
885 if (cand.first->getLane() != vehicle->
getLane()) {
887 rightSide += (cand.first->getCenterOnEdge(cand.first->getLane())
890#ifdef DEBUG_CHANGE_OPPOSITE
892 std::cout <<
SIMTIME <<
" cand=" << cand.first->getID() <<
" rightSide=" << rightSide <<
"\n";
895 if (cand.second < leader.second
896 && rightSide < egoWidth
897 && vehicle->
getLane()->
getWidth() - rightSide - cand.first->getVehicleType().getWidth() < egoWidth) {
898 leader.first =
const_cast<MSVehicle*
>(cand.first);
899 leader.second = cand.second;
913 const bool outsideLeft = rightOL > lane->
getWidth();
914#ifdef DEBUG_SURROUNDING
916 std::cout <<
SIMTIME <<
" addOutsideLeaders veh=" << vehicle->
getID() <<
" lane=" << lane->
getID() <<
" rightOL=" << rightOL <<
" leftOL=" << leftOL <<
"\n";
919 if (leftOL < 0 || outsideLeft) {
920 int sublaneOffset = 0;
926 if (sublaneOffset != 0) {
928#ifdef DEBUG_SURROUNDING
930 std::cout <<
" sublaneOffset=" << sublaneOffset <<
" outsideLeft=" << outsideLeft <<
"\n";
934#ifdef DEBUG_SURROUNDING
936 std::cout <<
" cand=" << cand->getID() <<
" cLOE=" << cand->getLeftSideOnEdge() <<
" cROE=" << cand->getRightSideOnEdge() <<
"\n";
940 && ((!outsideLeft && cand->getLeftSideOnEdge() < 0)
941 || (outsideLeft && cand->getLeftSideOnEdge() > lane->
getEdge().
getWidth()))) {
944#ifdef DEBUG_SURROUNDING
946 std::cout <<
" outsideLeader=" << cand->getID() <<
" ahead=" << leaders.
toString() <<
"\n";
std::pair< const MSVehicle *, double > CLeaderDist
@ SVC_EMERGENCY
public emergency vehicles
LaneChangeAction
The state of a vehicle's lane-change behavior.
@ LCA_BLOCKED
blocked in all directions
@ LCA_URGENT
The action is urgent (to be defined by lc-model)
@ LCA_STAY
Needs to stay on the current lane.
@ LCA_SUBLANE
used by the sublane model
@ LCA_LEFT
Wants go to the left.
@ LCA_CHANGE_REASONS
reasons of lane change
@ LCA_TRACI
The action is due to a TraCI request.
@ LCA_WANTS_LANECHANGE
lane can change
@ LCA_RIGHT
Wants go to the right.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void setFollowerGaps(CLeaderDist follower, double secGap)
MSLane * updateTargetLane()
double getPreviousManeuverDist() const
virtual void setOwnState(const int state)
double getCommittedSpeed() const
virtual double computeSpeedLat(double latDist, double &maneuverDist, bool urgent) const
decides the next lateral speed depending on the remaining lane change distance to be covered and upda...
static bool outputLCEnded()
whether start of maneuvers shall be recorede
double getManeuverDist() const
Returns the remaining unblocked distance for the current maneuver. (only used by sublane model)
void laneChangeOutput(const std::string &tag, MSLane *source, MSLane *target, int direction, double maneuverDist=0)
called once the vehicle ends a lane change manoeuvre (non-instant)
MSLane * getShadowLane() const
Returns the lane the vehicle's shadow is on during continuous/sublane lane change.
bool startLaneChangeManeuver(MSLane *source, MSLane *target, int direction)
start the lane change maneuver and return whether it continues
void saveLCState(const int dir, int stateWithoutTraCI, const int state)
static bool haveLCOutput()
whether lanechange-output is active
virtual void updateExpectedSublaneSpeeds(const MSLeaderDistanceInfo &ahead, int sublaneOffset, int laneIndex)
update expected speeds for each sublane of the current edge
void setLeaderGaps(CLeaderDist, double secGap)
int & getCanceledState(const int dir)
void setOrigLeaderGaps(CLeaderDist, double secGap)
virtual int wantsChangeSublane(int laneOffset, LaneChangeAction alternatives, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &followers, const MSLeaderDistanceInfo &blockers, const MSLeaderDistanceInfo &neighLeaders, const MSLeaderDistanceInfo &neighFollowers, const MSLeaderDistanceInfo &neighBlockers, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked, double &latDist, double &targetDistLat, int &blocked)
void setManeuverDist(const double dist)
Updates the remaining distance for the current maneuver while it is continued within non-action steps...
void setSpeedLat(double speedLat)
set the lateral speed and update lateral acceleraton
virtual void updateSafeLatDist(const double travelledLatDist)
Updates the value of safe lateral distances (in SL2015) during maneuver continuation in non-action st...
double getSpeedLat() const
return the lateral speed of the current lane change maneuver
bool alreadyChanged() const
reset the flag whether a vehicle already moved to false
virtual StateAndDist decideDirection(StateAndDist sd1, StateAndDist sd2) const
decide in which direction to move in case both directions are desirable
static bool outputLCStarted()
whether start of maneuvers shall be recorede
virtual bool debugVehicle() const
whether the current vehicles shall be debugged
bool isChangingLanes() const
return true if the vehicle currently performs a lane change maneuver
void clearNeighbors()
Clear info on neighboring vehicle from previous step.
void saveNeighbors(const int dir, const MSLeaderDistanceInfo &followers, const MSLeaderDistanceInfo &leaders)
Saves the lane change relevant vehicles, which are currently on neighboring lanes in the given direct...
virtual bool isSelected() const
whether this vehicle is selected in the GUI
double getImpatience() const
Returns this vehicles impatience.
double getLength() const
Returns the vehicle's length.
double getWidth() const
Returns the vehicle's width.
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
MSLaneChanger * myLaneChanger
This member will do the lane-change.
double getWidth() const
Returns the edges's width (sum over all lanes)
static double gLateralResolution
Performs lane changing of vehicles.
const bool myChangeToOpposite
whether this edge allows changing to the opposite direction edge
bool changeOpposite(MSVehicle *vehicle, std::pair< MSVehicle *, double > leader, MSVehicle *lastStopped)
static bool hasOppositeStop(MSVehicle *vehicle)
whether vehicle has an opposite-direction stop within relevant range
void checkTraCICommands(MSVehicle *vehicle)
Take into account traci LC-commands.
virtual void initChanger()
Initialize the changer before looping over all vehicles.
MSVehicle * veh(ConstChangerIt ce) const
Changer myChanger
Container for ChangeElemements, one for every lane in the edge.
ChangerIt findCandidate()
Find current candidate. If there is none, myChanger.end() is returned.
bool mayChange(int direction) const
whether changing to the lane in the given direction should be considered
void registerUnchanged(MSVehicle *vehicle)
Changer & getChanger()
return changer (only to be used by MSLaneChangerSublane from another instance)
Changer::iterator ChangerIt
the iterator moving over the ChangeElems
static std::vector< MSVehicle::LaneQ > getBestLanesOpposite(MSVehicle *vehicle, const MSLane *stopLane, double oppositeLength)
add LaneQ for opposite lanes
virtual void updateChanger(bool vehHasChanged)
bool startChangeSublane(MSVehicle *vehicle, ChangerIt &from, double latDist, double maneuverDist)
change by the specified amount and return whether a new lane was entered
bool checkChangeToNewLane(MSVehicle *vehicle, const int direction, ChangerIt from, ChangerIt to)
check whether the given vehicle has entered the new lane 'to->lane' during a sublane LC-step
void outputLCStarted(MSVehicle *vehicle, ChangerIt &from, ChangerIt &to, int direction, double maneuverDist)
optional output for start of lane-change maneuvre
void addOutsideLeaders(const MSVehicle *vehicle, MSLeaderDistanceInfo &leaders) const
~MSLaneChangerSublane()
Destructor.
MSLeaderDistanceInfo getLeaders(const ChangerIt &target, const MSVehicle *ego) const
get leaders for ego on the given lane
StateAndDist checkChangeHelper(MSVehicle *vehicle, int laneOffset, LaneChangeAction alternatives)
helper function that calls checkChangeSublane and sets blocker information
static std::pair< MSVehicle *, double > findClosestLeader(const MSLeaderDistanceInfo &leaders, const MSVehicle *vehicle)
find the closest leader that prevents ego vehicle from passing on the current lane
bool myCheckedChangeOpposite
whether checkChangeOpposite was called for the current vehicle
virtual void initChanger()
Initialize the changer before looping over all vehicles.
bool checkChangeOpposite(MSVehicle *vehicle, int laneOffset, MSLane *targetLane, const std::pair< MSVehicle *const, double > &leader, const std::pair< MSVehicle *const, double > &neighLead, const std::pair< MSVehicle *const, double > &neighFollow, const std::vector< MSVehicle::LaneQ > &preb)
virtual void updateChanger(bool vehHasChanged)
void abortLCManeuver(MSVehicle *vehicle)
immediately stop lane-changing and register vehicle as unchanged
MSLaneChangerSublane()
Default constructor.
void outputLCEnded(MSVehicle *vehicle, ChangerIt &from, ChangerIt &to, int direction)
optional output for end of lane-change maneuvre
MSAbstractLaneChangeModel::StateAndDist StateAndDist
int checkChangeSublane(int laneOffset, LaneChangeAction alternatives, const std::vector< MSVehicle::LaneQ > &preb, double &latDist, double &maneuverDist) const
check whether sub-lane changing in the given direction is desirable and possible
bool continueChangeSublane(MSVehicle *vehicle, ChangerIt &from)
Continue a sublane-lane change maneuver and return whether the midpoint was passed in this step.
Representation of a lane in the micro simulation.
VehCont myTmpVehicles
Container for lane-changing vehicles. After completion of lane-change- process, the containers will b...
const MSLink * getLinkTo(const MSLane *const) const
returns the link to the given lane or nullptr, if it is not connected
void addLeaders(const MSVehicle *vehicle, double vehPos, MSLeaderDistanceInfo &result, bool oppositeDirection=false)
get leaders for ego on the given lane
double getRightSideOnEdge() const
int getIndex() const
Returns the lane's index.
double getOppositePos(double pos) const
return the corresponding position on the opposite lane
MSLane * getOpposite() const
return the neighboring opposite direction lane for lane changing or nullptr
MSEdge & getEdge() const
Returns the lane's edge.
MSLeaderDistanceInfo getFollowersOnConsecutive(const MSVehicle *ego, double backOffset, bool allSublanes, double searchDist=-1, MinorLinkMode mLinkMode=FOLLOW_ALWAYS) const
return the sublane followers with the largest missing rear gap among all predecessor lanes (within di...
double getWidth() const
Returns the lane's width.
saves leader/follower vehicles and their distances relative to an ego vehicle
virtual void addLeaders(MSLeaderDistanceInfo &other)
updatd empty sublanes with vehicles and gaps from other
virtual std::string toString() const
print a debugging representation
void fixOppositeGaps(bool isFollower)
subtract vehicle length from all gaps if the leader vehicle is driving in the opposite direction
void patchGaps(double amount)
add given value to all gaps
virtual int addLeader(const MSVehicle *veh, double gap, double latOffset=0, int sublane=-1)
void moveSamePosTo(const MSVehicle *ego, MSLeaderDistanceInfo &other)
void setSublaneOffset(int offset)
set number of sublanes by which to shift positions
const ApproachingVehicleInformation * getApproachingPtr(const SUMOVehicle *veh) const
bool opened(SUMOTime arrivalTime, double arrivalSpeed, double leaveSpeed, double vehicleLength, double impatience, double decel, SUMOTime waitingTime, double posLat=0, BlockingFoes *collectFoes=nullptr, bool ignoreRed=false, const SUMOTrafficObject *ego=nullptr, double dist=-1) const
Returns the information whether the link may be passed.
bool isEntryLink() const
return whether the toLane of this link is an internal lane and fromLane is a normal lane
MSLink * getParallelLink(int direction) const
return the link that is parallel to this lane or 0
void setSublaneChange(double latDist)
Sets a new sublane-change request.
double myPosLat
the stored lateral position
Representation of a vehicle in the micro simulation.
void updateBestLanes(bool forceRebuild=false, const MSLane *startLane=0)
computes the best lanes to use in order to continue the route
double computeAngle() const
compute the current vehicle angle
bool isStoppedOnLane() const
bool isActive() const
Returns whether the current simulation step is an action point for the vehicle.
SUMOTime getWaitingTime(const bool accumulated=false) const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
MSAbstractLaneChangeModel & getLaneChangeModel()
double getLeftSideOnLane() const
Get the lateral position of the vehicles left side on the lane:
double getActionStepLengthSecs() const
Returns the vehicle's action step length in secs, i.e. the interval between two action points.
int influenceChangeDecision(int state)
allow TraCI to influence a lane change decision
bool isRemoteControlled() const
Returns the information whether the vehicle is fully controlled via TraCI.
void adaptBestLanesOccupation(int laneIndex, double density)
update occupation from MSLaneChanger
void setAngle(double angle, bool straightenFurther=false)
Set a custom vehicle angle in rad, optionally updates furtherLanePosLat.
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the best sequence of lanes to continue the route starting at myLane.
double getBackPositionOnLane(const MSLane *lane) const
Get the vehicle's position relative to the given lane.
double getLatOffset(const MSLane *lane) const
Get the offset that that must be added to interpret myState.myPosLat for the given lane.
SUMOTime getActionStepLength() const
Returns the vehicle's action step length in millisecs, i.e. the interval between two action points.
const MSLane * getLane() const
Returns the lane the vehicle is on.
Influencer & getInfluencer()
double getRightSideOnLane() const
Get the lateral position of the vehicles right side on the lane:
double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
Position myCachedPosition
const std::vector< LaneQ > & getBestLanes() const
Returns the description of best lanes to use in order to continue the route.
std::vector< double > myFurtherLanesPosLat
lateral positions on further lanes
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
double getPositionOnLane() const
Get the vehicle's position along the lane.
double getAngle() const
Returns the vehicle's direction in radians.
State myState
This Vehicles driving state (pos and speed)
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 getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getMinGap() const
Get the free space in front of vehicles of this class.
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
double getLength() const
Get vehicle's length [m].
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
const std::string & getID() const
Returns the id.
static const Position INVALID
used to indicate that a position is valid
#define UNUSED_PARAMETER(x)
NLOHMANN_BASIC_JSON_TPL_DECLARATION void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL &j1, nlohmann::NLOHMANN_BASIC_JSON_TPL &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name) is_nothrow_move_constructible< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value &&//NOLINT(misc-redundant-expression) is_nothrow_move_assignable< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value)
exchanges the values of two JSON objects