SUMO - Simulation of Urban MObility
MSSOTLE2Sensors Class Reference

#include <MSSOTLE2Sensors.h>

Inheritance diagram for MSSOTLE2Sensors:
Inheritance graph
Collaboration diagram for MSSOTLE2Sensors:
Collaboration graph

Public Member Functions

void buildCountOutSensors (MSTrafficLightLogic::LaneVectorVector controlledLanes, NLDetectorBuilder &nb)
 
void buildCountSensors (MSTrafficLightLogic::LaneVectorVector controlledLanes, NLDetectorBuilder &nb)
 
void buildOutSensors (MSTrafficLightLogic::LaneVectorVector controlledLanes, NLDetectorBuilder &nb)
 This function member has to be extended to properly build sensors for the output lanes Sensors has to be constrained on lane dimension Built sensors has to be collected and associated properly to theirs MSLane for retrieval using MSSOTLSensors::countVehicles(std::string) See extension classes for further specifications on sensor building. More...
 
void buildOutSensors (MSTrafficLightLogic::LaneVectorVector controlledLanes, NLDetectorBuilder &nb, SUMOReal sensorLength)
 
void buildSensors (MSTrafficLightLogic::LaneVectorVector controlledLanes, NLDetectorBuilder &nb)
 This function member has to be extended to properly build sensors for the input lanes Sensors has to be constrained on lane dimension Built sensors has to be collected and associated properly to theirs MSLane for retrieval using MSSOTLSensors::countVehicles(std::string) See extension classes for further specifications on sensor building. More...
 
void buildSensors (MSTrafficLightLogic::LaneVectorVector controlledLanes, NLDetectorBuilder &nb, SUMOReal sensorLength)
 
int countVehicles (MSLane *lane)
 
int countVehicles (std::string laneId)
 
int estimateVehicles (std::string laneId)
 
SUMOReal getEstimateQueueLength (std::string laneId)
 
virtual SUMOReal getMaxSpeed (std::string laneId)
 
int getPassedVeh (std::string laneId, bool out)
 
virtual SUMOReal meanVehiclesSpeed (MSLane *lane)
 
virtual SUMOReal meanVehiclesSpeed (std::string laneId)
 
 MSSOTLE2Sensors (std::string tlLogicID, const MSTrafficLightLogic::Phases *phases)
 
void setSpeedThresholdParam (SUMOReal newThreshold)
 
virtual void setVehicleWeigths (const std::string &weightString)
 
virtual void stepChanged (unsigned int newStep)
 
void subtractPassedVeh (std::string laneId, int passed)
 
 ~MSSOTLE2Sensors (void)
 

Protected Member Functions

void buildContinueSensior (MSLane *lane, NLDetectorBuilder &nb, SUMOReal sensorLength, MSLane *continueOnLane, SUMOReal usedLength)
 
void buildCountSensorForLane (MSLane *lane, NLDetectorBuilder &nb)
 
void buildCountSensorForOutLane (MSLane *lane, NLDetectorBuilder &nb)
 
void buildSensorForLane (MSLane *lane, NLDetectorBuilder &nb)
 This function member has to be extended to properly build a sensor for a specific input lane Sensors has to be constrained on lane dimension Built sensors has to be collected and associated properly to the respective MSLane for retrieval using MSSOTLSensors::countVehicles(std::string) See extension classes for further specifications on sensor building. More...
 
void buildSensorForLane (MSLane *lane, NLDetectorBuilder &nb, SUMOReal sensorLength)
 
void buildSensorForOutLane (MSLane *lane, NLDetectorBuilder &nb)
 This function member has to be extended to properly build a sensor for a specific output lane Sensors has to be constrained on lane dimension Built sensors has to be collected and associated properly to the respective MSLane for retrieval using MSSOTLSensors::countVehicles(std::string) See extension classes for further specifications on sensor building. More...
 
void buildSensorForOutLane (MSLane *lane, NLDetectorBuilder &nb, SUMOReal sensorLength)
 
int count (MSE2Collector *sensor)
 
template<typename Method , typename ValueType >
bool getVelueFromSensor (std::string laneId, Method function, ValueType &value)
 

Protected Attributes

int currentStep
 
std::map< std::string, std::vector< std::string > > m_continueSensorOnLanes
 
