SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SUMOVTypeParameter Class Reference

Structure representing possible vehicle parameter. More...

#include <SUMOVTypeParameter.h>

Inheritance diagram for SUMOVTypeParameter:
Parameterised

Public Types

typedef std::map< SumoXMLAttr,
SUMOReal
CFParams
 Car-following parameter. 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 get (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...
 
CFParams cfParameter
 
RGBColor color
 The color. More...
 
unsigned 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...
 
LaneChangeModel lcModel
 The lane-change model to use. 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 minGap
 This class' free space in front of the vehicle itself. More...
 
bool onlyReferenced
 Information whether this is a type-stub, being only referenced but not defined (needed by routers) More...
 
unsigned 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 81 of file SUMOVTypeParameter.h.

Member Typedef Documentation

Car-following parameter.

Definition at line 177 of file SUMOVTypeParameter.h.

Constructor & Destructor Documentation

Member Function Documentation

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.

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.

void Parameterised::clearParameter ( )
inherited

Clears the parameter map.

Definition at line 91 of file Parameterised.cpp.

References Parameterised::myMap.

SUMOReal SUMOVTypeParameter::get ( 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 287 of file SUMOVTypeParameter.cpp.

References cfParameter.

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

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 382 of file SUMOVTypeParameter.cpp.

Referenced by TraCIServerAPI_Lane::processGet().

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 297 of file SUMOVTypeParameter.cpp.

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

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 332 of file SUMOVTypeParameter.cpp.

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

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

const std::map<std::string, std::string>& Parameterised::getMap ( ) const
inlineinherited
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().

void SUMOVTypeParameter::validateCFParameter ( ) const

Validates stored car-following parameter.

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 94 of file SUMOVTypeParameter.h.

References setParameter.

Referenced by 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 193 of file SUMOVTypeParameter.cpp.

References boardingDuration, cfModel, cfParameter, OutputDevice::closeTag(), color, containerCapacity, defaultProbability, emissionClass, Parameterised::getMap(), PollutantsInterface::getName(), getVehicleShapeName(), height, imgFile, impatience, lcModel, length, loadingDuration, max, maxSpeed, minGap, 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_LENGTH, SUMO_ATTR_LOADING_DURATION, SUMO_ATTR_MAXSPEED, SUMO_ATTR_MINGAP, 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, toString(), vehicleClass, VTYPEPARS_BOARDING_DURATION, VTYPEPARS_COLOR_SET, VTYPEPARS_CONTAINER_CAPACITY, VTYPEPARS_EMISSIONCLASS_SET, VTYPEPARS_HEIGHT_SET, VTYPEPARS_IMGFILE_SET, VTYPEPARS_IMPATIENCE_SET, VTYPEPARS_LANE_CHANGE_MODEL_SET, VTYPEPARS_LENGTH_SET, VTYPEPARS_LOADING_DURATION, VTYPEPARS_MAXSPEED_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::saveTypeAsXML().

Field Documentation

SUMOTime SUMOVTypeParameter::boardingDuration

The time a person needs to board the vehicle.

Definition at line 147 of file SUMOVTypeParameter.h.

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

SumoXMLTag SUMOVTypeParameter::cfModel

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

Definition at line 174 of file SUMOVTypeParameter.h.

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

CFParams SUMOVTypeParameter::cfParameter

Definition at line 178 of file SUMOVTypeParameter.h.

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

RGBColor SUMOVTypeParameter::color
unsigned int SUMOVTypeParameter::containerCapacity

The container capacity of the vehicle.

Definition at line 145 of file SUMOVTypeParameter.h.

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

SUMOReal SUMOVTypeParameter::defaultProbability

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

Definition at line 129 of file SUMOVTypeParameter.h.

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

SUMOReal SUMOVTypeParameter::height
std::string SUMOVTypeParameter::imgFile

Image file for this class.

Definition at line 169 of file SUMOVTypeParameter.h.

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

SUMOReal SUMOVTypeParameter::impatience

The vehicle's impatience (willingness to obstruct others)

Definition at line 141 of file SUMOVTypeParameter.h.

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

LaneChangeModel SUMOVTypeParameter::lcModel

The lane-change model to use.

Definition at line 181 of file SUMOVTypeParameter.h.

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

SUMOTime SUMOVTypeParameter::loadingDuration

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

Definition at line 149 of file SUMOVTypeParameter.h.

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

SUMOReal SUMOVTypeParameter::minGap
bool SUMOVTypeParameter::onlyReferenced
mutable

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

Definition at line 191 of file SUMOVTypeParameter.h.

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

std::string SUMOVTypeParameter::osgFile

3D model file for this class

Definition at line 166 of file SUMOVTypeParameter.h.

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

unsigned int SUMOVTypeParameter::personCapacity

The person capacity of the vehicle.

Definition at line 143 of file SUMOVTypeParameter.h.

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

bool SUMOVTypeParameter::saved
mutable

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

Definition at line 188 of file SUMOVTypeParameter.h.

Referenced by ROVehicle::saveTypeAsXML().

int SUMOVTypeParameter::setParameter

Information for the router which parameter were set.

Definition at line 184 of file SUMOVTypeParameter.h.

Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleControl::MSVehicleControl(), MSVehicleType::wasSet(), and wasSet().

SUMOReal SUMOVTypeParameter::speedDev
SUMOReal SUMOVTypeParameter::speedFactor
SUMOReal SUMOVTypeParameter::width

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