SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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.
bool isVTDControlled () const
void postProcessVTD (MSVehicle *v)
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.
void setVTDControlled (bool c, MSLane *l, SUMOReal pos, int edgeOffset, const MSEdgeVector &route)
 ~Influencer ()
 Destructor.

Private Attributes

bool myAmVTDControlled
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.
int myVTDEdgeOffset
MSLanemyVTDLane
SUMOReal myVTDPos
MSEdgeVector myVTDRoute

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

Constructor & Destructor Documentation

MSVehicle::Influencer::Influencer ( )

Constructor.

Definition at line 146 of file MSVehicle.cpp.

MSVehicle::Influencer::~Influencer ( )

Destructor.

Definition at line 152 of file MSVehicle.cpp.

Member Function Documentation

MSVehicle::ChangeRequest MSVehicle::Influencer::checkForLaneChanges ( SUMOTime  currentTime,
const MSEdge currentEdge,
unsigned int  currentLaneIndex 
)
SUMOReal MSVehicle::Influencer::getOriginalSpeed ( ) const
inline

Returns the originally longitudianl speed to use.

Returns
The speed given before influence

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".

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 169 of file MSVehicle.cpp.

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

Referenced by MSVehicle::executeMove(), and MSVehicle::planMove().

bool MSVehicle::Influencer::isVTDControlled ( ) const
inline
void MSVehicle::Influencer::setConsiderMaxAcceleration ( bool  value)

Sets whether the maximum acceleration shall be regarded.

Parameters
[in]valueWhether 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.

Parameters
[in]valueWhether 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.

Parameters
[in]valueWhether 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.

Parameters
[in]laneTimeLineThe 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.

Parameters
[in]speedTimeLineThe time line of speeds to use

Definition at line 156 of file MSVehicle.cpp.

Referenced by TraCIServerAPI_Vehicle::processSet().

void MSVehicle::Influencer::setVTDControlled ( bool  c,
MSLane l,
SUMOReal  pos,
int  edgeOffset,
const MSEdgeVector route 
)
inline

Field Documentation

bool MSVehicle::Influencer::myAmVTDControlled
private

Definition at line 900 of file MSVehicle.h.

Referenced by isVTDControlled(), and setVTDControlled().

bool MSVehicle::Influencer::myConsiderMaxAcceleration
private

Whether the maximum acceleration shall be regarded.

Definition at line 895 of file MSVehicle.h.

bool MSVehicle::Influencer::myConsiderMaxDeceleration
private

Whether the maximum deceleration shall be regarded.

Definition at line 898 of file MSVehicle.h.

bool MSVehicle::Influencer::myConsiderSafeVelocity
private

Whether the safe velocity shall be regarded.

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

SUMOReal MSVehicle::Influencer::myOriginalSpeed
private

The velocity before influence.

Definition at line 886 of file MSVehicle.h.

Referenced by getOriginalSpeed().

bool MSVehicle::Influencer::mySpeedAdaptationStarted
private

Whether influencing the speed has already started.

Definition at line 889 of file MSVehicle.h.

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

The velocity time line to apply.

Definition at line 880 of file MSVehicle.h.

int MSVehicle::Influencer::myVTDEdgeOffset
private

Definition at line 903 of file MSVehicle.h.

Referenced by setVTDControlled().

MSLane* MSVehicle::Influencer::myVTDLane
private

Definition at line 901 of file MSVehicle.h.

Referenced by setVTDControlled().

SUMOReal MSVehicle::Influencer::myVTDPos
private

Definition at line 902 of file MSVehicle.h.

Referenced by setVTDControlled().

MSEdgeVector MSVehicle::Influencer::myVTDRoute
private

Definition at line 904 of file MSVehicle.h.

Referenced by setVTDControlled().


The documentation for this class was generated from the following files: