Eclipse SUMO - Simulation of Urban MObility
SUMOVehicleParameter Class Reference

Structure representing possible vehicle parameter. More...

#include <SUMOVehicleParameter.h>

Inheritance diagram for SUMOVehicleParameter:
Collaboration diagram for SUMOVehicleParameter:

Data Structures

struct  Stop
 Definition of vehicle stop (position and duration) More...
 

Public Member Functions

void clearParameter ()
 Clears the parameter map. More...
 
bool defaultOptionOverrides (const OptionsCont &oc, const std::string &optionName) const
 Returns whether the defaults shall be used. 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...
 
std::string getParametersStr () const
 Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN". More...
 
bool knowsParameter (const std::string &key) const
 Returns whether the parameter is known. 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...
 
 SUMOVehicleParameter ()
 Constructor. More...
 
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...
 
bool wasSet (int what) const
 Returns whether the given parameter was set. More...
 
void write (OutputDevice &dev, const OptionsCont &oc, const SumoXMLTag tag=SUMO_TAG_VEHICLE, const std::string &typeID="") const
 Writes the parameters as a beginning element. More...
 
void writeParams (OutputDevice &device) const
 write Params in the given outputdevice More...
 
virtual ~SUMOVehicleParameter ()
 Destructor. More...
 

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...
 
static double interpretEdgePos (double pos, double maximumValue, SumoXMLAttr attr, const std::string &id)
 Interprets negative edge positions and fits them onto a given edge. More...
 
static bool parsePersonModes (const std::string &modes, const std::string &element, const std::string &id, SVCPermissions &modeSet, std::string &error)
 Validates a given person modes value. More...
 
Depart/arrival-attributes verification
static bool parseDepart (const std::string &val, const std::string &element, const std::string &id, SUMOTime &depart, DepartDefinition &dd, std::string &error)
 Validates a given depart value. More...
 
static bool parseDepartLane (const std::string &val, const std::string &element, const std::string &id, int &lane, DepartLaneDefinition &dld, std::string &error)
 Validates a given departLane value. More...
 
static bool parseDepartPos (const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosDefinition &dpd, std::string &error)
 Validates a given departPos value. More...
 
static bool parseDepartPosLat (const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosLatDefinition &dpd, std::string &error)
 Validates a given departPosLat value. More...
 
static bool parseDepartSpeed (const std::string &val, const std::string &element, const std::string &id, double &speed, DepartSpeedDefinition &dsd, std::string &error)
 Validates a given departSpeed value. More...
 
static bool parseArrivalLane (const std::string &val, const std::string &element, const std::string &id, int &lane, ArrivalLaneDefinition &ald, std::string &error)
 Validates a given arrivalLane value. More...
 
static bool parseArrivalPos (const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosDefinition &apd, std::string &error)
 Validates a given arrivalPos value. More...
 
static bool parseArrivalPosLat (const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosLatDefinition &apd, std::string &error)
 Validates a given arrivalPosLat value. More...
 
static bool parseArrivalSpeed (const std::string &val, const std::string &element, const std::string &id, double &speed, ArrivalSpeedDefinition &asd, std::string &error)
 Validates a given arrivalSpeed value. More...
 

Data Fields

RGBColor color
 The vehicle's color, TraCI may change this. More...
 
int containerNumber
 The static number of containers in the vehicle when it departs. More...
 
std::string fromTaz
 The vehicle's origin zone (district) More...
 
std::string id
 The vehicle's id. More...
 
std::string line
 The vehicle's line (mainly for public transport) More...
 
int parametersSet
 Information for the router which parameter were set, TraCI may modify this (whe changing color) More...
 
int personNumber
 The static number of persons in the vehicle when it departs (not including boarding persons) More...
 
std::string routeid
 The vehicle's route id. More...
 
double speedFactor
 individual speedFactor (overriding distribution from vType) More...
 
std::vector< Stopstops
 List of the stops the vehicle will make, TraCI may add entries here. More...
 
SumoXMLTag tag
 The vehicle tag. More...
 
std::string toTaz
 The vehicle's destination zone (district) More...
 
std::vector< std::string > via
 List of the via-edges the vehicle must visit. More...
 
std::string vtypeid
 The vehicle's type id. More...
 
Departure definition

The vehicle's departure time

SUMOTime depart
 
DepartDefinition departProcedure
 Information how the vehicle shall choose the depart time. More...
 
int departLane
 (optional) The lane the vehicle shall depart from (index in edge) More...
 
DepartLaneDefinition departLaneProcedure
 Information how the vehicle shall choose the lane to depart from. More...
 
double departPos
 (optional) The position the vehicle shall depart from More...
 
DepartPosDefinition departPosProcedure
 Information how the vehicle shall choose the departure position. More...
 
double departPosLat
 (optional) The lateral position the vehicle shall depart from More...
 
DepartPosLatDefinition departPosLatProcedure
 Information how the vehicle shall choose the lateral departure position. More...
 
double departSpeed
 (optional) The initial speed of the vehicle More...
 
DepartSpeedDefinition departSpeedProcedure
 Information how the vehicle's initial speed shall be chosen. More...
 
Arrival definition

(optional) The lane the vehicle shall arrive on (not used yet)

int arrivalLane
 
ArrivalLaneDefinition arrivalLaneProcedure
 Information how the vehicle shall choose the lane to arrive on. More...
 
double arrivalPos
 (optional) The position the vehicle shall arrive on More...
 
ArrivalPosDefinition arrivalPosProcedure
 Information how the vehicle shall choose the arrival position. More...
 
double arrivalPosLat
 (optional) The lateral position the vehicle shall arrive on More...
 
ArrivalPosLatDefinition arrivalPosLatProcedure
 Information how the vehicle shall choose the lateral arrival position. More...
 
double arrivalSpeed
 (optional) The final speed of the vehicle (not used yet) More...
 
ArrivalSpeedDefinition arrivalSpeedProcedure
 Information how the vehicle's end speed shall be chosen. More...
 
Repetition definition

The number of times the vehicle shall be repeatedly inserted

int repetitionNumber
 
int repetitionsDone
 The number of times the vehicle was already inserted. More...
 
SUMOTime repetitionOffset
 The time offset between vehicle reinsertions. More...
 
double repetitionProbability
 The probability for emitting a vehicle per second. More...
 
SUMOTime repetitionEnd
 The time at which the flow ends (only needed when using repetitionProbability) More...
 

Protected Member Functions

std::string getArrivalLane () const
 obtain arrival lane parameter in string format More...
 
std::string getArrivalPos () const
 obtain arrival pos parameter in string format More...
 
std::string getArrivalPosLat () const
 obtain arrival pos lat parameter in string format More...
 
std::string getArrivalSpeed () const
 obtain arrival speed parameter in string format More...
 
std::string getDepart () const
 obtain depart parameter in string format More...
 
std::string getDepartLane () const
 obtain depart lane parameter in string format More...
 
std::string getDepartPos () const
 obtain depart pos parameter in string format More...
 
std::string getDepartPosLat () const
 obtain depart pos lat parameter in string format More...
 
std::string getDepartSpeed () const
 obtain depart speed parameter in string format More...
 

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

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

Detailed Description

Structure representing possible vehicle parameter.

When used within a vehicle, parameter are usually const except for selected items adaptable via TraCI which are flagged as mutable below The fields yielding with "Procedure" describe whether the according value shall be used or another procedure is used to choose the value.

See also
DepartLaneDefinition
DepartPosDefinition
DepartSpeedDefinition

Definition at line 297 of file SUMOVehicleParameter.h.

Constructor & Destructor Documentation

◆ SUMOVehicleParameter()

SUMOVehicleParameter::SUMOVehicleParameter ( )

Constructor.

Initialises the structure with default values

Definition at line 38 of file SUMOVehicleParameter.cpp.

◆ ~SUMOVehicleParameter()

SUMOVehicleParameter::~SUMOVehicleParameter ( )
virtual

Destructor.

Definition at line 56 of file SUMOVehicleParameter.cpp.

Member Function Documentation

◆ areParametersValid()

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

◆ defaultOptionOverrides()

bool SUMOVehicleParameter::defaultOptionOverrides ( const OptionsCont oc,
const std::string &  optionName 
) const

Returns whether the defaults shall be used.

Parameters
[in]ocThe options to get the options from
[in]optionNameThe name of the option to determine whether its value shall be used
Returns
Whether the option is set and –defaults-override was set

Definition at line 61 of file SUMOVehicleParameter.cpp.

References OptionsCont::exists(), OptionsCont::getBool(), and OptionsCont::isSet().

Referenced by write().

◆ getArrivalLane()

std::string SUMOVehicleParameter::getArrivalLane ( ) const
protected

obtain arrival lane parameter in string format

Definition at line 709 of file SUMOVehicleParameter.cpp.

References ARRIVAL_LANE_CURRENT, ARRIVAL_LANE_DEFAULT, ARRIVAL_LANE_GIVEN, arrivalLane, arrivalLaneProcedure, and toString().

Referenced by GNEVehicle::getAttribute(), and write().

◆ getArrivalPos()

std::string SUMOVehicleParameter::getArrivalPos ( ) const
protected

obtain arrival pos parameter in string format

