SUMO - Simulation of Urban MObility
|
Changes the wished vehicle speed / lanes. More...
#include <MSVehicle.h>
Public Member Functions | |
ChangeRequest | checkForLaneChanges (SUMOTime currentTime, const MSEdge ¤tEdge, unsigned int currentLaneIndex) |
SUMOReal | getOriginalSpeed () const |
Returns the originally longitudianl speed to use. 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 | 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... | |
int | myVTDEdgeOffset |
MSLane * | myVTDLane |
SUMOReal | myVTDPos |
MSEdgeVector | myVTDRoute |
Changes the wished vehicle speed / lanes.
The class is used for passing velocities or velocity profiles obtained via TraCI to the vehicle.
The adaptation is controlled by the stored time line of speeds/lanes. Additionally, the variables myConsiderSafeVelocity, myConsiderMaxAcceleration, and myConsiderMaxDeceleration control whether the safe velocity, the maximum acceleration, and the maximum deceleration have to be regarded.
Definition at line 800 of file MSVehicle.h.
MSVehicle::Influencer::Influencer | ( | ) |
Constructor.
Definition at line 146 of file MSVehicle.cpp.
MSVehicle::Influencer::~Influencer | ( | ) |
Destructor.
Definition at line 152 of file MSVehicle.cpp.
MSVehicle::ChangeRequest MSVehicle::Influencer::checkForLaneChanges | ( | SUMOTime | currentTime, |
const MSEdge & | currentEdge, | ||
unsigned int | currentLaneIndex | ||
) |
Definition at line 202 of file MSVehicle.cpp.
References MSEdge::getLanes(), MSVehicle::REQUEST_HOLD, MSVehicle::REQUEST_LEFT, MSVehicle::REQUEST_NONE, and MSVehicle::REQUEST_RIGHT.
Referenced by MSVehicle::enterLaneAtLaneChange(), MSVehicle::enterLaneAtMove(), and TraCIServerAPI_Vehicle::processSet().
|
inline |
Returns the originally longitudianl speed to use.
Definition at line 860 of file MSVehicle.h.
References myOriginalSpeed.
Referenced by MSVehicle::getSpeedWithoutTraciInfluence().
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 169 of file MSVehicle.cpp.
References DELTA_T, MAX2(), MIN2(), STEPS2TIME, and SUMOReal.
Referenced by MSVehicle::executeMove(), and MSVehicle::planMove().
|
inline |
Definition at line 874 of file MSVehicle.h.
References myAmVTDControlled.
Referenced by MSLaneChanger::change(), MSVehicle::executeMove(), MSLane::executeMovements(), and MSVehicle::planMove().
void MSVehicle::Influencer::postProcessVTD | ( | MSVehicle * | v | ) |
Definition at line 244 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 232 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 238 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 226 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 163 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 156 of file MSVehicle.cpp.
Referenced by TraCIServerAPI_Vehicle::processSet().
|
inline |
Definition at line 864 of file MSVehicle.h.
References myAmVTDControlled, myVTDEdgeOffset, myVTDLane, myVTDPos, and myVTDRoute.
Referenced by traci::TraCIServer::setVTDControlled().
|
private |
Definition at line 900 of file MSVehicle.h.
Referenced by isVTDControlled(), and setVTDControlled().
|
private |
Whether the maximum acceleration shall be regarded.
Definition at line 895 of file MSVehicle.h.
|
private |
Whether the maximum deceleration shall be regarded.
Definition at line 898 of file MSVehicle.h.
|
private |
Whether the safe velocity shall be regarded.
Definition at line 892 of file MSVehicle.h.
The lane usage time line to apply.
Definition at line 883 of file MSVehicle.h.
|
private |
The velocity before influence.
Definition at line 886 of file MSVehicle.h.
Referenced by getOriginalSpeed().
|
private |
Whether influencing the speed has already started.
Definition at line 889 of file MSVehicle.h.
The velocity time line to apply.
Definition at line 880 of file MSVehicle.h.
|
private |
Definition at line 903 of file MSVehicle.h.
Referenced by setVTDControlled().
|
private |
Definition at line 901 of file MSVehicle.h.
Referenced by setVTDControlled().
|
private |
Definition at line 902 of file MSVehicle.h.
Referenced by setVTDControlled().
|
private |
Definition at line 904 of file MSVehicle.h.
Referenced by setVTDControlled().