SUMO - Simulation of Urban MObility
SUMOVTypeParameter Class Reference

Structure representing possible vehicle parameter. More...

#include <SUMOVTypeParameter.h>

Inheritance diagram for SUMOVTypeParameter:
Inheritance graph
Collaboration diagram for SUMOVTypeParameter:
Collaboration graph

Public Types

typedef std::map< SumoXMLAttr, SUMORealSubParams
 sub-model parameters More...
 

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...
 
void clearParameter ()
 Clears the parameter map. More...
 
SUMOReal getCFParam (const SumoXMLAttr attr, const SUMOReal defaultValue) const
 Returns the named value from the map, or the default if it is not contained there. More...
 
SUMOReal getLCParam (const SumoXMLAttr attr, const SUMOReal defaultValue) const
 Returns the named value from the map, or the default if it is not contained there. More...
 
const std::map< std::string, std::string > & getMap () const
 Returns the inner key/value map. More...
 
const std::string & getParameter (const std::string &key, const std::string &defaultValue) const
 Returns the value for a given key. More...
 
bool knowsParameter (const std::string &key) const
 Returns whether the parameter is known. More...
 
 SUMOVTypeParameter (const std::string &vtid, const SUMOVehicleClass vc=SVC_IGNORING)
 Constructor. More...
 
void validateCFParameter () const
 Validates stored car-following parameter. More...
 
bool wasSet (int what) const
 Returns whether the given parameter was set. More...
 
void write (OutputDevice &dev) const
 Writes the vtype. More...
 

Static Public Member Functions

static const SUMOVTypeParametergetDefault ()
 return the default parameters, this is a function due to the http://www.parashift.com/c++-faq/static-init-order.html More...
 
static SUMOReal getDefaultAccel (const SUMOVehicleClass vc=SVC_IGNORING)
 Returns the default acceleration for the given vehicle class This needs to be a function because the actual value is stored in the car following model. More...
 
static SUMOReal getDefaultDecel (const SUMOVehicleClass vc=SVC_IGNORING)
 Returns the default deceleration for the given vehicle class This needs to be a function because the actual value is stored in the car following model. More...
 
static SUMOReal getDefaultImperfection (const SUMOVehicleClass vc=SVC_IGNORING)
 Returns the default driver's imperfection (sigma or epsilon in Krauss' model) for the given vehicle class This needs to be a function because the actual value is stored in the car following model. More...
 

Data Fields

SUMOTime boardingDuration
 The time a person needs to board the vehicle. More...
 
SumoXMLTag cfModel
 The enum-representation of the car-following model to use. More...
 
SubParams cfParameter
 Car-following parameter. More...
 
RGBColor color
 The color. More...
 
int containerCapacity
 The container capacity of the vehicle. More...
 
SUMOReal defaultProbability
 The probability when being added to a distribution without an explicit probability. More...
 
SUMOEmissionClass emissionClass
 The emission class of this vehicle. More...
 
std::string id
 The vehicle type's id. More...
 
SUMOReal impatience
 The vehicle's impatience (willingness to obstruct others) More...
 
LateralAlignment latAlignment
 The vehicles desired lateral alignment. More...
 
LaneChangeModel lcModel
 The lane-change model to use. More...
 
SubParams lcParameter
 Lane-changing parameter. More...
 
SUMOReal length
 The physical vehicle length. More...
 
SUMOTime loadingDuration
 The time a container needs to get loaded on the vehicle. More...
 
SUMOReal maxSpeed
 The vehicle type's maximum speed [m/s]. More...
 
SUMOReal maxSpeedLat
 The vehicle type's maximum lateral speed [m/s]. More...
 
SUMOReal minGap
 This class' free space in front of the vehicle itself. More...
 
SUMOReal minGapLat
 The vehicle type's minimum lateral gap [m]. More...
 
bool onlyReferenced
 Information whether this is a type-stub, being only referenced but not defined (needed by routers) More...
 