Definition at line 727 of file SUMOVehicleParameter.cpp.

References ARRIVAL_POS_CENTER, ARRIVAL_POS_DEFAULT, ARRIVAL_POS_GIVEN, ARRIVAL_POS_MAX, ARRIVAL_POS_RANDOM, arrivalPos, arrivalPosProcedure, and toString().

Referenced by GNEVehicle::getAttribute(), and write().

◆ getArrivalPosLat()

std::string SUMOVehicleParameter::getArrivalPosLat ( ) const
protected

◆ getArrivalSpeed()

std::string SUMOVehicleParameter::getArrivalSpeed ( ) const
protected

obtain arrival speed parameter in string format

Definition at line 775 of file SUMOVehicleParameter.cpp.

References ARRIVAL_SPEED_CURRENT, ARRIVAL_SPEED_DEFAULT, ARRIVAL_SPEED_GIVEN, arrivalSpeed, arrivalSpeedProcedure, and toString().

Referenced by GNEVehicle::getAttribute(), and write().

◆ getDepart()

std::string SUMOVehicleParameter::getDepart ( ) const
protected

obtain depart parameter in string format

Definition at line 574 of file SUMOVehicleParameter.cpp.

References depart, DEPART_CONTAINER_TRIGGERED, DEPART_TRIGGERED, departProcedure, and time2string().

Referenced by GNEPerson::getBegin(), GNEVehicle::getBegin(), and write().

◆ getDepartLane()

std::string SUMOVehicleParameter::getDepartLane ( ) const
protected

◆ getDepartPos()

std::string SUMOVehicleParameter::getDepartPos ( ) const
protected

◆ getDepartPosLat()

std::string SUMOVehicleParameter::getDepartPosLat ( ) const
protected

◆ getDepartSpeed()

std::string SUMOVehicleParameter::getDepartSpeed ( ) const
protected

◆ getDouble()

◆ 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::MSSOTLPolicy(), MSSOTLPolicy5DFamilyStimulus::MSSOTLPolicy5DFamilyStimulus(), MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic(), GNEVehicleType::overwriteVType(), MSDevice_SSM::requestsTrajectories(), NBEdgeCont::splitAt(), MSDevice_SSM::useGeoCoords(), NWWriter_DlrNavteq::writeLinksUnsplitted(), and NWWriter_OpenDrive::writeRoadObjects().

◆ getParametersMap()

◆ getParametersStr()

◆ interpretEdgePos()

double SUMOVehicleParameter::interpretEdgePos ( double  pos,
double  maximumValue,
SumoXMLAttr  attr,
const std::string &  id 
)
static

Interprets negative edge positions and fits them onto a given edge.

Parameters
[in]posThe position to be interpreted
[in]maximumValueThe maximum allowed value (edge length)
[in]attrThe attribute from which the value originated
[in]idThe id of the object to which this attribute belongs
Returns
Whether the interpreted position

Definition at line 537 of file SUMOVehicleParameter.cpp.

References toString(), and WRITE_WARNING.

Referenced by MSRouteHandler::addStop(), MSContainer::MSContainerStage_Tranship::MSContainerStage_Tranship(), MSPerson::MSPersonStage_Walking::MSPersonStage_Walking(), and SUMOVehicleParserHelper::parseWalkPos().

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

◆ parseArrivalLane()

bool SUMOVehicleParameter::parseArrivalLane ( const std::string &  val,
const std::string &  element,
const std::string &  id,
int &  lane,
ArrivalLaneDefinition ald,
std::string &  error 
)
static

Validates a given arrivalLane value.

Parameters
[in]valThe arrivalLane value to parse
[in]elementThe name of the type of the parsed element, for building the error message
[in]idThe id of the parsed element, for building the error message
[out]laneThe parsed lane, if given
[out]aldThe parsed arrivalLane definition
[out]errorError message, if an error occures
Returns
Whether the given value is a valid arrivalLane definition

Definition at line 419 of file SUMOVehicleParameter.cpp.

References ARRIVAL_LANE_CURRENT, ARRIVAL_LANE_GIVEN, and StringUtils::toInt().

Referenced by libsumo::Vehicle::add(), GNEFrameAttributesModuls::AttributesCreatorRow::checkComplexAttribute(), ROJTRFrame::checkOptions(), RODUAFrame::checkOptions(), checkOptions(), GNEVehicle::isValid(), SUMOVehicleParserHelper::parseCommonAttributes(), and GNEVehicle::setAttribute().

◆ parseArrivalPos()

bool SUMOVehicleParameter::parseArrivalPos ( const std::string &  val,
const std::string &  element,
const std::string &  id,
double &  pos,
ArrivalPosDefinition apd,
std::string &  error 
)
static

