![]() |
SUMO - Simulation of Urban MObility
|
Changes the wished vehicle speed / lanes. More...
#include <MSVehicle.h>

Public Member Functions | |
| double | changeRequestRemainingSeconds (const SUMOTime currentTime) const |
| Return the remaining number of seconds of the current laneTimeLine assuming one exists. More... | |
| bool | getEmergencyBrakeRedLight () const |
| Returns whether red lights shall be a reason to brake. More... | |
| int | getLanechangeMode () const |
| return the current lane change mode More... | |
| SUMOTime | getLastAccessTimeStep () const |
| double | getLatDist () const |
| double | getOriginalSpeed () const |
| Returns the originally longitudinal speed to use. More... | |
| bool | getRespectJunctionPriority () const |
| Returns whether junction priority rules shall be respected. More... | |
| SUMOAbstractRouter< MSEdge, SUMOVehicle > & | getRouterTT () const |
| int | getRoutingMode () const |
| return the current routing mode More... | |
| int | getSignals () const |
| int | getSpeedMode () const |
| return the current speed mode More... | |
| double | implicitDeltaPosVTD (const MSVehicle *veh) |
| return the change in longitudinal position that is implicit in the new VTD position More... | |
| double | implicitSpeedVTD (const MSVehicle *veh, double oldSpeed) |
| return the speed that is implicit in the new VTD position More... | |
| int | influenceChangeDecision (const SUMOTime currentTime, const MSEdge ¤tEdge, const int currentLaneIndex, int state) |
| Applies stored LaneChangeMode information and laneTimeLine. More... | |
| Influencer () | |
| Constructor. More... | |
| double | influenceSpeed (SUMOTime currentTime, double speed, double vSafe, double vMin, double vMax) |
| Applies stored velocity information on the speed to use. More... | |
| bool | isVTDAffected (SUMOTime t) const |
| bool | isVTDControlled () const |
| void | postProcessVTD (MSVehicle *v) |
| void | setLaneChangeMode (int value) |
| Sets lane changing behavior. More... | |
| void | setLaneTimeLine (const std::vector< std::pair< SUMOTime, int > > &laneTimeLine) |
| Sets a new lane timeline. More... | |
| void | setRoutingMode (int value) |
| Sets routing behavior. More... | |
| void | setSignals (int signals) |
| void | setSpeedMode (int speedMode) |
| Sets speed-constraining behaviors. More... | |
| void | setSpeedTimeLine (const std::vector< std::pair< SUMOTime, double > > &speedTimeLine) |
| Sets a new velocity timeline. More... | |
| void | setSublaneChange (double latDist) |
| Sets a new sublane-change request. More... | |
| void | setVTDControlled (Position xyPos, MSLane *l, double pos, double posLat, double angle, int edgeOffset, const ConstMSEdgeVector &route, SUMOTime t) |
| ~Influencer () | |
| Destructor. More... | |
Private Attributes | |
| bool | myConsiderMaxAcceleration |
| Whether the maximum acceleration shall be regarded. More... | |
| bool | myConsiderMaxDeceleration |
| Whether the maximum deceleration shall be regarded. More... | |
| bool | myConsiderSafeVelocity |
| Whether the safe velocity shall be regarded. More... | |
| bool | myEmergencyBrakeRedLight |
| Whether red lights are a reason to brake. More... | |
| std::vector< std::pair< SUMOTime, int > > | myLaneTimeLine |
| The lane usage time line to apply. More... | |
| SUMOTime | myLastVTDAccess |
| double | myLatDist |
| The requested lateral change. More... | |
| double | myOriginalSpeed |
| The velocity before influence. More... | |
| bool | myRespectJunctionPriority |
| Whether the junction priority rules are respected. More... | |
| int | myRoutingMode |
| routing mode (see TraCIConstants.h) More... | |
| bool | mySpeedAdaptationStarted |
| Whether influencing the speed has already started. More... | |
| std::vector< std::pair< SUMOTime, double > > | mySpeedTimeLine |
| The velocity time line to apply. More... | |
| TraciLaneChangePriority | myTraciLaneChangePriority |
| flags for determining the priority of traci lane change requests More... | |
| int | myTraCISignals |
| double | myVTDAngle |
| int | myVTDEdgeOffset |
| MSLane * | myVTDLane |
| double | myVTDPos |
| double | myVTDPosLat |
| ConstMSEdgeVector | myVTDRoute |
| Position | myVTDXYPos |
Flags for managing conflicts between the laneChangeModel and TraCI laneTimeLine | |
| LaneChangeMode | myStrategicLC |
| lane changing which is necessary to follow the current route More... | |
| LaneChangeMode | myCooperativeLC |
| lane changing with the intent to help other vehicles More... | |
| LaneChangeMode | mySpeedGainLC |
| lane changing to travel with higher speed More... | |
| LaneChangeMode | myRightDriveLC |
| changing to the rightmost lane More... | |
| LaneChangeMode | mySublaneLC |
| changing to the prefered lateral alignment More... | |
Changes the wished vehicle speed / lanes.
The class is used for passing velocities or velocity profiles obtained via TraCI to the vehicle. The speed adaptation is controlled by the stored speedTimeLine Additionally, the variables myConsiderSafeVelocity, myConsiderMaxAcceleration, and myConsiderMaxDeceleration control whether the safe velocity, the maximum acceleration, and the maximum deceleration have to be regarded.
Furthermore this class is used to affect lane changing decisions according to LaneChangeMode and any given laneTimeLine
Definition at line 1241 of file MSVehicle.h.
| MSVehicle::Influencer::Influencer | ( | ) |
Constructor.
Definition at line 239 of file MSVehicle.cpp.
| MSVehicle::Influencer::~Influencer | ( | ) |
Destructor.
Definition at line 259 of file MSVehicle.cpp.
| double MSVehicle::Influencer::changeRequestRemainingSeconds | ( | const SUMOTime | currentTime | ) | const |
Return the remaining number of seconds of the current laneTimeLine assuming one exists.
| [in] | currentTime | The current simulation time |
Definition at line 424 of file MSVehicle.cpp.
References myLaneTimeLine, and STEPS2TIME.
Referenced by MSLCM_LC2013::_wantsChange(), and MSLCM_SL2015::_wantsChangeSublane().
|
inline |
Returns whether red lights shall be a reason to brake.
Definition at line 1319 of file MSVehicle.h.
Referenced by MSVehicle::executeMove(), and MSVehicle::ignoreRed().
| int MSVehicle::Influencer::getLanechangeMode | ( | ) | const |
return the current lane change mode
Definition at line 290 of file MSVehicle.cpp.
References myCooperativeLC, myRightDriveLC, mySpeedGainLC, myStrategicLC, mySublaneLC, and myTraciLaneChangePriority.
Referenced by TraCI_Vehicle::getLanechangeMode().
|
inline |
Definition at line 1347 of file MSVehicle.h.
Referenced by MSVehicle::wasRemoteControlled().
|
inline |
Definition at line 1371 of file MSVehicle.h.
Referenced by MSLCM_SL2015::keepLatGap().
| double MSVehicle::Influencer::getOriginalSpeed | ( | ) | const |
Returns the originally longitudinal speed to use.
Definition at line 334 of file MSVehicle.cpp.
References myOriginalSpeed, and mySpeedTimeLine.
Referenced by MSVehicle::getSpeedWithoutTraciInfluence().
|
inline |
Returns whether junction priority rules shall be respected.
Definition at line 1311 of file MSVehicle.h.
Referenced by MSLaneChanger::changeOpposite(), MSVehicle::checkRewindLinkLanes(), and MSVehicle::executeMove().
| SUMOAbstractRouter< MSEdge, SUMOVehicle > & MSVehicle::Influencer::getRouterTT | ( | ) | const |
Definition at line 543 of file MSVehicle.cpp.
References MSNet::getInstance(), MSDevice_Routing::getRouterTT(), MSNet::getRouterTT(), and myRoutingMode.
|
inline |
return the current routing mode
Definition at line 1274 of file MSVehicle.h.
References MSVehicle::influenceChangeDecision().
Referenced by TraCI_Vehicle::getRoutingMode().
|
inline |
Definition at line 1367 of file MSVehicle.h.
Referenced by MSVehicle::setBlinkerInformation().
| int MSVehicle::Influencer::getSpeedMode | ( | ) | const |
return the current speed mode
Definition at line 280 of file MSVehicle.cpp.
References myConsiderMaxAcceleration, myConsiderMaxDeceleration, myConsiderSafeVelocity, myEmergencyBrakeRedLight, and myRespectJunctionPriority.
Referenced by TraCI_Vehicle::getSpeedMode().
| double MSVehicle::Influencer::implicitDeltaPosVTD | ( | const MSVehicle * | veh | ) |
return the change in longitudinal position that is implicit in the new VTD position
Definition at line 527 of file MSVehicle.cpp.
References DIST2SPEED, Position::distanceTo2D(), MSVehicle::getDistanceToPosition(), MSLane::getEdge(), MSBaseVehicle::getMaxSpeed(), MSVehicle::getPosition(), myVTDLane, myVTDPos, and myVTDXYPos.
Referenced by MSVehicle::updateState().
| double MSVehicle::Influencer::implicitSpeedVTD | ( | const MSVehicle * | veh, |
| double | oldSpeed | ||
| ) |
return the speed that is implicit in the new VTD position
Definition at line 512 of file MSVehicle.cpp.
References DIST2SPEED, Position::distanceTo2D(), MSVehicle::getDistanceToPosition(), MSLane::getEdge(), MSBaseVehicle::getMaxSpeed(), MSVehicle::getPosition(), myVTDLane, myVTDPos, and myVTDXYPos.
Referenced by MSVehicle::executeMove().
| int MSVehicle::Influencer::influenceChangeDecision | ( | const SUMOTime | currentTime, |
| const MSEdge & | currentEdge, | ||
| const int | currentLaneIndex, | ||
| int | state | ||
| ) |
Applies stored LaneChangeMode information and laneTimeLine.
| [in] | currentTime | The current simulation time |
| [in] | currentEdge | The current edge the vehicle is on |
| [in] | currentLaneIndex | The index of the lane the vehicle is currently on |
| [in] | state | The LaneChangeAction flags as computed by the laneChangeModel |
Definition at line 340 of file MSVehicle.cpp.
References MSEdge::getLanes(), MSVehicle::LC_ALWAYS, MSVehicle::LC_NEVER, MSVehicle::LC_NOCONFLICT, LCA_BLOCKED, LCA_COOPERATIVE, LCA_KEEPRIGHT, LCA_LEFT, LCA_OVERLAPPING, LCA_RIGHT, LCA_SPEEDGAIN, LCA_STAY, LCA_STRATEGIC, LCA_SUBLANE, LCA_TRACI, LCA_URGENT, LCA_WANTS_LANECHANGE_OR_STAY, MSVehicle::LCP_ALWAYS, MSVehicle::LCP_NOOVERLAP, MSVehicle::LCP_OPPORTUNISTIC, myCooperativeLC, myLaneTimeLine, myRightDriveLC, mySpeedGainLC, myStrategicLC, mySublaneLC, myTraciLaneChangePriority, MSVehicle::REQUEST_HOLD, MSVehicle::REQUEST_LEFT, MSVehicle::REQUEST_NONE, MSVehicle::REQUEST_RIGHT, time2string(), toString(), and WRITE_WARNING.
Referenced by MSVehicle::influenceChangeDecision().
| double MSVehicle::Influencer::influenceSpeed | ( | SUMOTime | currentTime, |
| double | speed, | ||
| double | vSafe, | ||
| double | vMin, | ||
| double | vMax | ||
| ) |
Applies stored velocity information on the speed to use.
The given speed is assumed to be the non-influenced speed from longitudinal control. It is stored for further usage in "myOriginalSpeed".
| [in] | currentTime | The current simulation time |
| [in] | speed | The undisturbed speed |
| [in] | vSafe | The safe velocity |
| [in] | vMin | The minimum velocity |
| [in] | vMax | The maximum simulation time |
Definition at line 301 of file MSVehicle.cpp.
References DELTA_T, MAX2(), MIN2(), myConsiderMaxAcceleration, myConsiderMaxDeceleration, myConsiderSafeVelocity, myOriginalSpeed, mySpeedAdaptationStarted, mySpeedTimeLine, and STEPS2TIME.
Referenced by MSVehicle::executeMove(), and MSVehicle::planMoveInternal().
| bool MSVehicle::Influencer::isVTDAffected | ( | SUMOTime | t | ) | const |
Definition at line 472 of file MSVehicle.cpp.
References myLastVTDAccess, and TIME2STEPS.
Referenced by MSLane::detectCollisionBetween(), MSVehicle::getPosition(), and MSLane::handleCollisionBetween().
| bool MSVehicle::Influencer::isVTDControlled | ( | ) | const |
Definition at line 466 of file MSVehicle.cpp.
References MSNet::getCurrentTimeStep(), MSNet::getInstance(), and myLastVTDAccess.
Referenced by MSVehicle::executeMove(), MSVehicle::isRemoteControlled(), and MSVehicle::updateState().
| void MSVehicle::Influencer::postProcessVTD | ( | MSVehicle * | v | ) |
Definition at line 477 of file MSVehicle.cpp.
References MSRoute::begin(), DEG2RAD, MSVehicle::drawOutsideNetwork(), MSLane::forceVehicleInsertion(), MSBaseVehicle::getDeparture(), MSVehicle::getLane(), MSLane::getLength(), MSBaseVehicle::getRoute(), MSBaseVehicle::getVehicleType(), MSVehicleType::getWidth(), MSLane::getWidth(), MSVehicle::isOnRoad(), M_PI, MSBaseVehicle::myCurrEdge, myVTDAngle, myVTDEdgeOffset, myVTDLane, myVTDPos, myVTDPosLat, myVTDRoute, myVTDXYPos, MSBaseVehicle::NOT_YET_DEPARTED, MSMoveReminder::NOTIFICATION_TELEPORT, MSBaseVehicle::onDepart(), MSVehicle::onRemovalFromNet(), MSLane::removeVehicle(), MSBaseVehicle::replaceRouteEdges(), MSVehicle::setAngle(), MSVehicle::setVTDState(), and MSVehicle::updateBestLanes().
| void MSVehicle::Influencer::setLaneChangeMode | ( | int | value | ) |
Sets lane changing behavior.
| [in] | value | a bitset controlling the different modes |
Definition at line 442 of file MSVehicle.cpp.
References myCooperativeLC, myRightDriveLC, mySpeedGainLC, myStrategicLC, mySublaneLC, and myTraciLaneChangePriority.
Referenced by TraCIServerAPI_Vehicle::processSet().
| void MSVehicle::Influencer::setLaneTimeLine | ( | const std::vector< std::pair< SUMOTime, int > > & | laneTimeLine | ) |
Sets a new lane timeline.
| [in] | laneTimeLine | The time line of lanes to use |
Definition at line 270 of file MSVehicle.cpp.
References myLaneTimeLine.
Referenced by TraCI_Vehicle::changeLane(), and TraCIServerAPI_Vehicle::processSet().
|
inline |
Sets routing behavior.
| [in] | value | an enum value controlling the different modes |
Definition at line 1336 of file MSVehicle.h.
Referenced by TraCIServerAPI_Vehicle::processSet().
|
inline |
Definition at line 1363 of file MSVehicle.h.
Referenced by TraCIServerAPI_Vehicle::processSet(), and MSVehicle::setBlinkerInformation().
| void MSVehicle::Influencer::setSpeedMode | ( | int | speedMode | ) |
Sets speed-constraining behaviors.
| [in] | value | a bitset controlling the different modes |
Definition at line 432 of file MSVehicle.cpp.
References myConsiderMaxAcceleration, myConsiderMaxDeceleration, myConsiderSafeVelocity, myEmergencyBrakeRedLight, and myRespectJunctionPriority.
Referenced by TraCIServerAPI_Vehicle::processSet().
| void MSVehicle::Influencer::setSpeedTimeLine | ( | const std::vector< std::pair< SUMOTime, double > > & | speedTimeLine | ) |
Sets a new velocity timeline.
| [in] | speedTimeLine | The time line of speeds to use |
Definition at line 263 of file MSVehicle.cpp.
References mySpeedAdaptationStarted, and mySpeedTimeLine.
Referenced by TraCIServerAPI_Vehicle::processSet().
| void MSVehicle::Influencer::setSublaneChange | ( | double | latDist | ) |
Sets a new sublane-change request.
| [in] | latDist | The lateral distance for changing |
Definition at line 275 of file MSVehicle.cpp.
References myLatDist.
Referenced by TraCIServerAPI_Vehicle::processSet(), and MSAbstractLaneChangeModel::setOwnState().
| void MSVehicle::Influencer::setVTDControlled | ( | Position | xyPos, |
| MSLane * | l, | ||
| double | pos, | ||
| double | posLat, | ||
| double | angle, | ||
| int | edgeOffset, | ||
| const ConstMSEdgeVector & | route, | ||
| SUMOTime | t | ||
| ) |
Definition at line 453 of file MSVehicle.cpp.
References myLastVTDAccess, myVTDAngle, myVTDEdgeOffset, myVTDLane, myVTDPos, myVTDPosLat, myVTDRoute, and myVTDXYPos.
Referenced by TraCIServer::setVTDControlled().
|
private |
Whether the maximum acceleration shall be regarded.
Definition at line 1397 of file MSVehicle.h.
Referenced by getSpeedMode(), influenceSpeed(), and setSpeedMode().
|
private |
Whether the maximum deceleration shall be regarded.
Definition at line 1400 of file MSVehicle.h.
Referenced by getSpeedMode(), influenceSpeed(), and setSpeedMode().
|
private |
Whether the safe velocity shall be regarded.
Definition at line 1394 of file MSVehicle.h.
Referenced by getSpeedMode(), influenceSpeed(), and setSpeedMode().
|
private |
lane changing with the intent to help other vehicles
Definition at line 1422 of file MSVehicle.h.
Referenced by getLanechangeMode(), influenceChangeDecision(), and setLaneChangeMode().
|
private |
Whether red lights are a reason to brake.
Definition at line 1406 of file MSVehicle.h.
Referenced by getSpeedMode(), and setSpeedMode().
|
private |
The lane usage time line to apply.
Definition at line 1382 of file MSVehicle.h.
Referenced by changeRequestRemainingSeconds(), influenceChangeDecision(), and setLaneTimeLine().
|
private |
Definition at line 1415 of file MSVehicle.h.
Referenced by isVTDAffected(), isVTDControlled(), and setVTDControlled().
|
private |
The requested lateral change.
Definition at line 1388 of file MSVehicle.h.
Referenced by setSublaneChange().
|
private |
The velocity before influence.
Definition at line 1385 of file MSVehicle.h.
Referenced by getOriginalSpeed(), and influenceSpeed().
|
private |
Whether the junction priority rules are respected.
Definition at line 1403 of file MSVehicle.h.
Referenced by getSpeedMode(), and setSpeedMode().
|
private |
changing to the rightmost lane
Definition at line 1426 of file MSVehicle.h.
Referenced by getLanechangeMode(), influenceChangeDecision(), and setLaneChangeMode().
|
private |
routing mode (see TraCIConstants.h)
Definition at line 1437 of file MSVehicle.h.
Referenced by getRouterTT().
|
private |
Whether influencing the speed has already started.
Definition at line 1391 of file MSVehicle.h.
Referenced by influenceSpeed(), and setSpeedTimeLine().
|
private |
lane changing to travel with higher speed
Definition at line 1424 of file MSVehicle.h.
Referenced by getLanechangeMode(), influenceChangeDecision(), and setLaneChangeMode().
|
private |
The velocity time line to apply.
Definition at line 1379 of file MSVehicle.h.
Referenced by getOriginalSpeed(), influenceSpeed(), and setSpeedTimeLine().
|
private |
lane changing which is necessary to follow the current route
Definition at line 1420 of file MSVehicle.h.
Referenced by getLanechangeMode(), influenceChangeDecision(), and setLaneChangeMode().
|
private |
changing to the prefered lateral alignment
Definition at line 1428 of file MSVehicle.h.
Referenced by getLanechangeMode(), influenceChangeDecision(), and setLaneChangeMode().
|
private |
flags for determining the priority of traci lane change requests
Definition at line 1431 of file MSVehicle.h.
Referenced by getLanechangeMode(), influenceChangeDecision(), and setLaneChangeMode().
|
private |
Definition at line 1434 of file MSVehicle.h.
|
private |
Definition at line 1412 of file MSVehicle.h.
Referenced by postProcessVTD(), and setVTDControlled().
|
private |
Definition at line 1413 of file MSVehicle.h.
Referenced by postProcessVTD(), and setVTDControlled().
|
private |
Definition at line 1409 of file MSVehicle.h.
Referenced by implicitDeltaPosVTD(), implicitSpeedVTD(), postProcessVTD(), and setVTDControlled().
|
private |
Definition at line 1410 of file MSVehicle.h.
Referenced by implicitDeltaPosVTD(), implicitSpeedVTD(), postProcessVTD(), and setVTDControlled().
|
private |
Definition at line 1411 of file MSVehicle.h.
Referenced by postProcessVTD(), and setVTDControlled().
|
private |
Definition at line 1414 of file MSVehicle.h.
Referenced by postProcessVTD(), and setVTDControlled().
|
private |
Definition at line 1408 of file MSVehicle.h.
Referenced by implicitDeltaPosVTD(), implicitSpeedVTD(), postProcessVTD(), and setVTDControlled().