int personCapacity
 The person capacity of the vehicle. More...
 
bool saved
 Information whether this type was already saved (needed by routers) More...
 
int setParameter
 Information for the router which parameter were set. More...
 
SUMOReal speedDev
 The standard deviation for speed variations. More...
 
SUMOReal speedFactor
 The factor by which the maximum speed may deviate from the allowed max speed on the street. More...
 
SUMOVehicleClass vehicleClass
 The vehicle's class. More...
 
Values for drawing this class' vehicles
SUMOReal width
 This class' width. More...
 
SUMOReal height
 This class' height. More...
 
SUMOVehicleShape shape
 This class' shape. More...
 
std::string osgFile
 3D model file for this class More...
 
std::string imgFile
 Image file for this class. More...
 

Detailed Description

Structure representing possible vehicle parameter.

Definition at line 85 of file SUMOVTypeParameter.h.

Member Typedef Documentation

§ SubParams

sub-model parameters

Definition at line 186 of file SUMOVTypeParameter.h.

Constructor & Destructor Documentation

§ SUMOVTypeParameter()

Member Function Documentation

§ addParameter() [1/3]

§ addParameter() [2/3]

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

Adds all given parameter.

Parameters
[in]mapArgThe keys/values to insert

Definition at line 59 of file Parameterised.cpp.

References Parameterised::myMap.

§ addParameter() [3/3]

void Parameterised::addParameter ( const Parameterised p)
inherited

Adds all given parameter.

Parameters
[in]pThe keys/values to insert

Definition at line 67 of file Parameterised.cpp.

References Parameterised::myMap.

§ clearParameter()

void Parameterised::clearParameter ( )
inherited

Clears the parameter map.

Definition at line 91 of file Parameterised.cpp.

References Parameterised::myMap.

§ getCFParam()

SUMOReal SUMOVTypeParameter::getCFParam ( const SumoXMLAttr  attr,
const SUMOReal  defaultValue 
) const

Returns the named value from the map, or the default if it is not contained there.

Parameters
[in]attrThe corresponding xml attribute
[in]defaultValueThe value to return if the given map does not contain the named variable
Returns
The named value from the map or the default if it does not exist there

Definition at line 308 of file SUMOVTypeParameter.cpp.

References cfParameter, and SUMOReal.

Referenced by MSVehicleType::build(), ROEdge::getEmissionEffort(), and wasSet().

§ getDefault()

const SUMOVTypeParameter & SUMOVTypeParameter::getDefault ( )
static

return the default parameters, this is a function due to the http://www.parashift.com/c++-faq/static-init-order.html

Definition at line 413 of file SUMOVTypeParameter.cpp.

Referenced by MESegment::jamThresholdForSpeed(), and TraCIServerAPI_Lane::processGet().

§ getDefaultAccel()

SUMOReal SUMOVTypeParameter::getDefaultAccel ( const SUMOVehicleClass  vc = SVC_IGNORING)
static

Returns the default acceleration for the given vehicle class This needs to be a function because the actual value is stored in the car following model.

Parameters
[in]vcthe vehicle class
Returns
the acceleration in m/s^2

Definition at line 328 of file SUMOVTypeParameter.cpp.

References SUMOReal, SVC_BICYCLE, SVC_BUS, SVC_COACH, SVC_MOPED, SVC_MOTORCYCLE, SVC_PEDESTRIAN, SVC_RAIL, SVC_RAIL_ELECTRIC, SVC_RAIL_URBAN, SVC_SHIP, SVC_TRAILER, SVC_TRAM, and SVC_TRUCK.

Referenced by MSVehicleType::build(), and ROEdge::getEmissionEffort().

§ getDefaultDecel()

SUMOReal SUMOVTypeParameter::getDefaultDecel ( const SUMOVehicleClass  vc = SVC_IGNORING)
static

Returns the default deceleration for the given vehicle class This needs to be a function because the actual value is stored in the car following model.

Parameters
[in]vcthe vehicle class
Returns
the deceleration in m/s^2

