SUMO - Simulation of Urban MObility
|
Class for a low-level policy. More...
#include <MSSOTLPolicy.h>
Public Member Functions | |
void | addParameter (const std::string &key, const std::string &value) |
Adds a parameter. More... | |
void | addParameter (const std::map< std::string, std::string > &mapArg) |
Adds all given parameter. More... | |
void | addParameter (const Parameterised &p) |
Adds all given parameter. More... | |
virtual bool | canRelease (SUMOTime elapsed, bool thresholdPassed, bool pushButtonPressed, const MSPhaseDefinition *stage, int vehicleCount)=0 |
void | clearParameter () |
Clears the parameter map. More... | |
SUMOReal | computeDesirability (SUMOReal vehInMeasure, SUMOReal vehOutMeasure, SUMOReal vehInDispersionMeasure, SUMOReal vehOutDispersionMeasure) |
Computes the desirability of this policy, necessary when used in combination with an high level policy. More... | |
SUMOReal | computeDesirability (SUMOReal vehInMeasure, SUMOReal vehOutMeasure) |
virtual int | decideNextPhase (SUMOTime elapsed, const MSPhaseDefinition *stage, int currentPhaseIndex, int phaseMaxCTS, bool thresholdPassed, bool pushButtonPressed, int vehicleCount) |
MSSOTLPolicyDesirability * | getDesirabilityAlgorithm () |
const std::map< std::string, std::string > & | getMap () const |
Returns the inner key/value map. 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... | |
virtual SUMOReal | 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 > ¶meters) | |
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 > ¶meters) | |
Constructor when the policy is a low-level policy used by an high level policy. More... | |
virtual void | setThetaSensitivity (SUMOReal val) |
virtual | ~MSSOTLPolicy () |
Protected Member Functions | |
virtual void | init () |
Private Attributes | |
MSSOTLPolicyDesirability * | myDesirabilityAlgorithm |
A pointer to the policy desirability object.'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::string | myName |
The name of the policy. More... | |
SUMOReal | theta_sensitivity |
The sensitivity of this policy. More... | |
Class for a low-level policy.
Definition at line 72 of file MSSOTLPolicy.h.
MSSOTLPolicy::MSSOTLPolicy | ( | std::string | name, |
const std::map< std::string, std::string > & | parameters | ||
) |
Simple constructor.
[in] | name | The name of the policy |
[in] | parameters | Parameters defined for the policy |
Definition at line 82 of file MSSOTLPolicy.cpp.
References theta_sensitivity.
MSSOTLPolicy::MSSOTLPolicy | ( | std::string | name, |
MSSOTLPolicyDesirability * | desirabilityAlgorithm | ||
) |
Constructor when the policy is a low-level policy used by an high level policy.
[in] | name | The name of the policy |
[in] | desirabilityAlgorithm | The desirability algorithm to be used for this policy |
Definition at line 88 of file MSSOTLPolicy.cpp.
References theta_sensitivity.
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.
[in] | name | The name of the policy |
[in] | desirabilityAlgorithm | The desirability algorithm to be used for this policy |
[in] | parameters | Parameters defined for the policy |
Definition at line 95 of file MSSOTLPolicy.cpp.
References TplConvert::_2SUMOReal(), Parameterised::getParameter(), and theta_sensitivity.
|
virtual |
Definition at line 103 of file MSSOTLPolicy.cpp.
|
inherited |
Adds a parameter.
[in] | key | The parameter's name |
[in] | value | The parameter's value |
Definition at line 53 of file Parameterised.cpp.
References Parameterised::myMap.
Referenced by SUMORouteHandler::addParam(), NLHandler::addParam(), PCLoaderOSM::addPOI(), PCLoaderOSM::addPolygon(), NBTrafficLightDefinition::compute(), NIImporter_OpenDrive::loadNetwork(), NIImporter_MATSim::EdgesHandler::myStartElement(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Polygon::processSet(), and TraCIServerAPI_Lane::processSet().
|
inherited |
Adds all given parameter.
[in] | mapArg | The keys/values to insert |
Definition at line 59 of file Parameterised.cpp.
References Parameterised::myMap.
|
inherited |
Adds all given parameter.
[in] | p | The keys/values to insert |
Definition at line 67 of file Parameterised.cpp.
References Parameterised::myMap.
|
pure virtual |
Implemented in MSSOTLCongestionPolicy, MSSOTLPlatoonPolicy, MSSOTLMarchingPolicy, MSSOTLPhasePolicy, and MSSOTLRequestPolicy.
Referenced by MSDeterministicHiLevelTrafficLightLogic::canRelease(), MSSOTLPolicyBasedTrafficLightLogic::canRelease(), MSSwarmTrafficLightLogic::canRelease(), and decideNextPhase().
|
inherited |
Clears the parameter map.
Definition at line 91 of file Parameterised.cpp.
References Parameterised::myMap.
SUMOReal MSSOTLPolicy::computeDesirability | ( | SUMOReal | vehInMeasure, |
SUMOReal | vehOutMeasure, | ||
SUMOReal | vehInDispersionMeasure, | ||
SUMOReal | vehOutDispersionMeasure | ||
) |
Computes the desirability of this policy, necessary when used in combination with an high level policy.
Definition at line 106 of file MSSOTLPolicy.cpp.
References MSSOTLPolicyDesirability::computeDesirability(), DBG, getName(), myDesirabilityAlgorithm, and WRITE_MESSAGE.
Definition at line 115 of file MSSOTLPolicy.cpp.
References MSSOTLPolicyDesirability::computeDesirability(), DBG, getName(), myDesirabilityAlgorithm, and WRITE_MESSAGE.
|
virtual |
Reimplemented in MSSOTLCongestionPolicy.
Definition at line 124 of file MSSOTLPolicy.cpp.
References canRelease(), DBG, MSPhaseDefinition::isCommit(), MSPhaseDefinition::isDecisional(), MSPhaseDefinition::isTransient(), time2string(), and WRITE_MESSAGE.
Referenced by MSSOTLPolicyBasedTrafficLightLogic::decideNextPhase(), and MSSwarmTrafficLightLogic::decideNextPhase().
|
inline |
Definition at line 128 of file MSSOTLPolicy.h.
References myDesirabilityAlgorithm.
Referenced by MSSOTLCongestionPolicy::MSSOTLCongestionPolicy(), MSSOTLMarchingPolicy::MSSOTLMarchingPolicy(), MSSOTLPhasePolicy::MSSOTLPhasePolicy(), MSSOTLPlatoonPolicy::MSSOTLPlatoonPolicy(), MSSOTLRequestPolicy::MSSOTLRequestPolicy(), and MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic().
|
inlineinherited |
Returns the inner key/value map.
Definition at line 107 of file Parameterised.h.
References Parameterised::myMap.
Referenced by NBTrafficLightDefinition::compute(), MSDevice_Vehroutes::generateOutput(), GUIPerson::getParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), TraCIServerAPI_TLS::processGet(), ROVehicle::saveAsXML(), ROPerson::saveAsXML(), SUMOVTypeParameter::write(), PointOfInterest::writeXML(), and SUMO::Polygon::writeXML().
|
inline |
Definition at line 125 of file MSSOTLPolicy.h.
References myName.
Referenced by MSSwarmTrafficLightLogic::calculateEtaDiff(), MSSwarmTrafficLightLogic::calculateEtaRatio(), computeDesirability(), MSSwarmTrafficLightLogic::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic(), and MSSwarmTrafficLightLogic::updateSensitivities().
|
inherited |
Returns the value for a given key.
[in] | key | The key to ask for |
[in] | defaultValue | The default value to return if no value is stored under the key |
Definition at line 81 of file Parameterised.cpp.
References Parameterised::myMap.
Referenced by MSDevice_Battery::buildVehicleDevices(), MSDevice_Example::buildVehicleDevices(), MSDevice::equippedByDefaultAssignmentOptions(), MSSwarmTrafficLightLogic::getBetaNo(), MSSwarmTrafficLightLogic::getBetaSp(), MSSwarmTrafficLightLogic::getChangePlanProbability(), MSSOTLTrafficLightLogic::getDecayConstant(), MSSwarmTrafficLightLogic::getForgettingCox(), MSSwarmTrafficLightLogic::getGammaNo(), MSSwarmTrafficLightLogic::getGammaSp(), MSTLLogicControl::WAUTSwitchProcedure::getGSPValue(), MSSOTLTrafficLightLogic::getInputSensorsLength(), MSSwarmTrafficLightLogic::getLearningCox(), MSSwarmTrafficLightLogic::getMaxCongestionDuration(), MSSOTLRequestPolicy::getMinDecisionalPhaseDuration(), MSSOTLRequestTrafficLightLogic::getMinDecisionalPhaseDuration(), MSSOTLTrafficLightLogic::getMode(), MSSOTLTrafficLightLogic::getOutputSensorsLength(), MSSwarmTrafficLightLogic::getPheroMaxVal(), MSSwarmTrafficLightLogic::getPoliciesParam(), MSSwarmTrafficLightLogic::getReinforcementMode(), MSSOTLTrafficLightLogic::getSpeedThreshold(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(), MSSwarmTrafficLightLogic::getThetaInit(), MSSwarmTrafficLightLogic::getThetaMax(), MSSwarmTrafficLightLogic::getThetaMin(), MSSOTLTrafficLightLogic::getThreshold(), PushButtonLogic::init(), MSSOTLPhasePolicy::init(), SigmoidLogic::init(), MSSOTLTrafficLightLogic::isDecayThresholdActivated(), MSSOTLTrafficLightLogic::isPushButtonPressed(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSSOTLPolicy(), MSSOTLPolicy5DFamilyStimulus::MSSOTLPolicy5DFamilyStimulus(), MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Lane::processGet(), MSSOTLPolicyDesirability::readParameter(), and TraCIServerAPI_Vehicle::vtdMap().
|
inlinevirtual |
Definition at line 119 of file MSSOTLPolicy.h.
References theta_sensitivity.
Referenced by MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic(), and MSSwarmTrafficLightLogic::updateSensitivities().
|
inlineprotectedvirtual |
Reimplemented in MSSOTLPlatoonPolicy, MSSOTLMarchingPolicy, and MSSOTLPhasePolicy.
Definition at line 90 of file MSSOTLPolicy.h.
|
inherited |
Returns whether the parameter is known.
[in] | key | The key to ask for |
Definition at line 75 of file Parameterised.cpp.
References Parameterised::myMap.
Referenced by MSDevice_Example::buildVehicleDevices(), and MSDevice::equippedByDefaultAssignmentOptions().
|
inlinevirtual |
Definition at line 122 of file MSSOTLPolicy.h.
Referenced by MSSwarmTrafficLightLogic::updateSensitivities().
|
private |
A pointer to the policy desirability object.'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 87 of file MSSOTLPolicy.h.
Referenced by computeDesirability(), and getDesirabilityAlgorithm().
|
private |
|
private |
The sensitivity of this policy.
Definition at line 78 of file MSSOTLPolicy.h.
Referenced by getThetaSensitivity(), and MSSOTLPolicy().