SUMO - Simulation of Urban MObility
|
Structure representing possible vehicle parameter. More...
#include <SUMOVTypeParameter.h>
Public Types | |
typedef std::map< SumoXMLAttr, SUMOReal > | CFParams |
Car-following parameter. |
Public Member Functions | |
void | addParameter (const std::string &key, const std::string &value) |
Adds a parameter. | |
void | addParameter (const std::map< std::string, std::string > &mapArg) |
Adds all given parameter. | |
void | addParameter (const Parameterised &p) |
Adds all given parameter. | |
void | clearParameter () |
Clears the parameter map. | |
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. | |
const std::map< std::string, std::string > & | getMap () const |
Returns the inner key/value map. | |
const std::string & | getParameter (const std::string &key, const std::string &defaultValue) const |
Returns the value for a given key. | |
bool | knowsParameter (const std::string &key) const |
Returns whether the parameter is known. | |
SUMOVTypeParameter (const std::string &vtid, const SUMOVehicleClass vc=SVC_IGNORING) | |
Constructor. | |
void | validateCFParameter () const |
Validates stored car-following parameter. | |
bool | wasSet (int what) const |
Returns whether the given parameter was set. | |
void | write (OutputDevice &dev) const |
Writes the vtype. |
Static Public Member Functions | |
static const SUMOVTypeParameter & | getDefault () |
return the default parameters, this is a function due to the http://www.parashift.com/c++-faq/static-init-order.html | |
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. | |
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. | |
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. |
Data Fields | |
SumoXMLTag | cfModel |
The enum-representation of the car-following model to use. | |
CFParams | cfParameter |
RGBColor | color |
The color. | |
SUMOReal | defaultProbability |
The probability when being added to a distribution without an explicit probability. | |
SUMOEmissionClass | emissionClass |
The emission class of this vehicle. | |
std::string | id |
The vehicle type's id. | |
SUMOReal | impatience |
The vehicle's impatience (willingness to obstruct others) | |
LaneChangeModel | lcModel |
The lane-change model to use. | |
SUMOReal | length |
The physical vehicle length. | |
SUMOReal | maxSpeed |
The vehicle type's maximum speed [m/s]. | |
SUMOReal | minGap |
This class' free space in front of the vehicle itself. | |
bool | onlyReferenced |
Information whether this is a type-stub, being only referenced but not defined (needed by routers) | |
bool | saved |
Information whether this type was already saved (needed by routers) | |
int | setParameter |
Information for the router which parameter were set. | |
SUMOReal | speedDev |
The standard deviation for speed variations. | |
SUMOReal | speedFactor |
The factor by which the maximum speed may deviate from the allowed max speed on the street. | |
SUMOVehicleClass | vehicleClass |
The vehicle's class. | |
Values for drawing this class' vehicles | |
SUMOReal | width |
This class' width. | |
SUMOReal | height |
This class' height. | |
SUMOVehicleShape | shape |
This class' shape. | |
std::string | osgFile |
3D model file for this class | |
std::string | imgFile |
Image file for this class. |
Structure representing possible vehicle parameter.
Definition at line 78 of file SUMOVTypeParameter.h.
typedef std::map<SumoXMLAttr, SUMOReal> SUMOVTypeParameter::CFParams |
Car-following parameter.
Definition at line 165 of file SUMOVTypeParameter.h.
SUMOVTypeParameter::SUMOVTypeParameter | ( | const std::string & | vtid, |
const SUMOVehicleClass | vc = SVC_IGNORING |
||
) |
Constructor.
Initialises the structure with default values
Definition at line 51 of file SUMOVTypeParameter.cpp.
References DEFAULT_PEDESTRIAN_SPEED, DEFAULT_VEH_PROB, height, length, maxSpeed, minGap, shape, SVC_BICYCLE, SVC_BUS, SVC_COACH, SVC_DELIVERY, SVC_E_VEHICLE, SVC_EMERGENCY, SVC_MOPED, SVC_MOTORCYCLE, SVC_PASSENGER, SVC_PEDESTRIAN, SVC_RAIL, SVC_RAIL_ELECTRIC, SVC_RAIL_URBAN, SVC_TRAILER, SVC_TRAM, SVC_TRUCK, SVS_BICYCLE, SVS_BUS, SVS_BUS_COACH, SVS_DELIVERY, SVS_E_VEHICLE, SVS_MOPED, SVS_MOTORCYCLE, SVS_PASSENGER, SVS_PEDESTRIAN, SVS_RAIL, SVS_RAIL_CAR, SVS_TRUCK, SVS_TRUCK_SEMITRAILER, and width.
|
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 NLHandler::addParam(), SUMORouteHandler::addParam(), PCLoaderOSM::addPOI(), PCLoaderOSM::addPolygon(), NBTrafficLightDefinition::compute(), NIImporter_OpenDrive::loadNetwork(), and NIImporter_MATSim::EdgesHandler::myStartElement().
|
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.
|
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.
[in] | attr | The corresponding xml attribute |
[in] | defaultValue | The value to return if the given map does not contain the named variable |
Definition at line 249 of file SUMOVTypeParameter.cpp.
References cfParameter.
Referenced by MSVehicleType::build(), ROEdge::getCO2Effort(), ROEdge::getCOEffort(), ROEdge::getFuelEffort(), ROEdge::getHCEffort(), ROEdge::getNOxEffort(), and ROEdge::getPMxEffort().
|
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 339 of file SUMOVTypeParameter.cpp.
Referenced by TraCIServerAPI_Lane::processGet().
|
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.
[in] | vc | the vehicle class |
Definition at line 259 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_TRAILER, SVC_TRAM, and SVC_TRUCK.
Referenced by MSVehicleType::build(), ROEdge::getCO2Effort(), ROEdge::getCOEffort(), ROEdge::getFuelEffort(), ROEdge::getHCEffort(), ROEdge::getNOxEffort(), ROEdge::getPMxEffort(), and GUIVisualizationSettings::GUIVisualizationSettings().
|
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.
[in] | vc | the vehicle class |
Definition at line 292 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_TRAILER, SVC_TRAM, and SVC_TRUCK.
Referenced by MSVehicleType::build(), GUIVisualizationSettings::GUIVisualizationSettings(), and TraCIServerAPI_Lane::processGet().
|
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.
[in] | vc | the vehicle class |
Definition at line 325 of file SUMOVTypeParameter.cpp.
References SVC_RAIL, SVC_RAIL_ELECTRIC, SVC_RAIL_URBAN, and SVC_TRAM.
Referenced by MSVehicleType::build(), ROEdge::getCO2Effort(), ROEdge::getCOEffort(), ROEdge::getFuelEffort(), ROEdge::getHCEffort(), ROEdge::getNOxEffort(), and ROEdge::getPMxEffort().
|
inlineinherited |
Returns the inner key/value map.
Definition at line 107 of file Parameterised.h.
References Parameterised::myMap.
Referenced by NBTrafficLightDefinition::compute(), GUIVehicle::getParameterWindow(), and PCPolyContainer::save().
|
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_Example::buildVehicleDevices(), MSDevice::equippedByDefaultAssignmentOptions(), MSTLLogicControl::WAUTSwitchProcedure::getGSPValue(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(), MSAgentbasedTrafficLightLogic::init(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSAgentbasedTrafficLightLogic::MSAgentbasedTrafficLightLogic(), and TraCIServerAPI_Vehicle::vtdMap_matchingNearest().
|
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(), MSDevice::equippedByDefaultAssignmentOptions(), and TraCIServerAPI_Vehicle::vtdMap_matchingNearest().
void SUMOVTypeParameter::validateCFParameter | ( | ) | const |
Validates stored car-following parameter.
Returns whether the given parameter was set.
[in] | what | The parameter which one asks for |
Definition at line 91 of file SUMOVTypeParameter.h.
References setParameter.
Referenced by write().
void SUMOVTypeParameter::write | ( | OutputDevice & | dev | ) | const |
Writes the vtype.
[in,out] | dev | The device to write into |
IOError | not yet implemented |
Definition at line 171 of file SUMOVTypeParameter.cpp.
References cfModel, cfParameter, OutputDevice::closeTag(), color, defaultProbability, emissionClass, PollutantsInterface::getName(), getVehicleShapeName(), height, imgFile, impatience, lcModel, length, max, maxSpeed, minGap, onlyReferenced, OutputDevice::openTag(), osgFile, shape, speedDev, speedFactor, SUMO_ATTR_COLOR, SUMO_ATTR_EMISSIONCLASS, SUMO_ATTR_GUISHAPE, SUMO_ATTR_HEIGHT, SUMO_ATTR_ID, SUMO_ATTR_IMGFILE, SUMO_ATTR_IMPATIENCE, SUMO_ATTR_LANE_CHANGE_MODEL, SUMO_ATTR_LENGTH, SUMO_ATTR_MAXSPEED, SUMO_ATTR_MINGAP, SUMO_ATTR_OSGFILE, SUMO_ATTR_PROB, SUMO_ATTR_SPEEDDEV, SUMO_ATTR_SPEEDFACTOR, SUMO_ATTR_VCLASS, SUMO_ATTR_WIDTH, SUMO_TAG_VTYPE, toString(), vehicleClass, VTYPEPARS_COLOR_SET, VTYPEPARS_EMISSIONCLASS_SET, VTYPEPARS_HEIGHT_SET, VTYPEPARS_IMGFILE_SET, VTYPEPARS_IMPATIENCE_SET, VTYPEPARS_LANE_CHANGE_MODEL_SET, VTYPEPARS_LENGTH_SET, VTYPEPARS_MAXSPEED_SET, VTYPEPARS_MINGAP_SET, VTYPEPARS_OSGFILE_SET, 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::saveAllAsXML().
SumoXMLTag SUMOVTypeParameter::cfModel |
The enum-representation of the car-following model to use.
Definition at line 162 of file SUMOVTypeParameter.h.
Referenced by MSVehicleType::build(), SUMOVehicleParserHelper::parseVTypeEmbedded(), and write().
CFParams SUMOVTypeParameter::cfParameter |
Definition at line 166 of file SUMOVTypeParameter.h.
Referenced by get(), SUMOVehicleParserHelper::parseVTypeEmbedded(), and write().
RGBColor SUMOVTypeParameter::color |
The color.
Definition at line 134 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getColor(), MSVehicleType::setColor(), and write().
SUMOReal SUMOVTypeParameter::defaultProbability |
The probability when being added to a distribution without an explicit probability.
Definition at line 126 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getDefaultProbability(), RORouteHandler::myEndElement(), MSVehicleType::setDefaultProbability(), and write().
SUMOEmissionClass SUMOVTypeParameter::emissionClass |
The emission class of this vehicle.
Definition at line 132 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), ROEdge::getCO2Effort(), ROEdge::getCOEffort(), MSVehicleType::getEmissionClass(), ROEdge::getFuelEffort(), ROEdge::getHCEffort(), ROEdge::getNoiseEffort(), ROEdge::getNOxEffort(), ROEdge::getPMxEffort(), MSVehicleType::setEmissionClass(), and write().
SUMOReal SUMOVTypeParameter::height |
This class' height.
Definition at line 148 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getHeight(), SUMOVTypeParameter(), and write().
std::string SUMOVTypeParameter::id |
The vehicle type's id.
Definition at line 117 of file SUMOVTypeParameter.h.
Referenced by RONet::addVehicleType(), SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::build(), MSVehicleType::getID(), SUMOVehicleParserHelper::parseVTypeEmbedded(), and RONet::RONet().
std::string SUMOVTypeParameter::imgFile |
Image file for this class.
Definition at line 157 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 138 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 169 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getLaneChangeModel(), and write().
SUMOReal SUMOVTypeParameter::length |
The physical vehicle length.
Definition at line 120 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getLength(), MSVehicleType::getLengthWithGap(), TraCIServerAPI_Lane::processGet(), MSVehicleType::setLength(), SUMOVTypeParameter(), and write().
SUMOReal SUMOVTypeParameter::maxSpeed |
The vehicle type's maximum speed [m/s].
Definition at line 124 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), ROEdge::getCO2Effort(), ROEdge::getCOEffort(), ROEdge::getEffort(), ROEdge::getFuelEffort(), ROEdge::getHCEffort(), ROVehicle::getMaxSpeed(), MSVehicleType::getMaxSpeed(), ROEdge::getMinimumTravelTime(), ROEdge::getNoiseEffort(), ROEdge::getNOxEffort(), ROEdge::getPMxEffort(), ROEdge::getTravelTime(), MSVehicleType::setMaxSpeed(), SUMOVTypeParameter(), and write().
SUMOReal SUMOVTypeParameter::minGap |
This class' free space in front of the vehicle itself.
Definition at line 122 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getLengthWithGap(), MSVehicleType::getMinGap(), MSVehicleType::setMinGap(), SUMOVTypeParameter(), and write().
|
mutable |
Information whether this is a type-stub, being only referenced but not defined (needed by routers)
Definition at line 179 of file SUMOVTypeParameter.h.
Referenced by RONet::getVehicleTypeSecure(), RONet::RONet(), and write().
std::string SUMOVTypeParameter::osgFile |
3D model file for this class
Definition at line 154 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getOSGFile(), and write().
|
mutable |
Information whether this type was already saved (needed by routers)
Definition at line 176 of file SUMOVTypeParameter.h.
Referenced by ROVehicle::saveAllAsXML().
int SUMOVTypeParameter::setParameter |
Information for the router which parameter were set.
Definition at line 172 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), wasSet(), and MSVehicleType::wasSet().
SUMOVehicleShape SUMOVTypeParameter::shape |
This class' shape.
Definition at line 151 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getGuiShape(), MSVehicleType::setShape(), SUMOVTypeParameter(), and write().
SUMOReal SUMOVTypeParameter::speedDev |
The standard deviation for speed variations.
Definition at line 130 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::computeChosenSpeedDeviation(), ROEdge::getMinimumTravelTime(), MSVehicleType::getSpeedDeviation(), MSVehicleType::setSpeedDeviation(), and write().
SUMOReal SUMOVTypeParameter::speedFactor |
The factor by which the maximum speed may deviate from the allowed max speed on the street.
Definition at line 128 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::computeChosenSpeedDeviation(), ROEdge::getMinimumTravelTime(), MSVehicleType::getSpeedFactor(), ROEdge::getTravelTime(), MSVehicleType::setSpeedFactor(), and write().
SUMOVehicleClass SUMOVTypeParameter::vehicleClass |
The vehicle's class.
Definition at line 136 of file SUMOVTypeParameter.h.
Referenced by MSVehicleType::build(), ROEdge::getCO2Effort(), ROEdge::getCOEffort(), ROEdge::getFuelEffort(), ROEdge::getHCEffort(), ROEdge::getNOxEffort(), ROEdge::getPMxEffort(), ROVehicle::getVClass(), MSVehicleType::getVehicleClass(), MSVehicleType::setVClass(), and write().
SUMOReal SUMOVTypeParameter::width |
This class' width.
Definition at line 145 of file SUMOVTypeParameter.h.
Referenced by SUMOVehicleParserHelper::beginVTypeParsing(), MSVehicleType::getWidth(), MSVehicleType::setWidth(), SUMOVTypeParameter(), and write().