Definition at line 363 of file SUMOVTypeParameter.cpp.

References SUMOReal, SVC_BICYCLE, SVC_BUS, SVC_COACH, SVC_MOPED, SVC_MOTORCYCLE, SVC_PEDESTRIAN, SVC_RAIL, SVC_RAIL_ELECTRIC, SVC_RAIL_URBAN, SVC_SHIP, SVC_TRAILER, SVC_TRAM, and SVC_TRUCK.

Referenced by MSVehicleType::build(), and TraCIServerAPI_Lane::processGet().

§ getDefaultImperfection()

SUMOReal SUMOVTypeParameter::getDefaultImperfection ( const SUMOVehicleClass  vc = SVC_IGNORING)
static

Returns the default driver's imperfection (sigma or epsilon in Krauss' model) for the given vehicle class This needs to be a function because the actual value is stored in the car following model.

Parameters
[in]vcthe vehicle class
Returns
the imperfection as a value between 0 and 1

Definition at line 398 of file SUMOVTypeParameter.cpp.

References SVC_RAIL, SVC_RAIL_ELECTRIC, SVC_RAIL_URBAN, SVC_SHIP, and SVC_TRAM.

Referenced by MSVehicleType::build(), and ROEdge::getEmissionEffort().

§ getLCParam()

SUMOReal SUMOVTypeParameter::getLCParam ( const SumoXMLAttr  attr,
const SUMOReal  defaultValue 
) const

Returns the named value from the map, or the default if it is not contained there.

Parameters
[in]attrThe corresponding xml attribute
[in]defaultValueThe value to return if the given map does not contain the named variable
Returns
The named value from the map or the default if it does not exist there

Definition at line 317 of file SUMOVTypeParameter.cpp.

References lcParameter, and SUMOReal.

Referenced by wasSet().

§ getMap()

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

References Parameterised::myMap.