MSLaneID_MaxSpeedMap m_maxSpeedMap
 
MSLaneID_MSE2CollectorMap m_sensorMap
 
std::map< const std::string, unsigned int > m_typeWeightMap
 
const MSTrafficLightLogic::PhasesmyPhases
 
SUMOReal speedThresholdParam
 
std::string tlLogicID
 

Detailed Description

Definition at line 34 of file MSSOTLE2Sensors.h.

Constructor & Destructor Documentation

MSSOTLE2Sensors::MSSOTLE2Sensors ( std::string  tlLogicID,
const MSTrafficLightLogic::Phases phases 
)

Definition at line 29 of file MSSOTLE2Sensors.cpp.

MSSOTLE2Sensors::~MSSOTLE2Sensors ( void  )

Definition at line 34 of file MSSOTLE2Sensors.cpp.

Member Function Documentation

void MSSOTLE2Sensors::buildCountOutSensors ( MSTrafficLightLogic::LaneVectorVector  controlledLanes,
NLDetectorBuilder nb 
)

Definition at line 82 of file MSSOTLE2Sensors.cpp.

References buildCountSensorForOutLane().

Referenced by MSSOTLTrafficLightLogic::init().

void MSSOTLE2Sensors::buildCountSensors ( MSTrafficLightLogic::LaneVectorVector  controlledLanes,
NLDetectorBuilder nb 
)

Definition at line 65 of file MSSOTLE2Sensors.cpp.

References buildCountSensorForLane().

Referenced by MSSOTLTrafficLightLogic::init().

void MSSOTLE2Sensors::buildOutSensors ( MSTrafficLightLogic::LaneVectorVector  controlledLanes,
NLDetectorBuilder nb 
)
virtual

This function member has to be extended to properly build sensors for the output lanes Sensors has to be constrained on lane dimension Built sensors has to be collected and associated properly to theirs MSLane for retrieval using MSSOTLSensors::countVehicles(std::string) See extension classes for further specifications on sensor building.

Implements MSSOTLSensors.

Definition at line 100 of file MSSOTLE2Sensors.cpp.

References OUTPUT_SENSOR_LENGTH.

void MSSOTLE2Sensors::buildOutSensors ( MSTrafficLightLogic::LaneVectorVector  controlledLanes,
NLDetectorBuilder nb,
SUMOReal  sensorLength 
)

Definition at line 105 of file MSSOTLE2Sensors.cpp.

References buildSensorForOutLane().

void MSSOTLE2Sensors::buildSensorForLane ( MSLane lane,
NLDetectorBuilder nb 
)
protectedvirtual

This function member has to be extended to properly build a sensor for a specific input lane Sensors has to be constrained on lane dimension Built sensors has to be collected and associated properly to the respective MSLane for retrieval using MSSOTLSensors::countVehicles(std::string) See extension classes for further specifications on sensor building.

Implements MSSOTLSensors.

Definition at line 263 of file MSSOTLE2Sensors.cpp.

References INPUT_SENSOR_LENGTH.

Referenced by buildSensors().

void MSSOTLE2Sensors::buildSensorForOutLane ( MSLane lane,
NLDetectorBuilder nb 
)
protectedvirtual

This function member has to be extended to properly build a sensor for a specific output lane Sensors has to be constrained on lane dimension Built sensors has to be collected and associated properly to the respective MSLane for retrieval using MSSOTLSensors::countVehicles(std::string) See extension classes for further specifications on sensor building.

Implements MSSOTLSensors.

Definition at line 349 of file MSSOTLE2Sensors.cpp.

References OUTPUT_SENSOR_LENGTH.

Referenced by buildOutSensors().

void MSSOTLE2Sensors::buildSensors ( MSTrafficLightLogic::LaneVectorVector  controlledLanes,
NLDetectorBuilder nb 
)
virtual

This function member has to be extended to properly build sensors for the input lanes Sensors has to be constrained on lane dimension Built sensors has to be collected and associated properly to theirs MSLane for retrieval using MSSOTLSensors::countVehicles(std::string) See extension classes for further specifications on sensor building.

Implements MSSOTLSensors.

Definition at line 38 of file MSSOTLE2Sensors.cpp.

References INPUT_SENSOR_LENGTH.

Referenced by MSSOTLTrafficLightLogic::init().

