SUMO - Simulation of Urban MObility
|
#include <config.h>
#include <string>
#include <set>
#include <limits>
#include <utils/common/UtilExceptions.h>
#include <utils/common/StringBijection.h>
#include <utils/xml/SUMOXMLDefinitions.h>
Go to the source code of this file.
Typedefs | |
typedef int | SUMOEmissionClass |
typedef int | SVCPermissions |
Functions | |
bool | canParseVehicleClasses (const std::string &classes) |
Checks whether the given string contains only known vehicle classes. | |
int | getVehicleClassCompoundID (const std::string &name) |
Returns the OR'ed id of the compound class given by its name. | |
std::string | getVehicleClassCompoundName (int id) |
SUMOVehicleClass | getVehicleClassID (const std::string &name) |
Returns the class id of the abstract class given by its name. | |
std::string | getVehicleClassNames (SVCPermissions permissions) |
Returns the ids of the given classes, divided using a ' '. | |
std::vector< std::string > | getVehicleClassNamesList (SVCPermissions permissions) |
Returns the ids of the given classes, divided using a ' '. | |
SUMOVehicleShape | getVehicleShapeID (const std::string &name) |
Returns the class id of the shape class given by its name. | |
std::string | getVehicleShapeName (SUMOVehicleShape id) |
Returns the class name of the shape class given by its id. | |
bool | isForbidden (SVCPermissions permissions) |
Returns whether an edge with the given permission is a forbidden edge. | |
bool | isRailway (SVCPermissions permissions) |
Returns whether an edge with the given permission is a railway edge. | |
SVCPermissions | parseVehicleClasses (const std::string &allowedS) |
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes go into a separate container. | |
SVCPermissions | parseVehicleClasses (const std::string &allowedS, const std::string &disallowedS) |
Encodes the given vector of allowed and disallowed classes into a bitset. | |
SVCPermissions | parseVehicleClasses (const std::vector< std::string > &allowedS) |
Encodes the given vector of allowed classs into a bitset Unlike the methods which parse a string it gives immediately a warning output on deprecated vehicle classes. |
Variables | |
const SUMOReal | DEFAULT_PEDESTRIAN_SPEED |
const SUMOReal | DEFAULT_VEH_PROB |
const std::string | DEFAULT_VTYPE_ID |
std::set< std::string > | deprecatedVehicleClassesSeen |
const int | SUMOVehicleClass_MAX |
StringBijection< SUMOVehicleClass > | SumoVehicleClassStrings |
StringBijection< SUMOVehicleShape > | SumoVehicleShapeStrings |
const SVCPermissions | SVCAll |
Definition in file SUMOVehicleClass.h.
typedef int SUMOEmissionClass |
Definition at line 202 of file SUMOVehicleClass.h.
typedef int SVCPermissions |
Definition at line 193 of file SUMOVehicleClass.h.
enum SUMOVehicleClass |
Definition of vehicle classes to differ between different lane usage and authority types.
Bits:
From NavTeq:
Definition at line 121 of file SUMOVehicleClass.h.
enum SUMOVehicleShape |
Definition of vehicle classes to differ between different appearences.
Definition at line 50 of file SUMOVehicleClass.h.
bool canParseVehicleClasses | ( | const std::string & | classes | ) |
Checks whether the given string contains only known vehicle classes.
Definition at line 231 of file SUMOVehicleClass.cpp.
References StringTokenizer::hasNext(), StringTokenizer::next(), and SumoVehicleClassStrings.
int getVehicleClassCompoundID | ( | const std::string & | name | ) |
Returns the OR'ed id of the compound class given by its name.
[in] | name | The name of the abstract vehicle class |
Definition at line 198 of file SUMOVehicleClass.cpp.
References SumoVehicleClassStrings, and SVC_IGNORING.
std::string getVehicleClassCompoundName | ( | int | id | ) |
Definition at line 148 of file SUMOVehicleClass.cpp.
References SumoVehicleClassStrings.
SUMOVehicleClass getVehicleClassID | ( | const std::string & | name | ) |
Returns the class id of the abstract class given by its name.
[in] | name | The name of the abstract vehicle class |
Definition at line 189 of file SUMOVehicleClass.cpp.
References SumoVehicleClassStrings.
Referenced by SUMOVehicleParserHelper::parseVehicleClass(), parseVehicleClasses(), and TraCIServerAPI_VehicleType::setVariable().
std::string getVehicleClassNames | ( | SVCPermissions | permissions | ) |
Returns the ids of the given classes, divided using a ' '.
[in] | the | permissions to encode |
Definition at line 165 of file SUMOVehicleClass.cpp.
References getVehicleClassNamesList(), joinToString(), and SVCAll.
Referenced by GUILane::getParameterWindow(), NWWriter_SUMO::writePermissions(), and NWWriter_SUMO::writePreferences().
std::vector<std::string> getVehicleClassNamesList | ( | SVCPermissions | permissions | ) |
Returns the ids of the given classes, divided using a ' '.
[in] | the | permissions to encode |
Definition at line 174 of file SUMOVehicleClass.cpp.
References SumoVehicleClassStrings, and SVC_IGNORING.
Referenced by getVehicleClassNames(), and TraCIServerAPI_Lane::processGet().
SUMOVehicleShape getVehicleShapeID | ( | const std::string & | name | ) |
Returns the class id of the shape class given by its name.
[in] | name | The name of the shape class |
Definition at line 275 of file SUMOVehicleClass.cpp.
References SumoVehicleShapeStrings.
Referenced by TraCIServerAPI_VehicleType::setVariable().
std::string getVehicleShapeName | ( | SUMOVehicleShape | id | ) |
Returns the class name of the shape class given by its id.
[in] | id | The id of the shape class |
Definition at line 285 of file SUMOVehicleClass.cpp.
References SumoVehicleShapeStrings.
Referenced by TraCIServerAPI_VehicleType::getVariable(), and SUMOVTypeParameter::write().
bool isForbidden | ( | SVCPermissions | permissions | ) |
Returns whether an edge with the given permission is a forbidden edge.
[in] | permissions | The permissions of the edge |
Definition at line 295 of file SUMOVehicleClass.cpp.
References SVCAll.
Referenced by NBNode::ApproachingDivider::ApproachingDivider(), NBEdge::divideOnEdges(), NBOwnTLDef::myCompute(), NBOwnTLDef::patchStateForCrossings(), and NBEdge::recheckLanes().
bool isRailway | ( | SVCPermissions | permissions | ) |
Returns whether an edge with the given permission is a railway edge.
[in] | permissions | The permissions of the edge |
Definition at line 290 of file SUMOVehicleClass.cpp.
References SVC_PASSENGER, SVC_RAIL, SVC_RAIL_ELECTRIC, SVC_RAIL_URBAN, and SVC_TRAM.
Referenced by GUILane::drawGL(), GUILane::drawLinkRule(), and NBRampsComputer::fulfillsRampConstraints().
SVCPermissions parseVehicleClasses | ( | const std::string & | allowedS | ) |
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes go into a separate container.
[in] | classNames | Space separated class names |
[out] | container | The set of vehicle classes to fill throws ProcessError if parsing fails |
Definition at line 211 of file SUMOVehicleClass.cpp.
References deprecatedVehicleClassesSeen, getVehicleClassID(), StringTokenizer::hasNext(), StringTokenizer::next(), SumoVehicleClassStrings, and SVCAll.
Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addEdge(), NLHandler::addLane(), NIXMLEdgesHandler::addLane(), NBEdgeCont::applyOptions(), NIXMLTypesHandler::myStartElement(), RONetHandler::parseLane(), parseVehicleClasses(), TraCIServerAPI_Edge::processSet(), and TraCIServerAPI_Lane::processSet().
SVCPermissions parseVehicleClasses | ( | const std::string & | allowedS, |
const std::string & | disallowedS | ||
) |
Encodes the given vector of allowed and disallowed classes into a bitset.
[in] | allowedS | Definition which classes are allowed |
[in] | disallowedS | Definition which classes are not allowed |
Definition at line 245 of file SUMOVehicleClass.cpp.
References parseVehicleClasses(), SVCAll, and WRITE_WARNING.
SVCPermissions parseVehicleClasses | ( | const std::vector< std::string > & | allowedS | ) |
Encodes the given vector of allowed classs into a bitset Unlike the methods which parse a string it gives immediately a warning output on deprecated vehicle classes.
[in] | classesS | The names vector to parse |
Definition at line 260 of file SUMOVehicleClass.cpp.
References getVehicleClassID(), SumoVehicleClassStrings, and WRITE_WARNING.
const SUMOReal DEFAULT_PEDESTRIAN_SPEED |
const SUMOReal DEFAULT_VEH_PROB |
const std::string DEFAULT_VTYPE_ID |
Referenced by RONet::checkVType(), MSVehicleControl::checkVType(), computeRoutes(), MSDevice_Vehroutes::generateOutput(), RONet::getVehicleTypeSecure(), MSVehicleControl::getVType(), MSVehicleControl::MSVehicleControl(), MSCalibrator::myStartElement(), RONet::RONet(), and SUMOVehicleParameter::SUMOVehicleParameter().
std::set<std::string> deprecatedVehicleClassesSeen |
Definition at line 91 of file SUMOVehicleClass.cpp.
Referenced by NIImporter_SUMO::_loadNetwork(), NLEdgeControlBuilder::build(), loadNet(), ROLoader::loadNet(), NILoader::loadXML(), and parseVehicleClasses().
const int SUMOVehicleClass_MAX |
Definition at line 138 of file SUMOVehicleClass.cpp.
Referenced by NWWriter_SUMO::writePermissions().
StringBijection<SUMOVehicleClass> SumoVehicleClassStrings |
Referenced by canParseVehicleClasses(), GUIApplicationWindow::fillMenuBar(), GUIVehicle::getParameterWindow(), getVehicleClassCompoundID(), getVehicleClassCompoundName(), getVehicleClassID(), getVehicleClassNamesList(), GUIApplicationWindow::onCmdEditChosen(), SUMOVehicleParserHelper::parseVehicleClass(), parseVehicleClasses(), toString< SUMOVehicleClass >(), and NWWriter_SUMO::writePermissions().
StringBijection<SUMOVehicleShape> SumoVehicleShapeStrings |
Referenced by getVehicleShapeID(), getVehicleShapeName(), and SUMOVehicleParserHelper::parseGuiShape().
const SVCPermissions SVCAll |
Definition at line 139 of file SUMOVehicleClass.cpp.
Referenced by NINavTeqHelper::addVehicleClasses(), NINavTeqHelper::addVehicleClassesV6(), NBEdge::dismissVehicleClassInformation(), NWWriter_DlrNavteq::getAllowedTypes(), getVehicleClassNames(), GUIVisualizationSettings::GUIVisualizationSettings(), NBEdge::hasRestrictions(), MSEdge::initialize(), NBTypeCont::insert(), isForbidden(), NIImporter_OpenDrive::loadNetwork(), RONetHandler::parseLane(), parseVehicleClasses(), TraCIServerAPI_Lane::processGet(), MSEdge::rebuildAllowedLanes(), NWWriter_SUMO::writeInternalEdges(), NWWriter_SUMO::writePermissions(), and NWWriter_SUMO::writePreferences().