Referenced by MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic(), MSDevice_Battery::buildVehicleDevices(), MSDevice_Example::buildVehicleDevices(), MSDevice::equippedByDefaultAssignmentOptions(), MSSOTLTrafficLightLogic::getDecayConstant(), MSTLLogicControl::WAUTSwitchProcedure::getGSPValue(), MSSOTLTrafficLightLogic::getInputSensorsLength(), MSSOTLRequestPolicy::getMinDecisionalPhaseDuration(), MSSOTLRequestTrafficLightLogic::getMinDecisionalPhaseDuration(), MSSOTLTrafficLightLogic::getMode(), MSSOTLTrafficLightLogic::getOutputSensorsLength(), MSSOTLTrafficLightLogic::getSpeedThreshold(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(), MSSOTLTrafficLightLogic::getThreshold(), PushButtonLogic::init(), MSSOTLPhasePolicy::init(), SigmoidLogic::init(), MSSOTLTrafficLightLogic::init(), MSSwarmTrafficLightLogic::init(), MSSOTLTrafficLightLogic::isDecayThresholdActivated(), MSSOTLTrafficLightLogic::isPushButtonPressed(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSSOTLPolicy::MSSOTLPolicy(), MSSOTLPolicy5DFamilyStimulus::MSSOTLPolicy5DFamilyStimulus(), MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Lane::processGet(), MSSOTLPolicyDesirability::readParameter(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), and TraCIServerAPI_Vehicle::vtdMap().

§ knowsParameter()

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

Returns whether the parameter is known.

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

Definition at line 75 of file Parameterised.cpp.

References Parameterised::myMap.

Referenced by MSDevice_Example::buildVehicleDevices(), and MSDevice::equippedByDefaultAssignmentOptions().

§ validateCFParameter()

void SUMOVTypeParameter::validateCFParameter ( ) const

Validates stored car-following parameter.

Referenced by wasSet().

§ wasSet()

bool SUMOVTypeParameter::wasSet ( int  what) const
inline

Returns whether the given parameter was set.

Parameters
[in]whatThe parameter which one asks for
Returns
Whether the given parameter was set

Definition at line 98 of file SUMOVTypeParameter.h.

References getCFParam(), getLCParam(), setParameter, SUMOReal, validateCFParameter(), and write().

Referenced by write().

§ write()

void SUMOVTypeParameter::write ( OutputDevice dev) const

Writes the vtype.

Parameters
[in,out]devThe device to write into
Exceptions
IOErrornot yet implemented

Definition at line 198 of file SUMOVTypeParameter.cpp.

References boardingDuration, cfModel, cfParameter, OutputDevice::closeTag(), color, containerCapacity, defaultProbability, emissionClass, Parameterised::getMap(), PollutantsInterface::getName(), getVehicleShapeName(), height, imgFile, impatience, latAlignment, lcModel, lcParameter, length, loadingDuration, max, maxSpeed, maxSpeedLat, minGap, minGapLat, onlyReferenced, OutputDevice::openTag(), osgFile, personCapacity, shape, speedDev, speedFactor, SUMO_ATTR_BOARDING_DURATION, SUMO_ATTR_COLOR, SUMO_ATTR_CONTAINER_CAPACITY, SUMO_ATTR_EMISSIONCLASS, SUMO_ATTR_GUISHAPE, SUMO_ATTR_HEIGHT, SUMO_ATTR_ID, SUMO_ATTR_IMGFILE, SUMO_ATTR_IMPATIENCE, SUMO_ATTR_KEY, SUMO_ATTR_LANE_CHANGE_MODEL, SUMO_ATTR_LATALIGNMENT, SUMO_ATTR_LENGTH, SUMO_ATTR_LOADING_DURATION, SUMO_ATTR_MAXSPEED, SUMO_ATTR_MAXSPEED_LAT, SUMO_ATTR_MINGAP, SUMO_ATTR_MINGAP_LAT, SUMO_ATTR_OSGFILE, SUMO_ATTR_PERSON_CAPACITY, SUMO_ATTR_PROB, SUMO_ATTR_SPEEDDEV, SUMO_ATTR_SPEEDFACTOR, SUMO_ATTR_VALUE, SUMO_ATTR_VCLASS, SUMO_ATTR_WIDTH, SUMO_TAG_PARAM, SUMO_TAG_VTYPE, SUMOReal, toString(), vehicleClass, VTYPEPARS_BOARDING_DURATION, VTYPEPARS_CAR_FOLLOW_MODEL, VTYPEPARS_COLOR_SET, VTYPEPARS_CONTAINER_CAPACITY, VTYPEPARS_EMISSIONCLASS_SET, VTYPEPARS_HEIGHT_SET, VTYPEPARS_IMGFILE_SET, VTYPEPARS_IMPATIENCE_SET, VTYPEPARS_LANE_CHANGE_MODEL_SET, VTYPEPARS_LATALIGNMENT_SET, VTYPEPARS_LENGTH_SET, VTYPEPARS_LOADING_DURATION, VTYPEPARS_MAXSPEED_LAT_SET, VTYPEPARS_MAXSPEED_SET, VTYPEPARS_MINGAP_LAT_SET, VTYPEPARS_MINGAP_SET, VTYPEPARS_OSGFILE_SET, VTYPEPARS_PERSON_CAPACITY, VTYPEPARS_PROBABILITY_SET, VTYPEPARS_SHAPE_SET, VTYPEPARS_SPEEDDEVIATION_SET, VTYPEPARS_SPEEDFACTOR_SET, VTYPEPARS_VEHICLECLASS_SET, VTYPEPARS_WIDTH_SET, wasSet(), width, and OutputDevice::writeAttr().

Referenced by ROVehicle::saveAsXML(), ROPerson::saveAsXML(), wasSet(), and RODFDetectorCon::writeEmitters().

Field Documentation

§ boardingDuration

SUMOTime SUMOVTypeParameter::boardingDuration

The time a person needs to board the vehicle.

Definition at line 158 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getBoardingDuration(), and write().

§ cfModel

SumoXMLTag SUMOVTypeParameter::cfModel

The enum-representation of the car-following model to use.

Definition at line 183 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::build(), SUMOVehicleParserHelper::parseVTypeEmbedded(), and write().

§ cfParameter

SubParams SUMOVTypeParameter::cfParameter

Car-following parameter.

Definition at line 188 of file SUMOVTypeParameter.h.

Referenced by getCFParam(), SUMOVehicleParserHelper::parseVTypeEmbedded(), and write().

§ color

RGBColor SUMOVTypeParameter::color

§ containerCapacity

int SUMOVTypeParameter::containerCapacity

The container capacity of the vehicle.

Definition at line 156 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getContainerCapacity(), SUMOVTypeParameter(), and write().

§ defaultProbability

SUMOReal SUMOVTypeParameter::defaultProbability

The probability when being added to a distribution without an explicit probability.

Definition at line 140 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getDefaultProbability(), RORouteHandler::myEndElement(), MSVehicleType::setDefaultProbability(), and write().

§ emissionClass

§ height

SUMOReal SUMOVTypeParameter::height

§ id

§ imgFile

std::string SUMOVTypeParameter::imgFile

Image file for this class.

Definition at line 178 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getImgFile(), and write().

§ impatience

SUMOReal SUMOVTypeParameter::impatience

The vehicle's impatience (willingness to obstruct others)

Definition at line 152 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getImpatience(), TraCIServerAPI_Lane::processGet(), MSVehicleType::setImpatience(), and write().

§ latAlignment

LateralAlignment SUMOVTypeParameter::latAlignment

The vehicles desired lateral alignment.

Definition at line 198 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getPreferredLateralAlignment(), and write().

§ lcModel

LaneChangeModel SUMOVTypeParameter::lcModel

The lane-change model to use.

Definition at line 193 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getLaneChangeModel(), and write().

§ lcParameter

SubParams SUMOVTypeParameter::lcParameter

Lane-changing parameter.

Definition at line 190 of file SUMOVTypeParameter.h.

Referenced by getLCParam(), SUMOVehicleParserHelper::parseLCParams(), and write().

§ length

§ loadingDuration

SUMOTime SUMOVTypeParameter::loadingDuration

The time a container needs to get loaded on the vehicle.

Definition at line 160 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getLoadingDuration(), and write().

§ maxSpeed

§ maxSpeedLat

SUMOReal SUMOVTypeParameter::maxSpeedLat

The vehicle type's maximum lateral speed [m/s].

Definition at line 196 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getMaxSpeedLat(), and write().

§ minGap

§ minGapLat

SUMOReal SUMOVTypeParameter::minGapLat

The vehicle type's minimum lateral gap [m].

Definition at line 200 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getMinGapLat(), and write().

§ onlyReferenced

bool SUMOVTypeParameter::onlyReferenced
mutable

Information whether this is a type-stub, being only referenced but not defined (needed by routers)

Definition at line 210 of file SUMOVTypeParameter.h.

Referenced by RONet::RONet(), and write().

§ osgFile

std::string SUMOVTypeParameter::osgFile

3D model file for this class

Definition at line 175 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getOSGFile(), SUMOVTypeParameter(), and write().

§ personCapacity

int SUMOVTypeParameter::personCapacity

The person capacity of the vehicle.

Definition at line 154 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getPersonCapacity(), SUMOVTypeParameter(), and write().

§ saved

bool SUMOVTypeParameter::saved
mutable

Information whether this type was already saved (needed by routers)

Definition at line 207 of file SUMOVTypeParameter.h.

Referenced by ROVehicle::saveAsXML(), and ROPerson::saveAsXML().

§ setParameter

§ shape

§ speedDev

§ speedFactor

SUMOReal SUMOVTypeParameter::speedFactor

§ vehicleClass

§ width

SUMOReal SUMOVTypeParameter::width

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