Validates a given arrivalPos value.

Parameters
[in]valThe arrivalPos value to parse
[in]elementThe name of the type of the parsed element, for building the error message
[in]idThe id of the parsed element, for building the error message
[out]posThe parsed position, if given
[out]apdThe parsed arrivalPos definition
[out]errorError message, if an error occures
Returns
Whether the given value is a valid arrivalPos definition

Definition at line 448 of file SUMOVehicleParameter.cpp.

References ARRIVAL_POS_CENTER, ARRIVAL_POS_GIVEN, ARRIVAL_POS_MAX, ARRIVAL_POS_RANDOM, and StringUtils::toDouble().

Referenced by libsumo::Vehicle::add(), GNEFrameAttributesModuls::AttributesCreatorRow::checkComplexAttribute(), ROJTRFrame::checkOptions(), RODUAFrame::checkOptions(), checkOptions(), GNEVehicle::isValid(), SUMOVehicleParserHelper::parseCommonAttributes(), SUMOVehicleParserHelper::parseWalkPos(), and GNEVehicle::setAttribute().

◆ parseArrivalPosLat()

bool SUMOVehicleParameter::parseArrivalPosLat ( const std::string &  val,
const std::string &  element,
const std::string &  id,
double &  pos,
ArrivalPosLatDefinition apd,
std::string &  error 
)
static

Validates a given arrivalPosLat value.

Parameters
[in]valThe arrivalPosLat value to parse
[in]elementThe name of the type of the parsed element, for building the error message
[in]idThe id of the parsed element, for building the error message
[out]posThe parsed position, if given
[out]apdThe parsed arrivalPos definition
[out]errorError message, if an error occures
Returns
Whether the given value is a valid arrivalPos definition

Definition at line 478 of file SUMOVehicleParameter.cpp.

References ARRIVAL_POSLAT_CENTER, ARRIVAL_POSLAT_GIVEN, ARRIVAL_POSLAT_LEFT, ARRIVAL_POSLAT_RIGHT, and StringUtils::toDouble().

Referenced by GNEFrameAttributesModuls::AttributesCreatorRow::checkComplexAttribute(), GNEVehicle::isValid(), SUMOVehicleParserHelper::parseCommonAttributes(), and GNEVehicle::setAttribute().

◆ parseArrivalSpeed()

bool SUMOVehicleParameter::parseArrivalSpeed ( const std::string &  val,
const std::string &  element,
const std::string &  id,
double &  speed,
ArrivalSpeedDefinition asd,
std::string &  error 
)
static

Validates a given arrivalSpeed value.

Parameters
[in]valThe arrivalSpeed value to parse
[in]elementThe name of the type of the parsed element, for building the error message
[in]idThe id of the parsed element, for building the error message
[out]speedThe parsed speed, if given
[out]asdThe parsed arrivalSpeed definition
[out]errorError message, if an error occures
Returns
Whether the given value is a valid arrivalSpeed definition

Definition at line 508 of file SUMOVehicleParameter.cpp.

References ARRIVAL_SPEED_CURRENT, ARRIVAL_SPEED_GIVEN, and StringUtils::toDouble().

Referenced by libsumo::Vehicle::add(), GNEFrameAttributesModuls::AttributesCreatorRow::checkComplexAttribute(), ROJTRFrame::checkOptions(), RODUAFrame::checkOptions(), checkOptions(), GNEVehicle::isValid(), SUMOVehicleParserHelper::parseCommonAttributes(), and GNEVehicle::setAttribute().

◆ parseDepart()

bool SUMOVehicleParameter::parseDepart ( const std::string &  val,
const std::string &  element,
const std::string &  id,
SUMOTime depart,
DepartDefinition dd,
std::string &  error 
)
static

Validates a given depart value.

Parameters
[in]valThe depart value to parse
[in]elementThe name of the type of the parsed element, for building the error message
[in]idThe id of the parsed element, for building the error message
[out]departThe parsed depart time, if given
[out]ddThe parsed departProcedure definition
[out]errorError message, if an error occures
Returns
Whether the given value is a valid depart definition

Definition at line 244 of file SUMOVehicleParameter.cpp.

References depart, DEPART_CONTAINER_TRIGGERED, DEPART_GIVEN, DEPART_NOW, DEPART_TRIGGERED, and string2time().

Referenced by libsumo::Vehicle::add(), GNEFrameAttributesModuls::AttributesCreatorRow::checkComplexAttribute(), GNEVehicle::isValid(), SUMOVehicleParserHelper::parseVehicleAttributes(), GNEPerson::setAttribute(), and GNEVehicle::setAttribute().

◆ parseDepartLane()

bool SUMOVehicleParameter::parseDepartLane ( const std::string &  val,
const std::string &  element,
const std::string &  id,
int &  lane,
DepartLaneDefinition dld,
std::string &  error 
)
static

Validates a given departLane value.

Parameters
[in]valThe departLane value to parse
[in]elementThe name of the type of the parsed element, for building the error message
[in]idThe id of the parsed element, for building the error message
[out]laneThe parsed lane, if given
[out]dldThe parsed departLane definition
[out]errorError message, if an error occures
Returns
Whether the given value is a valid departLane definition

Definition at line 275 of file SUMOVehicleParameter.cpp.

References DEPART_LANE_ALLOWED_FREE, DEPART_LANE_BEST_FREE, DEPART_LANE_FIRST_ALLOWED, DEPART_LANE_FREE, DEPART_LANE_GIVEN, DEPART_LANE_RANDOM, and StringUtils::toInt().

Referenced by libsumo::Vehicle::add(), GNEFrameAttributesModuls::AttributesCreatorRow::checkComplexAttribute(), ROJTRFrame::checkOptions(), RODUAFrame::checkOptions(), checkOptions(), GNEVehicle::isValid(), SUMOVehicleParserHelper::parseCommonAttributes(), and GNEVehicle::setAttribute().

◆ parseDepartPos()

bool SUMOVehicleParameter::parseDepartPos ( const std::string &  val,
const std::string &  element,
const std::string &  id,
double &  pos,
DepartPosDefinition dpd,
std::string &  error 
)
static

Validates a given departPos value.

Parameters
[in]valThe departPos value to parse
[in]elementThe name of the type of the parsed element, for building the error message
[in]idThe id of the parsed element, for building the error message
[out]posThe parsed position, if given
[out]dpdThe parsed departPos definition
[out]errorError message, if an error occures
Returns
Whether the given value is a valid departPos definition

Definition at line 312 of file SUMOVehicleParameter.cpp.

References DEPART_POS_BASE, DEPART_POS_FREE, DEPART_POS_GIVEN, DEPART_POS_LAST, DEPART_POS_RANDOM, DEPART_POS_RANDOM_FREE, DEPART_POS_STOP, and StringUtils::toDouble().

Referenced by libsumo::Vehicle::add(), GNEFrameAttributesModuls::AttributesCreatorRow::checkComplexAttribute(), ROJTRFrame::checkOptions(), RODUAFrame::checkOptions(), checkOptions(), GNEPerson::isValid(), GNEVehicle::isValid(), SUMOVehicleParserHelper::parseCommonAttributes(), GNEPerson::setAttribute(), and GNEVehicle::setAttribute().

◆ parseDepartPosLat()

bool SUMOVehicleParameter::parseDepartPosLat ( const std::string &  val,
const std::string &  element,
const std::string &  id,
double &  pos,
DepartPosLatDefinition dpd,
std::string &  error 
)
static

Validates a given departPosLat value.

Parameters
[in]valThe departPosLat value to parse
[in]elementThe name of the type of the parsed element, for building the error message
[in]idThe id of the parsed element, for building the error message
[out]posThe parsed position, if given
[out]dpdThe parsed departPos definition
[out]errorError message, if an error occures
Returns
Whether the given value is a valid departPos definition

Definition at line 348 of file SUMOVehicleParameter.cpp.

References DEPART_POSLAT_CENTER, DEPART_POSLAT_FREE, DEPART_POSLAT_GIVEN, DEPART_POSLAT_LEFT, DEPART_POSLAT_RANDOM, DEPART_POSLAT_RANDOM_FREE, DEPART_POSLAT_RIGHT, and StringUtils::toDouble().

Referenced by GNEFrameAttributesModuls::AttributesCreatorRow::checkComplexAttribute(), GNEVehicle::isValid(), SUMOVehicleParserHelper::parseCommonAttributes(), and GNEVehicle::setAttribute().

◆ parseDepartSpeed()

bool SUMOVehicleParameter::parseDepartSpeed ( const std::string &  val,
const std::string &  element,
const std::string &  id,
double &  speed,
DepartSpeedDefinition dsd,
std::string &  error 
)
static

Validates a given departSpeed value.

Parameters
[in]valThe departSpeed value to parse
[in]elementThe name of the type of the parsed element, for building the error message
[in]idThe id of the parsed element, for building the error message
[out]speedThe parsed speed, if given
[out]dsdThe parsed departSpeed definition
[out]errorError message, if an error occures
Returns
Whether the given value is a valid departSpeed definition

Definition at line 384 of file SUMOVehicleParameter.cpp.

References DEPART_SPEED_DESIRED, DEPART_SPEED_GIVEN, DEPART_SPEED_LIMIT, DEPART_SPEED_MAX, DEPART_SPEED_RANDOM, and StringUtils::toDouble().

Referenced by libsumo::Vehicle::add(), GNEFrameAttributesModuls::AttributesCreatorRow::checkComplexAttribute(), ROJTRFrame::checkOptions(), RODUAFrame::checkOptions(), checkOptions(), GNEVehicle::isValid(), SUMOVehicleParserHelper::parseCommonAttributes(), and GNEVehicle::setAttribute().

◆ parsePersonModes()

bool SUMOVehicleParameter::parsePersonModes ( const std::string &  modes,
const std::string &  element,
const std::string &  id,
SVCPermissions modeSet,
std::string &  error 
)
static

Validates a given person modes value.

Parameters
[in]modesThe modes value to parse
[in]elementThe name of the type of the parsed element, for building the error message
[in]idThe id of the parsed element, for building the error message
[out]modeSetThe parsed modes definition
[out]errorError message, if an error occures
Returns
Whether the given value is a valid arrivalSpeed definition

Definition at line 550 of file SUMOVehicleParameter.cpp.

References StringTokenizer::hasNext(), SVC_BICYCLE, SVC_BUS, and SVC_PASSENGER.

Referenced by MSRouteHandler::addPersonTrip(), GNEFrameAttributesModuls::AttributesCreatorRow::checkComplexAttribute(), and GNEPersonTrip::isValid().

◆ 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

◆ 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

◆ wasSet()

◆ write()

void SUMOVehicleParameter::write ( OutputDevice dev,
const OptionsCont oc,
const SumoXMLTag  tag = SUMO_TAG_VEHICLE,
const std::string &  typeID = "" 
) const

Writes the parameters as a beginning element.

Parameters
[in,out]devThe device to write into
[in]ocThe options to get defaults from
[in]tagThe "root" tag to write (defaults to vehicle)
[in]tagThe typeID to write (defaults to member vtypeid)
Exceptions
IOErrornot yet implemented

Definition at line 67 of file SUMOVehicleParameter.cpp.

References color, containerNumber, defaultOptionOverrides(), OptionsCont::exists(), fromTaz, getArrivalLane(), getArrivalPos(), getArrivalPosLat(), getArrivalSpeed(), getDepart(), getDepartLane(), getDepartPos(), getDepartPosLat(), getDepartSpeed(), OptionsCont::getString(), OptionsCont::isSet(), line, OutputDevice::openTag(), personNumber, speedFactor, SUMO_ATTR_ARRIVALLANE, SUMO_ATTR_ARRIVALPOS, SUMO_ATTR_ARRIVALPOS_LAT, SUMO_ATTR_ARRIVALSPEED, SUMO_ATTR_BEGIN, SUMO_ATTR_COLOR, SUMO_ATTR_CONTAINER_NUMBER, SUMO_ATTR_DEPART, SUMO_ATTR_DEPARTLANE, SUMO_ATTR_DEPARTPOS, SUMO_ATTR_DEPARTPOS_LAT, SUMO_ATTR_DEPARTSPEED, SUMO_ATTR_FROM_TAZ, SUMO_ATTR_ID, SUMO_ATTR_LINE, SUMO_ATTR_PERSON_NUMBER, SUMO_ATTR_SPEEDFACTOR, SUMO_ATTR_TO_TAZ, SUMO_ATTR_TYPE, SUMO_TAG_FLOW, SUMO_TAG_PERSONFLOW, tag, toTaz, VEHPARS_ARRIVALLANE_SET, VEHPARS_ARRIVALPOS_SET, VEHPARS_ARRIVALPOSLAT_SET, VEHPARS_ARRIVALSPEED_SET, VEHPARS_COLOR_SET, VEHPARS_CONTAINER_NUMBER_SET, VEHPARS_DEPARTLANE_SET, VEHPARS_DEPARTPOS_SET, VEHPARS_DEPARTPOSLAT_SET, VEHPARS_DEPARTSPEED_SET, VEHPARS_FROM_TAZ_SET, VEHPARS_LINE_SET, VEHPARS_PERSON_NUMBER_SET, VEHPARS_SPEEDFACTOR_SET, VEHPARS_TO_TAZ_SET, VEHPARS_VTYPE_SET, vtypeid, wasSet(), OutputDevice::writeAttr(), and OutputDevice::writeNonEmptyAttr().

Referenced by MSPerson::routeOutput(), ROVehicle::saveAsXML(), ROPerson::saveAsXML(), MSBaseVehicle::saveState(), GNEPerson::writeDemandElement(), and GNEVehicle::writeDemandElement().

◆ writeParams()

Field Documentation

◆ arrivalLane

◆ arrivalLaneProcedure

◆ arrivalPos

◆ arrivalPosLat

double SUMOVehicleParameter::arrivalPosLat

(optional) The lateral position the vehicle shall arrive on

Definition at line 528 of file SUMOVehicleParameter.h.

Referenced by MSLCM_SL2015::_wantsChangeSublane(), SUMOVehicleParserHelper::parseCommonAttributes(), and GNEVehicle::setAttribute().

◆ arrivalPosLatProcedure

ArrivalPosLatDefinition SUMOVehicleParameter::arrivalPosLatProcedure

Information how the vehicle shall choose the lateral arrival position.

Definition at line 531 of file SUMOVehicleParameter.h.

Referenced by MSLCM_SL2015::_wantsChangeSublane(), getArrivalPosLat(), SUMOVehicleParserHelper::parseCommonAttributes(), and GNEVehicle::setAttribute().

◆ arrivalPosProcedure

◆ arrivalSpeed

◆ arrivalSpeedProcedure

◆ color

◆ containerNumber

int SUMOVehicleParameter::containerNumber

The static number of containers in the vehicle when it departs.

Definition at line 665 of file SUMOVehicleParameter.h.

Referenced by GNEVehicle::getAttribute(), MSBaseVehicle::getContainerNumber(), SUMOVehicleParserHelper::parseCommonAttributes(), GNEVehicle::setAttribute(), and write().

◆ depart

SUMOTime SUMOVehicleParameter::depart

Definition at line 482 of file SUMOVehicleParameter.h.

Referenced by MSVehicleContainer::add(), libsumo::Person::add(), MSTransportableControl::add(), libsumo::Vehicle::add(), MSBaseVehicle::addContainer(), RONet::addFlow(), RORouteHandler::addFlowPerson(), MSRouteHandler::addFlowPerson(), MSBaseVehicle::addPerson(), MSRouteHandler::addPersonTrip(), IntermodalNetwork< E, L, N, V >::addSchedule(), MSRouteHandler::addStop(), MSBaseVehicle::addStops(), MSRouteHandler::addWalk(), RONet::checkFlows(), SUMORouteHandler::checkLastDepart(), RORouteHandler::closeContainer(), MSRouteHandler::closeFlow(), RORouteHandler::closeFlow(), MSRouteHandler::closePerson(), MSRouteHandler::closePersonFlow(), RORouteHandler::closePersonFlow(), MSStateHandler::closeVehicle(), MSRouteHandler::closeVehicle(), RORouteHandler::closeVehicle(), ROPerson::computeRoute(), MSInsertionControl::determineCandidates(), METriggeredCalibrator::execute(), MSCalibrator::execute(), MSDevice_Tripinfo::generateOutputForUnfinished(), GNEPerson::getAttribute(), GNEVehicle::getAttribute(), GNEPerson::getBegin(), GNEVehicle::getBegin(), RORoutable::getDepart(), getDepart(), MSBaseVehicle::getDepartDelay(), MSTransportable::getDesiredDepart(), MSDevice_Routing::MSDevice_Routing(), MSTransportableDevice_Routing::MSTransportableDevice_Routing(), ROMARouteHandler::myEndElement(), MSRouteHandler::myStartElement(), MSDevice_Vehroutes::notifyEnter(), parseDepart(), SUMOVehicleParserHelper::parseFlowAttributes(), SUMOVehicleParserHelper::parseVehicleAttributes(), SUMORouteHandler::registerLastDepart(), MSVehicleContainer::remove(), MSTransportable::Stage_Trip::setArrived(), GNEPerson::setAttribute(), GNEVehicle::setAttribute(), METriggeredCalibrator::tryEmit(), MSInsertionControl::tryInsert(), MSVehicleControl::vehicleDeparted(), and MSDevice_Vehroutes::writeOutput().

◆ departLane

◆ departLaneProcedure

◆ departPos

◆ departPosLat

double SUMOVehicleParameter::departPosLat

(optional) The lateral position the vehicle shall depart from

Definition at line 500 of file SUMOVehicleParameter.h.

Referenced by MSLane::getDepartPosLat(), SUMOVehicleParserHelper::parseCommonAttributes(), and GNEVehicle::setAttribute().

◆ departPosLatProcedure

DepartPosLatDefinition SUMOVehicleParameter::departPosLatProcedure

Information how the vehicle shall choose the lateral departure position.

Definition at line 503 of file SUMOVehicleParameter.h.

Referenced by getDepartPosLat(), MSLane::getDepartPosLat(), MSLane::insertVehicle(), SUMOVehicleParserHelper::parseCommonAttributes(), and GNEVehicle::setAttribute().

◆ departPosProcedure

◆ departProcedure

◆ departSpeed

◆ departSpeedProcedure

◆ fromTaz

◆ id

std::string SUMOVehicleParameter::id

The vehicle's id.

Definition at line 468 of file SUMOVehicleParameter.h.

Referenced by libsumo::Person::add(), MSTransportableControl::add(), libsumo::Vehicle::add(), MSInsertionControl::addFlow(), RONet::addFlow(), RORouteHandler::addFlowPerson(), MSRouteHandler::addFlowPerson(), MSRouteHandler::addPersonTrip(), RORouteHandler::addPersonTrip(), IntermodalNetwork< E, L, N, V >::addSchedule(), MSRouteHandler::addStop(), RORouteHandler::addStop(), GNERouteHandler::addStop(), MSVehicle::addStop(), ROPerson::addTrip(), MSRouteHandler::addWalk(), RORouteHandler::addWalk(), GNERouteHandler::buildFlow(), GNERouteHandler::buildFlowOverRoute(), GNERouteHandler::buildFlowWithEmbeddedRoute(), GNERouteHandler::buildPerson(), GNERouteHandler::buildPersonFlow(), GNERouteHandler::buildTrip(), GNERouteHandler::buildVehicleOverRoute(), GNERouteHandler::buildVehicleWithEmbeddedRoute(), RONet::checkFlows(), SUMORouteHandler::checkLastDepart(), MSRouteHandler::closeContainer(), RORouteHandler::closeContainer(), MSRouteHandler::closeFlow(), RORouteHandler::closeFlow(), MSRouteHandler::closePerson(), RORouteHandler::closePerson(), GNERouteHandler::closePerson(), MSRouteHandler::closePersonFlow(), RORouteHandler::closePersonFlow(), MSRouteHandler::closeRoute(), RORouteHandler::closeRoute(), GNERouteHandler::closeRoute(), MSStateHandler::closeVehicle(), MSRouteHandler::closeVehicle(), RORouteHandler::closeVehicle(), MSInsertionControl::determineCandidates(), METriggeredCalibrator::execute(), MSCalibrator::execute(), MSBaseVehicle::getID(), RORoutable::getID(), MSTransportable::getID(), MSEdge::insertVehicle(), MEVehicle::MEVehicle(), MSBaseVehicle::MSBaseVehicle(), MSVehicle::MSVehicle(), ROMARouteHandler::myEndElement(), MSStateHandler::myStartElement(), MSRouteHandler::myStartElement(), RORouteHandler::myStartElement(), SUMORouteHandler::myStartElement(), GNERouteHandler::openFlow(), MSRouteHandler::openRoute(), RORouteHandler::openRoute(), MSRouteHandler::openRouteDistribution(), RORouteHandler::openRouteDistribution(), GNERouteHandler::openTrip(), SUMOVehicleParserHelper::parseCommonAttributes(), SUMOVehicleParserHelper::parseFlowAttributes(), MSRouteHandler::parseFromViaTo(), RORouteHandler::parseFromViaTo(), SUMOVehicleParserHelper::parseVehicleAttributes(), GNEPerson::setAttribute(), and GNEVehicle::setAttribute().

◆ line

◆ myMap

◆ parametersSet

◆ personNumber

int SUMOVehicleParameter::personNumber

The static number of persons in the vehicle when it departs (not including boarding persons)

Definition at line 662 of file SUMOVehicleParameter.h.

Referenced by libsumo::Vehicle::add(), GNEVehicle::getAttribute(), MSBaseVehicle::getPersonNumber(), SUMOVehicleParserHelper::parseCommonAttributes(), GNEVehicle::setAttribute(), and write().

◆ repetitionEnd

◆ repetitionNumber

◆ repetitionOffset

◆ repetitionProbability

◆ repetitionsDone

int SUMOVehicleParameter::repetitionsDone

The number of times the vehicle was already inserted.

Definition at line 547 of file SUMOVehicleParameter.h.

Referenced by MSBaseVehicle::addStops(), RONet::checkFlows(), MSRouteHandler::closeFlow(), RORouteHandler::closeFlow(), and MSInsertionControl::determineCandidates().

◆ routeid

◆ speedFactor

double SUMOVehicleParameter::speedFactor

individual speedFactor (overriding distribution from vType)

Definition at line 668 of file SUMOVehicleParameter.h.

Referenced by SUMOVehicleParserHelper::parseCommonAttributes(), and write().

◆ stops

◆ tag

◆ toTaz

◆ via

◆ vtypeid


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