Eclipse SUMO - Simulation of Urban MObility
MSSOTLPolicy Class Referenceabstract

Class for a low-level policy. More...

#include <MSSOTLPolicy.h>

Inheritance diagram for MSSOTLPolicy:
Collaboration diagram for MSSOTLPolicy:

Public Member Functions

virtual bool canRelease (SUMOTime elapsed, bool thresholdPassed, bool pushButtonPressed, const MSPhaseDefinition *stage, int vehicleCount)=0
 
void clearParameter ()
 Clears the parameter map. More...
 
double computeDesirability (double vehInMeasure, double vehOutMeasure)
 
double computeDesirability (double vehInMeasure, double vehOutMeasure, double vehInDispersionMeasure, double vehOutDispersionMeasure)
 Computes the desirability of this policy, necessary when used in combination with an high level policy. More...
 
virtual int decideNextPhase (SUMOTime elapsed, const MSPhaseDefinition *stage, int currentPhaseIndex, int phaseMaxCTS, bool thresholdPassed, bool pushButtonPressed, int vehicleCount)
 
MSSOTLPolicyDesirabilitygetDesirabilityAlgorithm ()
 
double getDouble (const std::string &key, const double defaultValue) const
 Returns the value for a given key converted to a double. More...
 
std::string getName ()
 
const std::string getParameter (const std::string &key, const std::string &defaultValue="") const
 Returns the value for a given key. More...
 
const std::map< std::string, std::string > & getParametersMap () const
 Returns the inner key/value map. More...
 
std::string getParametersStr () const
 Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN". More...
 
virtual double getThetaSensitivity ()
 
bool knowsParameter (const std::string &key) const
 Returns whether the parameter is known. More...
 
 MSSOTLPolicy (std::string name, const std::map< std::string, std::string > &parameters)
 Simple constructor. More...
 
 MSSOTLPolicy (std::string name, MSSOTLPolicyDesirability *desirabilityAlgorithm)
 Constructor when the policy is a low-level policy used by an high level policy. More...
 
 MSSOTLPolicy (std::string name, MSSOTLPolicyDesirability *desirabilityAlgorithm, const std::map< std::string, std::string > &parameters)
 Constructor when the policy is a low-level policy used by an high level policy. More...
 
void setParameter (const std::string &key, const std::string &value)
 Sets a parameter. More...
 
void setParameters (const Parameterised &params)
 set the inner key/value map in map<string, string> format More...
 
void setParametersMap (const std::map< std::string, std::string > &paramsMap)
 set the inner key/value map in map<string, string> format More...
 
void setParametersStr (const std::string &paramsString)
 set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN" More...
 
virtual void setThetaSensitivity (double val)
 
void unsetParameter (const std::string &key)
 Removes a parameter. More...
 
void updateParameters (const std::map< std::string, std::string > &mapArg)
 Adds or updates all given parameters from the map. More...
 
void writeParams (OutputDevice &device) const
 write Params in the given outputdevice More...
 
virtual ~MSSOTLPolicy ()
 

Static Public Member Functions

static bool areParametersValid (const std::string &value, bool report=false)
 check if given string can be parsed to a parameters map "key1=value1|key2=value2|...|keyN=valueN" More...
 

Protected Member Functions

virtual void init ()
 

Static Private Member Functions

static bool isParameterValid (const std::string &value, bool report)
 check if given string can be parsed to a parameter of type "key=value" More...
 

Private Attributes

MSSOTLPolicyDesirabilitymyDesirabilityAlgorithm
 A pointer to the policy desirability object.\nIt's an optional component related to the computeDesirability() method and it's necessary only when the policy is used in combination with an high level policy. More...
 
std::map< std::string, std::string > myMap
 The key->value map. More...
 
std::string myName
 The name of the policy. More...
 
double theta_sensitivity
 The sensitivity of this policy. More...
 

Detailed Description

Class for a low-level policy.

Definition at line 64 of file MSSOTLPolicy.h.

Constructor & Destructor Documentation

◆ MSSOTLPolicy() [1/3]

MSSOTLPolicy::MSSOTLPolicy ( std::string  name,
const std::map< std::string, std::string > &  parameters 
)

Simple constructor.

Parameters
[in]nameThe name of the policy
[in]parametersParameters defined for the policy

Definition at line 78 of file MSSOTLPolicy.cpp.

References theta_sensitivity.

◆ MSSOTLPolicy() [2/3]

MSSOTLPolicy::MSSOTLPolicy ( std::string  name,
MSSOTLPolicyDesirability desirabilityAlgorithm 
)

Constructor when the policy is a low-level policy used by an high level policy.

Parameters
[in]nameThe name of the policy
[in]desirabilityAlgorithmThe desirability algorithm to be used for this policy

Definition at line 84 of file MSSOTLPolicy.cpp.

References theta_sensitivity.

◆ MSSOTLPolicy() [3/3]

MSSOTLPolicy::MSSOTLPolicy ( std::string  name,
MSSOTLPolicyDesirability desirabilityAlgorithm,
const std::map< std::string, std::string > &  parameters 
)

