SUMO - Simulation of Urban MObility
MSVehicle::Influencer Class Reference

Changes the wished vehicle speed / lanes. More...

#include <MSVehicle.h>

Public Member Functions

ChangeRequest checkForLaneChanges (SUMOTime currentTime, const MSEdge &currentEdge, 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.

Detailed Description

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 782 of file MSVehicle.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 146 of file MSVehicle.cpp.

Destructor.

Definition at line 151 of file MSVehicle.cpp.


Member Function Documentation

Returns the originally longitudianl speed to use.

Returns:
The speed given before influence

Definition at line 842 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".

Parameters:
[in]currentTimeThe current simulation time
[in]speedThe undisturbed speed
[in]vSafeThe safe velocity
[in]vMinThe minimum velocity
[in]vMaxThe maximum simulation time
Returns:
The speed to use

Definition at line 168 of file MSVehicle.cpp.

References DELTA_T, MAX2(), MIN2(), STEPS2TIME, and SUMOReal.

Referenced by MSVehicle::moveChecked(), and MSVehicle::vsafeCriticalCont().

Sets whether the maximum acceleration shall be regarded.

Parameters:
[in]valueWhether the maximum acceleration shall be regarded

Definition at line 231 of file MSVehicle.cpp.

Sets whether the maximum deceleration shall be regarded.

Parameters:
[in]valueWhether the maximum deceleration shall be regarded

Definition at line 237 of file MSVehicle.cpp.

Sets whether the safe velocity shall be regarded.

Parameters:
[in]valueWhether the safe velocity shall be regarded

Definition at line 225 of file MSVehicle.cpp.

void MSVehicle::Influencer::setLaneTimeLine ( const std::vector< std::pair< SUMOTime, unsigned int > > &  laneTimeLine)

Sets a new lane timeline.

Parameters:
[in]laneTimeLineThe time line of lanes to use

Definition at line 162 of file MSVehicle.cpp.

void MSVehicle::Influencer::setSpeedTimeLine ( const std::vector< std::pair< SUMOTime, SUMOReal > > &  speedTimeLine)

Sets a new velocity timeline.

Parameters:
[in]speedTimeLineThe time line of speeds to use

Definition at line 155 of file MSVehicle.cpp.


Field Documentation

Whether the maximum acceleration shall be regarded.

Definition at line 864 of file MSVehicle.h.

Whether the maximum deceleration shall be regarded.

Definition at line 867 of file MSVehicle.h.

Whether the safe velocity shall be regarded.

Definition at line 861 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 852 of file MSVehicle.h.

The velocity before influence.

Definition at line 855 of file MSVehicle.h.

Referenced by getOriginalSpeed().

Whether influencing the speed has already started.

Definition at line 858 of file MSVehicle.h.

std::vector<std::pair<SUMOTime, SUMOReal> > MSVehicle::Influencer::mySpeedTimeLine [private]

The velocity time line to apply.

Definition at line 849 of file MSVehicle.h.


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines