SUMO - Simulation of Urban MObility
|
Changes the wished vehicle speed / lanes. More...
#include <MSVehicle.h>
Public Member Functions | |
SUMOReal | changeRequestRemainingSeconds (const SUMOTime currentTime) const |
Return the remaining number of seconds of the current laneTimeLine assuming one exists. More... | |
SUMOReal | getOriginalSpeed () const |
Returns the originally longitudinal speed to use. More... | |
int | influenceChangeDecision (const SUMOTime currentTime, const MSEdge ¤tEdge, const unsigned int currentLaneIndex, int state) |
Applies stored LaneChangeMode information and laneTimeLine. More... | |
Influencer () | |
Constructor. More... | |
SUMOReal | influenceSpeed (SUMOTime currentTime, SUMOReal speed, SUMOReal vSafe, SUMOReal vMin, SUMOReal vMax) |
Applies stored velocity information on the speed to use. More... | |
bool | isVTDControlled () const |
void | postProcessVTD (MSVehicle *v) |
void | setConsiderMaxAcceleration (bool value) |
Sets whether the maximum acceleration shall be regarded. More... | |
void | setConsiderMaxDeceleration (bool value) |
Sets whether the maximum deceleration shall be regarded. More... | |
void | setConsiderSafeVelocity (bool value) |
Sets whether the safe velocity shall be regarded. More... | |
void | setLaneChangeMode (int value) |
Sets lane changing behavior. More... | |
void | setLaneTimeLine (const std::vector< std::pair< SUMOTime, unsigned int > > &laneTimeLine) |
Sets a new lane timeline. More... | |
void | setSpeedTimeLine (const std::vector< std::pair< SUMOTime, SUMOReal > > &speedTimeLine) |
Sets a new velocity timeline. More... | |
void | setVTDControlled (bool c, MSLane *l, SUMOReal pos, int edgeOffset, const MSEdgeVector &route) |
~Influencer () | |
Destructor. More... | |
Private Attributes | |
bool | myAmVTDControlled |
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... | |
std::vector< std::pair < SUMOTime, unsigned int > > | myLaneTimeLine |
The lane usage time line to apply. More... | |
SUMOReal | myOriginalSpeed |
The velocity before influence. More... | |
bool | mySpeedAdaptationStarted |
Whether influencing the speed has already started. More... | |
std::vector< std::pair < SUMOTime, SUMOReal > > | mySpeedTimeLine |
The velocity time line to apply. More... | |
TraciLaneChangePriority | myTraciLaneChangePriority |
flags for determining the priority of traci lane change requests More... | |
int | myVTDEdgeOffset |
MSLane * | myVTDLane |
SUMOReal | myVTDPos |
MSEdgeVector | myVTDRoute |
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... | |
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 818 of file MSVehicle.h.
MSVehicle::Influencer::Influencer | ( | ) |
Constructor.
Definition at line 146 of file MSVehicle.cpp.
MSVehicle::Influencer::~Influencer | ( | ) |
Destructor.
Definition at line 160 of file MSVehicle.cpp.
Return the remaining number of seconds of the current laneTimeLine assuming one exists.
[in] | currentTime | The current simulation time |
Definition at line 292 of file MSVehicle.cpp.
References STEPS2TIME.
Referenced by MSLCM_JE2013::_wantsChange(), and MSLCM_LC2013::_wantsChange().
|
inline |
Returns the originally longitudinal speed to use.
Definition at line 897 of file MSVehicle.h.
References myOriginalSpeed.
Referenced by MSVehicle::getSpeedWithoutTraciInfluence().
int MSVehicle::Influencer::influenceChangeDecision | ( | const SUMOTime | currentTime, |
const MSEdge & | currentEdge, | ||
const unsigned 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 210 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_TRACI, LCA_URGENT, LCA_WANTS_LANECHANGE_OR_STAY, MSVehicle::LCP_ALWAYS, MSVehicle::LCP_NOOVERLAP, MSVehicle::LCP_OPPORTUNISTIC, MSVehicle::REQUEST_HOLD, MSVehicle::REQUEST_LEFT, MSVehicle::REQUEST_NONE, MSVehicle::REQUEST_RIGHT, time2string(), toString(), and WRITE_WARNING.
Referenced by MSVehicle::influenceChangeDecision().
SUMOReal MSVehicle::Influencer::influenceSpeed | ( | SUMOTime | currentTime, |
SUMOReal | speed, | ||
SUMOReal | vSafe, | ||
SUMOReal | vMin, | ||
SUMOReal | 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 177 of file MSVehicle.cpp.
References DELTA_T, MAX2(), MIN2(), STEPS2TIME, and SUMOReal.
Referenced by MSVehicle::executeMove(), and MSVehicle::planMoveInternal().
|
inline |
Definition at line 911 of file MSVehicle.h.
References myAmVTDControlled.
Referenced by MSLaneChanger::change(), MSVehicle::executeMove(), MSLane::executeMovements(), and MSVehicle::planMoveInternal().
void MSVehicle::Influencer::postProcessVTD | ( | MSVehicle * | v | ) |
Definition at line 328 of file MSVehicle.cpp.
References MSVehicle::getBestLanes(), MSVehicle::getLane(), MSBaseVehicle::myCurrEdge, MSMoveReminder::NOTIFICATION_TELEPORT, MSVehicle::onRemovalFromNet(), MSLane::removeVehicle(), and MSBaseVehicle::replaceRouteEdges().
void MSVehicle::Influencer::setConsiderMaxAcceleration | ( | bool | value | ) |
Sets whether the maximum acceleration shall be regarded.
[in] | value | Whether the maximum acceleration shall be regarded |
Definition at line 306 of file MSVehicle.cpp.
Referenced by TraCIServerAPI_Vehicle::processSet().
void MSVehicle::Influencer::setConsiderMaxDeceleration | ( | bool | value | ) |
Sets whether the maximum deceleration shall be regarded.
[in] | value | Whether the maximum deceleration shall be regarded |
Definition at line 322 of file MSVehicle.cpp.
Referenced by TraCIServerAPI_Vehicle::processSet().
void MSVehicle::Influencer::setConsiderSafeVelocity | ( | bool | value | ) |
Sets whether the safe velocity shall be regarded.
[in] | value | Whether the safe velocity shall be regarded |
Definition at line 300 of file MSVehicle.cpp.
Referenced by TraCIServerAPI_Vehicle::processSet().
void MSVehicle::Influencer::setLaneChangeMode | ( | int | value | ) |
Sets lane changing behavior.
[in] | value | a bitset controlling the different modes |
Definition at line 312 of file MSVehicle.cpp.
Referenced by TraCIServerAPI_Vehicle::processSet().
void MSVehicle::Influencer::setLaneTimeLine | ( | const std::vector< std::pair< SUMOTime, unsigned int > > & | laneTimeLine | ) |
Sets a new lane timeline.
[in] | laneTimeLine | The time line of lanes to use |
Definition at line 171 of file MSVehicle.cpp.
Referenced by TraCIServerAPI_Vehicle::processSet().
void MSVehicle::Influencer::setSpeedTimeLine | ( | const std::vector< std::pair< SUMOTime, SUMOReal > > & | speedTimeLine | ) |
Sets a new velocity timeline.
[in] | speedTimeLine | The time line of speeds to use |
Definition at line 164 of file MSVehicle.cpp.
Referenced by TraCIServerAPI_Vehicle::processSet().
|
inline |
Definition at line 901 of file MSVehicle.h.
References myAmVTDControlled, myVTDEdgeOffset, myVTDLane, myVTDPos, and myVTDRoute.
Referenced by TraCIServer::setVTDControlled().
|
private |
Definition at line 937 of file MSVehicle.h.
Referenced by isVTDControlled(), and setVTDControlled().
|
private |
Whether the maximum acceleration shall be regarded.
Definition at line 932 of file MSVehicle.h.
|
private |
Whether the maximum deceleration shall be regarded.
Definition at line 935 of file MSVehicle.h.
|
private |
Whether the safe velocity shall be regarded.
Definition at line 929 of file MSVehicle.h.
|
private |
lane changing with the intent to help other vehicles
Definition at line 948 of file MSVehicle.h.
The lane usage time line to apply.
Definition at line 920 of file MSVehicle.h.
|
private |
The velocity before influence.
Definition at line 923 of file MSVehicle.h.
Referenced by getOriginalSpeed().
|
private |
changing to the rightmost lane
Definition at line 952 of file MSVehicle.h.
|
private |
Whether influencing the speed has already started.
Definition at line 926 of file MSVehicle.h.
|
private |
lane changing to travel with higher speed
Definition at line 950 of file MSVehicle.h.
The velocity time line to apply.
Definition at line 917 of file MSVehicle.h.
|
private |
lane changing which is necessary to follow the current route
Definition at line 946 of file MSVehicle.h.
|
private |
flags for determining the priority of traci lane change requests
Definition at line 955 of file MSVehicle.h.
|
private |
Definition at line 940 of file MSVehicle.h.
Referenced by setVTDControlled().
|
private |
Definition at line 938 of file MSVehicle.h.
Referenced by setVTDControlled().
|
private |
Definition at line 939 of file MSVehicle.h.
Referenced by setVTDControlled().
|
private |
Definition at line 941 of file MSVehicle.h.
Referenced by setVTDControlled().