Constructor when the policy is a low-level policy used by an high level policy.

Parameters
[in]nameThe name of the policy
[in]desirabilityAlgorithmThe desirability algorithm to be used for this policy
[in]parametersParameters defined for the policy

Definition at line 91 of file MSSOTLPolicy.cpp.

References Parameterised::getParameter(), theta_sensitivity, and StringUtils::toDouble().

◆ ~MSSOTLPolicy()

MSSOTLPolicy::~MSSOTLPolicy ( void  )
virtual

Definition at line 99 of file MSSOTLPolicy.cpp.

Member Function Documentation

◆ areParametersValid()

◆ canRelease()

virtual bool MSSOTLPolicy::canRelease ( SUMOTime  elapsed,
bool  thresholdPassed,
bool  pushButtonPressed,
const MSPhaseDefinition stage,
int  vehicleCount 
)
pure virtual

◆ clearParameter()

void Parameterised::clearParameter ( )
inherited

Clears the parameter map.

Definition at line 100 of file Parameterised.cpp.

References Parameterised::myMap.

Referenced by NLHandler::beginEdgeParsing(), and GNERouteHandler::closeRoute().

◆ computeDesirability() [1/2]

double MSSOTLPolicy::computeDesirability ( double  vehInMeasure,
double  vehOutMeasure 
)

◆ computeDesirability() [2/2]

double MSSOTLPolicy::computeDesirability ( double  vehInMeasure,
double  vehOutMeasure,
double  vehInDispersionMeasure,
double  vehOutDispersionMeasure 
)

Computes the desirability of this policy, necessary when used in combination with an high level policy.

Definition at line 102 of file MSSOTLPolicy.cpp.

References MSSOTLPolicyDesirability::computeDesirability(), DBG, getName(), myDesirabilityAlgorithm, and WRITE_MESSAGE.

◆ decideNextPhase()

int MSSOTLPolicy::decideNextPhase ( SUMOTime  elapsed,
const MSPhaseDefinition stage,
int  currentPhaseIndex,
int  phaseMaxCTS,
bool  thresholdPassed,
bool  pushButtonPressed,
int  vehicleCount 
)
virtual

◆ getDesirabilityAlgorithm()

◆ getDouble()

◆ getName()

◆ getParameter()

const std::string Parameterised::getParameter ( const std::string &  key,
const std::string &  defaultValue = "" 
) const
inherited

Returns the value for a given key.

Parameters
[in]keyThe key to ask for
[in]defaultValueThe default value to return if no value is stored under the key
Returns
The value stored under the key

Definition at line 72 of file Parameterised.cpp.

References Parameterised::myMap.