void MSSOTLE2Sensors::buildSensors ( MSTrafficLightLogic::LaneVectorVector  controlledLanes,
NLDetectorBuilder nb,
SUMOReal  sensorLength 
)

Definition at line 44 of file MSSOTLE2Sensors.cpp.

References buildSensorForLane().

int MSSOTLE2Sensors::count ( MSE2Collector sensor)
protected
int MSSOTLE2Sensors::countVehicles ( MSLane lane)
virtual

Implements MSSOTLSensors.

Definition at line 400 of file MSSOTLE2Sensors.cpp.

References Named::getID().

Referenced by setSpeedThresholdParam().

int MSSOTLE2Sensors::countVehicles ( std::string  laneId)
virtual

Implements MSSOTLSensors.

Definition at line 448 of file MSSOTLE2Sensors.cpp.

References count(), m_continueSensorOnLanes, and m_sensorMap.

int MSSOTLE2Sensors::estimateVehicles ( std::string  laneId)

Definition at line 432 of file MSSOTLE2Sensors.cpp.

References m_continueSensorOnLanes, m_sensorMap, and speedThresholdParam.

Referenced by setSpeedThresholdParam().

SUMOReal MSSOTLE2Sensors::getEstimateQueueLength ( std::string  laneId)

Definition at line 408 of file MSSOTLE2Sensors.cpp.

References DBG, m_sensorMap, SUMOReal, and WRITE_MESSAGE.

Referenced by setSpeedThresholdParam().

SUMOReal MSSOTLE2Sensors::getMaxSpeed ( std::string  laneId)
virtual

Implements MSSOTLSensors.

Definition at line 465 of file MSSOTLE2Sensors.cpp.

References m_maxSpeedMap, and WRITE_ERROR.

Referenced by setSpeedThresholdParam().

template<typename Method , typename ValueType >
bool MSSOTLE2Sensors::getVelueFromSensor ( std::string  laneId,
Method  function,
ValueType &  value 
)
inlineprotected

Definition at line 132 of file MSSOTLE2Sensors.h.

References m_sensorMap.

Referenced by getPassedVeh(), and meanVehiclesSpeed().

SUMOReal MSSOTLE2Sensors::meanVehiclesSpeed ( MSLane lane)
virtual

Implements MSSOTLSensors.

Definition at line 475 of file MSSOTLE2Sensors.cpp.

References Named::getID().

Referenced by setSpeedThresholdParam().

SUMOReal MSSOTLE2Sensors::meanVehiclesSpeed ( std::string  laneId)
virtual
void MSSOTLE2Sensors::setSpeedThresholdParam ( SUMOReal  newThreshold)
inline
void MSSOTLE2Sensors::setVehicleWeigths ( const std::string &  weightString)
virtual

Definition at line 523 of file MSSOTLE2Sensors.cpp.

References TplConvert::_2int(), m_typeWeightMap, split(), trim(), and WRITE_MESSAGE.

Referenced by setSpeedThresholdParam().

virtual void MSSOTLSensors::stepChanged ( unsigned int  newStep)
inlinevirtualinherited
void MSSOTLE2Sensors::subtractPassedVeh ( std::string  laneId,
int  passed 
)

Field Documentation

int MSSOTLSensors::currentStep
protectedinherited

Definition at line 44 of file MSSOTLSensors.h.

std::map<std::string, std::vector<std::string> > MSSOTLE2Sensors::m_continueSensorOnLanes
protected
MSLaneID_MaxSpeedMap MSSOTLE2Sensors::m_maxSpeedMap
protected
std::map<const std::string, unsigned int> MSSOTLE2Sensors::m_typeWeightMap
protected

Definition at line 150 of file MSSOTLE2Sensors.h.

Referenced by count(), and setVehicleWeigths().

const MSTrafficLightLogic::Phases* MSSOTLSensors::myPhases
protectedinherited

Definition at line 42 of file MSSOTLSensors.h.

Referenced by MSSOTLSensors::MSSOTLSensors().

SUMOReal MSSOTLE2Sensors::speedThresholdParam
protected

Definition at line 148 of file MSSOTLE2Sensors.h.

Referenced by estimateVehicles(), and setSpeedThresholdParam().

std::string MSSOTLSensors::tlLogicID
protectedinherited

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