Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSSOTLE2Sensors Class Reference

#include <MSSOTLE2Sensors.h>

Inheritance diagram for MSSOTLE2Sensors:
[legend]
Collaboration diagram for MSSOTLE2Sensors:
[legend]

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.
 
void buildOutSensors (MSTrafficLightLogic::LaneVectorVector controlledLanes, NLDetectorBuilder &nb, double 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.
 
void buildSensors (MSTrafficLightLogic::LaneVectorVector controlledLanes, NLDetectorBuilder &nb, double sensorLength)
 
int countVehicles (MSLane *lane)
 
int countVehicles (std::string laneId)
 
int estimateVehicles (std::string laneId)
 
double getEstimateQueueLength (std::string laneId)
 
virtual double getMaxSpeed (std::string laneId)
 
int getPassedVeh (std::string laneId, bool out)
 
virtual double meanVehiclesSpeed (MSLane *lane)
 
virtual double meanVehiclesSpeed (std::string laneId)
 
 MSSOTLE2Sensors (std::string tlLogicID, const MSTrafficLightLogic::Phases *phases)
 
void setSpeedThresholdParam (double newThreshold)
 
virtual void setVehicleWeigths (const std::string &weightString)
 
virtual void stepChanged (int newStep)
 
void subtractPassedVeh (std::string laneId, int passed)
 
 ~MSSOTLE2Sensors (void)
 

Protected Member Functions

void buildContinueSensior (MSLane *lane, NLDetectorBuilder &nb, double sensorLength, MSLane *continueOnLane, double 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.
 
void buildSensorForLane (MSLane *lane, NLDetectorBuilder &nb, double 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.
 
void buildSensorForOutLane (MSLane *lane, NLDetectorBuilder &nb, double 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, int > m_typeWeightMap
 
const MSTrafficLightLogic::PhasesmyPhases
 
double speedThresholdParam
 
std::string tlLogicID
 

Detailed Description

Definition at line 34 of file MSSOTLE2Sensors.h.

Constructor & Destructor Documentation

◆ MSSOTLE2Sensors()

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

Definition at line 31 of file MSSOTLE2Sensors.cpp.

◆ ~MSSOTLE2Sensors()

MSSOTLE2Sensors::~MSSOTLE2Sensors ( void  )

Definition at line 36 of file MSSOTLE2Sensors.cpp.

Member Function Documentation

◆ buildContinueSensior()

void MSSOTLE2Sensors::buildContinueSensior ( MSLane lane,
NLDetectorBuilder nb,
double  sensorLength,
MSLane continueOnLane,
double  usedLength 
)
protected

◆ buildCountOutSensors()

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

Definition at line 84 of file MSSOTLE2Sensors.cpp.

References buildCountSensorForOutLane().

Referenced by MSSOTLTrafficLightLogic::init().

Here is the caller graph for this function:

◆ buildCountSensorForLane()

void MSSOTLE2Sensors::buildCountSensorForLane ( MSLane lane,
NLDetectorBuilder nb 
)
protected

◆ buildCountSensorForOutLane()

void MSSOTLE2Sensors::buildCountSensorForOutLane ( MSLane lane,
NLDetectorBuilder nb 
)
protected

◆ buildCountSensors()

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

Definition at line 67 of file MSSOTLE2Sensors.cpp.

References buildCountSensorForLane().

Referenced by MSSOTLTrafficLightLogic::init().

Here is the caller graph for this function:

◆ buildOutSensors() [1/2]

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 102 of file MSSOTLE2Sensors.cpp.

References buildOutSensors(), and OUTPUT_SENSOR_LENGTH.

Referenced by buildOutSensors().

Here is the caller graph for this function:

◆ buildOutSensors() [2/2]

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

Definition at line 107 of file MSSOTLE2Sensors.cpp.

References buildSensorForOutLane().

◆ buildSensorForLane() [1/2]

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 243 of file MSSOTLE2Sensors.cpp.

References buildSensorForLane(), and INPUT_SENSOR_LENGTH.

Referenced by buildSensorForLane(), and buildSensors().

Here is the caller graph for this function:

◆ buildSensorForLane() [2/2]

◆ buildSensorForOutLane() [1/2]

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 328 of file MSSOTLE2Sensors.cpp.

References buildSensorForOutLane(), and OUTPUT_SENSOR_LENGTH.

Referenced by buildOutSensors(), and buildSensorForOutLane().

Here is the caller graph for this function:

◆ buildSensorForOutLane() [2/2]

◆ buildSensors() [1/2]

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 40 of file MSSOTLE2Sensors.cpp.

References buildSensors(), and INPUT_SENSOR_LENGTH.

Referenced by buildSensors().

Here is the caller graph for this function:

◆ buildSensors() [2/2]

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

Definition at line 46 of file MSSOTLE2Sensors.cpp.

References buildSensorForLane().

◆ count()

int MSSOTLE2Sensors::count ( MSE2Collector sensor)
protected

Definition at line 521 of file MSSOTLE2Sensors.cpp.

References MSE2Collector::getCurrentVehicleNumber(), MSE2Collector::getCurrentVehicles(), and m_typeWeightMap.

Referenced by countVehicles().

Here is the caller graph for this function:

◆ countVehicles() [1/2]

int MSSOTLE2Sensors::countVehicles ( MSLane lane)
virtual

Implements MSSOTLSensors.

Definition at line 378 of file MSSOTLE2Sensors.cpp.

References countVehicles(), and Named::getID().

Referenced by countVehicles().

Here is the caller graph for this function:

◆ countVehicles() [2/2]

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

Implements MSSOTLSensors.

Definition at line 428 of file MSSOTLE2Sensors.cpp.

References count(), m_continueSensorOnLanes, and m_sensorMap.

◆ estimateVehicles()

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

Definition at line 412 of file MSSOTLE2Sensors.cpp.

References m_continueSensorOnLanes, m_sensorMap, and speedThresholdParam.

◆ getEstimateQueueLength()

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

Definition at line 386 of file MSSOTLE2Sensors.cpp.

References m_sensorMap.

◆ getMaxSpeed()

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

Implements MSSOTLSensors.

Definition at line 445 of file MSSOTLE2Sensors.cpp.

References m_maxSpeedMap, and WRITE_ERROR.

◆ getPassedVeh()

int MSSOTLE2Sensors::getPassedVeh ( std::string  laneId,
bool  out 
)

Definition at line 211 of file MSSOTLE2Sensors.cpp.

References MSE2Collector::getPassedVeh(), getVelueFromSensor(), m_continueSensorOnLanes, and m_sensorMap.

Referenced by MSSwarmTrafficLightLogic::calculateEtaDiff(), MSSwarmTrafficLightLogic::calculateEtaRatio(), and MSSwarmTrafficLightLogic::updatePheromoneLevels().

Here is the caller graph for this function:

◆ getVelueFromSensor()

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().

Here is the caller graph for this function:

◆ meanVehiclesSpeed() [1/2]

double MSSOTLE2Sensors::meanVehiclesSpeed ( MSLane lane)
virtual

Implements MSSOTLSensors.

Definition at line 455 of file MSSOTLE2Sensors.cpp.

References Named::getID(), and meanVehiclesSpeed().

Referenced by meanVehiclesSpeed().

Here is the caller graph for this function:

◆ meanVehiclesSpeed() [2/2]

double MSSOTLE2Sensors::meanVehiclesSpeed ( std::string  laneId)
virtual

◆ setSpeedThresholdParam()

void MSSOTLE2Sensors::setSpeedThresholdParam ( double  newThreshold)
inline

Definition at line 78 of file MSSOTLE2Sensors.h.

References speedThresholdParam.

◆ setVehicleWeigths()

void MSSOTLE2Sensors::setVehicleWeigths ( const std::string &  weightString)
virtual

Definition at line 503 of file MSSOTLE2Sensors.cpp.

References m_typeWeightMap, split(), StringUtils::toInt(), trim(), and WRITE_MESSAGE.

◆ stepChanged()

virtual void MSSOTLSensors::stepChanged ( int  newStep)
inlinevirtualinherited

Definition at line 126 of file MSSOTLSensors.h.

References MSSOTLSensors::currentStep.

Referenced by MSSOTLTrafficLightLogic::init(), and MSSOTLTrafficLightLogic::trySwitch().

Here is the caller graph for this function:

◆ subtractPassedVeh()

void MSSOTLE2Sensors::subtractPassedVeh ( std::string  laneId,
int  passed 
)

Definition at line 231 of file MSSOTLE2Sensors.cpp.

References m_sensorMap.

Referenced by MSSwarmTrafficLightLogic::calculateEtaDiff(), and MSSwarmTrafficLightLogic::calculateEtaRatio().

Here is the caller graph for this function:

Field Documentation

◆ currentStep

int MSSOTLSensors::currentStep
protectedinherited

Definition at line 35 of file MSSOTLSensors.h.

Referenced by MSSOTLSensors::stepChanged().

◆ m_continueSensorOnLanes

std::map<std::string, std::vector<std::string> > MSSOTLE2Sensors::m_continueSensorOnLanes
protected

◆ m_maxSpeedMap

MSLaneID_MaxSpeedMap MSSOTLE2Sensors::m_maxSpeedMap
protected

◆ m_sensorMap

◆ m_typeWeightMap

std::map<const std::string, int> MSSOTLE2Sensors::m_typeWeightMap
protected

Definition at line 150 of file MSSOTLE2Sensors.h.

Referenced by count(), and setVehicleWeigths().

◆ myPhases

const MSTrafficLightLogic::Phases* MSSOTLSensors::myPhases
protectedinherited

Definition at line 33 of file MSSOTLSensors.h.

Referenced by MSSOTLSensors::MSSOTLSensors().

◆ speedThresholdParam

double MSSOTLE2Sensors::speedThresholdParam
protected

Definition at line 148 of file MSSOTLE2Sensors.h.

Referenced by estimateVehicles(), and setSpeedThresholdParam().

◆ tlLogicID

std::string MSSOTLSensors::tlLogicID
protectedinherited

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