Referenced by NBEdge::addRestrictedLane(), FareModul::addStop(), NBEdge::append(), MSDevice_Battery::buildVehicleDevices(), MSDevice_Bluelight::buildVehicleDevices(), MSDevice_Example::buildVehicleDevices(), ROEdge::cacheParamRestrictions(), SUMOVTypeParameter::cacheParamRestrictions(), GNEEdge::drawEdgeName(), GNEConnection::drawGL(), GUIEdge::drawGL(), GUIBaseVehicle::drawOnPos(), libsumo::Simulation::findIntermodalRoute(), MSSwarmTrafficLightLogic::getBetaNo(), MSSwarmTrafficLightLogic::getBetaSp(), MSDevice::getBoolParam(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), MSSwarmTrafficLightLogic::getChangePlanProbability(), GUIVehicle::getColorValue(), GNELane::getColorValue(), GUILane::getColorValue(), MSSOTLTrafficLightLogic::getDecayConstant(), MSDevice_SSM::getDetectionRange(), MSDevice_SSM::getExtraTime(), MSDevice::getFloatParam(), MSSwarmTrafficLightLogic::getForgettingCox(), MSSwarmTrafficLightLogic::getGammaNo(), MSSwarmTrafficLightLogic::getGammaSp(), MSTLLogicControl::WAUTSwitchProcedure::getGSPValue(), MSSOTLTrafficLightLogic::getInputSensorsLength(), MSSwarmTrafficLightLogic::getLearningCox(), MSSwarmTrafficLightLogic::getMaxCongestionDuration(), MSDevice_SSM::getMeasuresAndThresholds(), MSSOTLRequestPolicy::getMinDecisionalPhaseDuration(), MSSOTLTrafficLightLogic::getMode(), GUIJunctionWrapper::getOptionalName(), GUIBaseVehicle::getOptionalName(), MSDevice_ToC::getOutputFilename(), MSDevice_SSM::getOutputFilename(), MSSOTLTrafficLightLogic::getOutputSensorsLength(), libsumo::Route::getParameter(), libsumo::Polygon::getParameter(), libsumo::POI::getParameter(), libsumo::Person::getParameter(), libsumo::TrafficLight::getParameter(), libsumo::Edge::getParameter(), libsumo::Lane::getParameter(), libsumo::VehicleType::getParameter(), libsumo::Vehicle::getParameter(), libsumo::Simulation::getParameter(), MSSwarmTrafficLightLogic::getPheroMaxVal(), MSSwarmTrafficLightLogic::getPoliciesParam(), MSSwarmTrafficLightLogic::getReinforcementMode(), MSSOTLTrafficLightLogic::getSpeedThreshold(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(), MSDevice::getStringParam(), MSSwarmTrafficLightLogic::getThetaInit(), MSSwarmTrafficLightLogic::getThetaMax(), MSSwarmTrafficLightLogic::getThetaMin(), MSSOTLTrafficLightLogic::getThreshold(), MSTriggeredRerouter::getWeight(), PushButtonLogic::init(), MSSOTLPhasePolicy::init(), SigmoidLogic::init(), MSSOTLTrafficLightLogic::init(), MSSwarmTrafficLightLogic::init(), GNEVehicleType::initRailVisualizationParameters(), MSVehicleType::initRailVisualizationParameters(), MSSOTLTrafficLightLogic::isDecayThresholdActivated(), MSSOTLTrafficLightLogic::isPushButtonPressed(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSDelayBasedTrafficLightLogic::MSDelayBasedTrafficLightLogic(), MSSOTLPolicy(), MSSOTLPolicy5DFamilyStimulus::MSSOTLPolicy5DFamilyStimulus(), MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic(), GNEVehicleType::overwriteVType(), MSDevice_SSM::requestsTrajectories(), NBEdgeCont::splitAt(), MSDevice_SSM::useGeoCoords(), NWWriter_DlrNavteq::writeLinksUnsplitted(), and NWWriter_OpenDrive::writeRoadObjects().

◆ getParametersMap()

◆ getParametersStr()

◆ getThetaSensitivity()

virtual double MSSOTLPolicy::getThetaSensitivity ( )
inlinevirtual

◆ init()

virtual void MSSOTLPolicy::init ( )
inlineprotectedvirtual

Reimplemented in MSSOTLPlatoonPolicy, MSSOTLMarchingPolicy, and MSSOTLPhasePolicy.

Definition at line 82 of file MSSOTLPolicy.h.

◆ isParameterValid()

bool Parameterised::isParameterValid ( const std::string &  value,
bool  report 
)
staticprivateinherited

check if given string can be parsed to a parameter of type "key=value"

Definition at line 189 of file Parameterised.cpp.

References StringTokenizer::getVector(), SUMOXMLDefinitions::isValidParameterKey(), and SUMOXMLDefinitions::isValidParameterValue().

Referenced by Parameterised::areParametersValid().

◆ knowsParameter()

◆ setParameter()

◆ setParameters()

void Parameterised::setParameters ( const Parameterised params)
inherited

set the inner key/value map in map<string, string> format

Definition at line 127 of file Parameterised.cpp.

References Parameterised::getParametersMap(), and Parameterised::myMap.

◆ setParametersMap()

void Parameterised::setParametersMap ( const std::map< std::string, std::string > &  paramsMap)
inherited

set the inner key/value map in map<string, string> format

Definition at line 133 of file Parameterised.cpp.

References Parameterised::myMap.

◆ setParametersStr()

void Parameterised::setParametersStr ( const std::string &  paramsString)
inherited

◆ setThetaSensitivity()

virtual void MSSOTLPolicy::setThetaSensitivity ( double  val)
inlinevirtual

Definition at line 114 of file MSSOTLPolicy.h.

References theta_sensitivity.

Referenced by MSSwarmTrafficLightLogic::updateSensitivities().

◆ unsetParameter()

void Parameterised::unsetParameter ( const std::string &  key)
inherited

Removes a parameter.

Parameters
[in]keyThe parameter's name

Definition at line 52 of file Parameterised.cpp.

References Parameterised::myMap.

Referenced by NIImporter_OpenStreetMap::insertEdge(), and GNEVehicleType::setAttribute().

◆ updateParameters()

void Parameterised::updateParameters ( const std::map< std::string, std::string > &  mapArg)
inherited

◆ writeParams()

Field Documentation

◆ myDesirabilityAlgorithm

MSSOTLPolicyDesirability* MSSOTLPolicy::myDesirabilityAlgorithm
private

A pointer to the policy desirability object.\nIt's an optional component related to the computeDesirability() method and it's necessary only when the policy is used in combination with an high level policy.

Definition at line 79 of file MSSOTLPolicy.h.

Referenced by computeDesirability(), and getDesirabilityAlgorithm().

◆ myMap

◆ myName

std::string MSSOTLPolicy::myName
private

The name of the policy.

Definition at line 74 of file MSSOTLPolicy.h.

Referenced by getName().

◆ theta_sensitivity

double MSSOTLPolicy::theta_sensitivity
private

The sensitivity of this policy.

Definition at line 70 of file MSSOTLPolicy.h.

Referenced by getThetaSensitivity(), MSSOTLPolicy(), and setThetaSensitivity().


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