SUMO - Simulation of Urban MObility
Parameterised Class Reference

An upper class for objects with additional parameters. More...

#include <Parameterised.h>

Inheritance diagram for Parameterised:
Inheritance graph
Collaboration diagram for Parameterised:
Collaboration graph

Public Member Functions

void clearParameter ()
 Clears the parameter map. More...
 
double getDouble (const std::string &key, const double defaultValue) const
 Returns the value for a given key converted to a double. More...
 
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...
 
bool knowsParameter (const std::string &key) const
 Returns whether the parameter is known. More...
 
 Parameterised ()
 Constructor. More...
 
 Parameterised (const std::map< std::string, std::string > &mapArg)
 Constructor with parameters. More...
 
void setParameter (const std::string &key, const std::string &value)
 Sets a parameter. More...
 
void unsetParameter (const std::string &key)
 Removes a parameter. More...
 
void updateParameter (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...
 
 ~Parameterised ()
 Destructor. More...
 

Private Attributes

std::map< std::string, std::string > myMap
 The key->value map. More...
 

Detailed Description

An upper class for objects with additional parameters.

Definition at line 44 of file Parameterised.h.

Constructor & Destructor Documentation

◆ Parameterised() [1/2]

Parameterised::Parameterised ( )

Constructor.

Definition at line 34 of file Parameterised.cpp.

◆ Parameterised() [2/2]

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

Constructor with parameters.

Parameters
[in]mapArgPre-given parameter

Definition at line 40 of file Parameterised.cpp.

◆ ~Parameterised()

Parameterised::~Parameterised ( )

Destructor.

Definition at line 37 of file Parameterised.cpp.

Member Function Documentation

◆ clearParameter()

◆ getDouble()

double Parameterised::getDouble ( const std::string &  key,
const double  defaultValue 
) const

Returns the value for a given key converted to a double.

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 82 of file Parameterised.cpp.

References TplConvert::_2double(), myMap, and WRITE_WARNING.

Referenced by MSDevice_Battery::buildVehicleDevices().

◆ getParameter()

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

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

Referenced by MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic(), NBEdge::addRestrictedLane(), MSDevice_Battery::buildVehicleDevices(), MSDevice_Bluelight::buildVehicleDevices(), MSDevice_Example::buildVehicleDevices(), MSDevice::equippedByDefaultAssignmentOptions(), MSDevice::equippedByParameter(), libsumo::Simulation::findIntermodalRoute(), MSDevice::getBoolParam(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), MSSOTLTrafficLightLogic::getDecayConstant(), MSDevice_SSM::getDetectionRange(), MSDevice_SSM::getExtraTime(), MSDevice::getFloatParam(), MSTLLogicControl::WAUTSwitchProcedure::getGSPValue(), MSSOTLTrafficLightLogic::getInputSensorsLength(), MSDevice_SSM::getMeasuresAndThresholds(), MSSOTLRequestPolicy::getMinDecisionalPhaseDuration(), MSSOTLRequestTrafficLightLogic::getMinDecisionalPhaseDuration(), MSSOTLTrafficLightLogic::getMode(), MSDevice_SSM::getOutputFilename(), MSSOTLTrafficLightLogic::getOutputSensorsLength(), libsumo::Polygon::getParameter(), libsumo::Route::getParameter(), libsumo::POI::getParameter(), libsumo::Person::getParameter(), libsumo::TrafficLight::getParameter(), libsumo::Edge::getParameter(), libsumo::Lane::getParameter(), libsumo::VehicleType::getParameter(), libsumo::Vehicle::getParameter(), MSSOTLTrafficLightLogic::getSpeedThreshold(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(), MSDevice::getStringParam(), MSSOTLTrafficLightLogic::getThreshold(), MSTriggeredRerouter::getWeight(), PushButtonLogic::init(), MSSOTLPhasePolicy::init(), SigmoidLogic::init(), MSSOTLTrafficLightLogic::init(), MSSwarmTrafficLightLogic::init(), NIImporter_OpenStreetMap::insertEdge(), MSSOTLTrafficLightLogic::isDecayThresholdActivated(), MSSOTLTrafficLightLogic::isPushButtonPressed(), libsumo::Helper::moveToXYMap(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSDelayBasedTrafficLightLogic::MSDelayBasedTrafficLightLogic(), MSSOTLPolicy::MSSOTLPolicy(), MSSOTLPolicy5DFamilyStimulus::MSSOTLPolicy5DFamilyStimulus(), MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic(), MSTriggeredRerouter::notifyEnter(), MSSOTLPolicyDesirability::readParameter(), MSDevice_SSM::requestsTrajectories(), NBEdgeCont::splitAt(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), GNECrossing::updateGenericParameter(), GNEConnection::updateGenericParameter(), GNEPoly::updateGenericParameter(), GNELane::updateGenericParameter(), GNEPOI::updateGenericParameter(), GNEJunction::updateGenericParameter(), GNEEdge::updateGenericParameter(), GNEAdditional::updateGenericParameter(), MSDevice_SSM::useGeoCoords(), and NWWriter_DlrNavteq::writeLinksUnsplitted().

◆ getParametersMap()

◆ knowsParameter()

bool Parameterised::knowsParameter ( const std::string &  key) const

Returns whether the parameter is known.

Parameters
[in]keyThe key to ask for
Returns
Whether the key is known

Definition at line 66 of file Parameterised.cpp.

References myMap.

Referenced by GNEPoly::addGenericParameter(), GNELane::addGenericParameter(), GNEPOI::addGenericParameter(), GNEJunction::addGenericParameter(), GNEEdge::addGenericParameter(), GNEAdditional::addGenericParameter(), NBEdge::append(), MSDevice_Bluelight::buildVehicleDevices(), MSDevice_Example::buildVehicleDevices(), MSDevice::equippedByDefaultAssignmentOptions(), MSDevice::equippedByParameter(), MSDevice::getBoolParam(), NWWriter_DlrNavteq::getBrunnelType(), MSDevice_SSM::getDetectionRange(), MSDevice_SSM::getExtraTime(), MSDevice::getFloatParam(), MSDevice_SSM::getMeasuresAndThresholds(), MSDevice_SSM::getOutputFilename(), MSDevice::getStringParam(), MSTriggeredRerouter::getWeight(), GNEPoly::removeGenericParameter(), GNELane::removeGenericParameter(), GNEPOI::removeGenericParameter(), GNEJunction::removeGenericParameter(), GNEEdge::removeGenericParameter(), GNEAdditional::removeGenericParameter(), MSDevice_SSM::requestsTrajectories(), GNEPoly::updateGenericParameter(), GNELane::updateGenericParameter(), GNEPOI::updateGenericParameter(), GNEJunction::updateGenericParameter(), GNEEdge::updateGenericParameter(), GNEAdditional::updateGenericParameter(), GNEPoly::updateGenericParameterValue(), GNEPOI::updateGenericParameterValue(), GNELane::updateGenericParameterValue(), GNEJunction::updateGenericParameterValue(), GNEEdge::updateGenericParameterValue(), GNEAdditional::updateGenericParameterValue(), and MSDevice_SSM::useGeoCoords().

◆ setParameter()

void Parameterised::setParameter ( const std::string &  key,
const std::string &  value 
)

Sets a parameter.

Parameters
[in]keyThe parameter's name
[in]valueThe parameter's value

Definition at line 46 of file Parameterised.cpp.

References myMap.

Referenced by GNECrossing::addGenericParameter(), GNEConnection::addGenericParameter(), GNEPoly::addGenericParameter(), GNELane::addGenericParameter(), GNEPOI::addGenericParameter(), GNEJunction::addGenericParameter(), GNEEdge::addGenericParameter(), GNEAdditional::addGenericParameter(), SUMORouteHandler::addParam(), NLHandler::addParam(), ShapeHandler::addPOI(), NIImporter_OpenStreetMap::insertNodeChecking(), NBEdge::Lane::Lane(), NIImporter_ArcView::load(), NIImporter_OpenDrive::loadNetwork(), NIXMLTrafficLightsHandler::myStartElement(), MSStateHandler::myStartElement(), ShapeHandler::myStartElement(), NIXMLNodesHandler::myStartElement(), NIImporter_MATSim::EdgesHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), GNEAdditionalHandler::parseGenericParameter(), GNEConnection::setGenericParametersStr(), GNEPoly::setGenericParametersStr(), GNELane::setGenericParametersStr(), GNEPOI::setGenericParametersStr(), GNEJunction::setGenericParametersStr(), GNEEdge::setGenericParametersStr(), GNEAdditional::setGenericParametersStr(), libsumo::Route::setParameter(), libsumo::Polygon::setParameter(), libsumo::POI::setParameter(), libsumo::TrafficLight::setParameter(), libsumo::Edge::setParameter(), libsumo::Lane::setParameter(), GNEConnection::updateGenericParameter(), GNEPoly::updateGenericParameter(), GNELane::updateGenericParameter(), GNEPOI::updateGenericParameter(), GNEJunction::updateGenericParameter(), GNEEdge::updateGenericParameter(), GNEAdditional::updateGenericParameter(), GNECrossing::updateGenericParameterValue(), GNEConnection::updateGenericParameterValue(), GNEPoly::updateGenericParameterValue(), GNELane::updateGenericParameterValue(), GNEPOI::updateGenericParameterValue(), GNEJunction::updateGenericParameterValue(), GNEEdge::updateGenericParameterValue(), and GNEAdditional::updateGenericParameterValue().

◆ unsetParameter()

◆ updateParameter()

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

Adds or updates all given parameters from the map.

Parameters
[in]mapArgThe keys/values to insert

Definition at line 58 of file Parameterised.cpp.

References myMap.

Referenced by NIImporter_SUMO::_loadNetwork(), PCLoaderOSM::addPOI(), PCLoaderOSM::addPolygon(), NLJunctionControlBuilder::closeJunction(), NBTrafficLightDefinition::compute(), NIImporter_OpenStreetMap::insertEdge(), and NBLoadedSUMOTLDef::NBLoadedSUMOTLDef().

◆ writeParams()

Field Documentation

◆ myMap

std::map<std::string, std::string> Parameterised::myMap
private

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