|
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. | |
| Influencer () | |
| Constructor. | |
| SUMOReal | influenceSpeed (SUMOTime currentTime, SUMOReal speed, SUMOReal vSafe, SUMOReal vMin, SUMOReal vMax) |
| Applies stored velocity information on the speed to use. | |
| void | setConsiderMaxAcceleration (bool value) |
| Sets whether the maximum acceleration shall be regarded. | |
| void | setConsiderMaxDeceleration (bool value) |
| Sets whether the maximum deceleration shall be regarded. | |
| void | setConsiderSafeVelocity (bool value) |
| Sets whether the safe velocity shall be regarded. | |
| void | setLaneTimeLine (const std::vector< std::pair< SUMOTime, unsigned int > > &laneTimeLine) |
| Sets a new lane timeline. | |
| void | setSpeedTimeLine (const std::vector< std::pair< SUMOTime, SUMOReal > > &speedTimeLine) |
| Sets a new velocity timeline. | |
| ~Influencer () | |
| Destructor. | |
Private Attributes | |
| bool | myConsiderMaxAcceleration |
| Whether the maximum acceleration shall be regarded. | |
| bool | myConsiderMaxDeceleration |
| Whether the maximum deceleration shall be regarded. | |
| bool | myConsiderSafeVelocity |
| Whether the safe velocity shall be regarded. | |
| std::vector< std::pair < SUMOTime, unsigned int > > | myLaneTimeLine |
| The lane usage time line to apply. | |
| SUMOReal | myOriginalSpeed |
| The velocity before influence. | |
| bool | mySpeedAdaptationStarted |
| Whether influencing the speed has already started. | |
| std::vector< std::pair < SUMOTime, SUMOReal > > | mySpeedTimeLine |
| The velocity time line to apply. | |
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 794 of file MSVehicle.h.
| MSVehicle::Influencer::Influencer | ( | ) |
Constructor.
Definition at line 144 of file MSVehicle.cpp.
| MSVehicle::Influencer::~Influencer | ( | ) |
Destructor.
Definition at line 149 of file MSVehicle.cpp.
| MSVehicle::ChangeRequest MSVehicle::Influencer::checkForLaneChanges | ( | SUMOTime | currentTime, |
| const MSEdge & | currentEdge, | ||
| unsigned int | currentLaneIndex | ||
| ) |
Definition at line 199 of file MSVehicle.cpp.
References MSEdge::getLanes(), MSVehicle::REQUEST_HOLD, MSVehicle::REQUEST_LEFT, MSVehicle::REQUEST_NONE, and MSVehicle::REQUEST_RIGHT.
Referenced by MSVehicle::enterLaneAtLaneChange(), and MSVehicle::enterLaneAtMove().
| SUMOReal MSVehicle::Influencer::getOriginalSpeed | ( | ) | const [inline] |
Returns the originally longitudianl speed to use.
Definition at line 854 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 166 of file MSVehicle.cpp.
References DELTA_T, MAX2(), MIN2(), STEPS2TIME, and SUMOReal.
Referenced by MSVehicle::moveChecked(), and MSVehicle::vsafeCriticalCont().
| 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 229 of file MSVehicle.cpp.
| 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 235 of file MSVehicle.cpp.
| 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 223 of file MSVehicle.cpp.
| 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 160 of file MSVehicle.cpp.
| 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 153 of file MSVehicle.cpp.
Whether the maximum acceleration shall be regarded.
Definition at line 876 of file MSVehicle.h.
Whether the maximum deceleration shall be regarded.
Definition at line 879 of file MSVehicle.h.
Whether the safe velocity shall be regarded.
Definition at line 873 of file MSVehicle.h.
std::vector<std::pair<SUMOTime, unsigned int> > MSVehicle::Influencer::myLaneTimeLine [private] |
The lane usage time line to apply.
Definition at line 864 of file MSVehicle.h.
SUMOReal MSVehicle::Influencer::myOriginalSpeed [private] |
The velocity before influence.
Definition at line 867 of file MSVehicle.h.
Referenced by getOriginalSpeed().
Whether influencing the speed has already started.
Definition at line 870 of file MSVehicle.h.
std::vector<std::pair<SUMOTime, SUMOReal> > MSVehicle::Influencer::mySpeedTimeLine [private] |
The velocity time line to apply.
Definition at line 861 of file MSVehicle.h.