![]() |
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 |
bitset where each bit declares whether a certain SVC may use this edge/lane More... | |
Functions | |
bool | canParseVehicleClasses (const std::string &classes) |
Checks whether the given string contains only known vehicle classes. More... | |
bool | canParseVehicleShape (const std::string &shape) |
Checks whether the given string contains only known vehicle shape. More... | |
int | getVehicleClassCompoundID (const std::string &name) |
Returns the OR'ed id of the compound class given by its name. More... | |
SUMOVehicleClass | getVehicleClassID (const std::string &name) |
Returns the class id of the abstract class given by its name. More... | |
std::string | getVehicleClassNames (SVCPermissions permissions, bool expand=false) |
Returns the ids of the given classes, divided using a ' '. More... | |
std::vector< std::string > | getVehicleClassNamesList (SVCPermissions permissions) |
Returns the ids of the given classes, divided using a ' '. More... | |
SUMOVehicleShape | getVehicleShapeID (const std::string &name) |
Returns the class id of the shape class given by its name. More... | |
std::string | getVehicleShapeName (SUMOVehicleShape id) |
Returns the class name of the shape class given by its id. More... | |
bool | isForbidden (SVCPermissions permissions) |
Returns whether an edge with the given permission is a forbidden edge. More... | |
bool | isRailway (SVCPermissions permissions) |
Returns whether an edge with the given permission is a railway edge. More... | |
bool | isWaterway (SVCPermissions permissions) |
Returns whether an edge with the given permission is a waterway edge. More... | |
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. More... | |
SVCPermissions | parseVehicleClasses (const std::string &allowedS, const std::string &disallowedS) |
Encodes the given vector of allowed and disallowed classes into a bitset. More... | |
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. More... | |
void | writePermissions (OutputDevice &into, SVCPermissions permissions) |
writes allowed disallowed attributes if needed; More... | |
void | writePreferences (OutputDevice &into, SVCPermissions preferred) |
writes allowed disallowed attributes if needed; More... | |
Variables | |
const double | DEFAULT_CONTAINER_TRANSHIP_SPEED |
const double | DEFAULT_PEDESTRIAN_SPEED |
const std::string | DEFAULT_PEDTYPE_ID |
const double | 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 | SVC_UNSPECIFIED |
permissions not specified More... | |
const SVCPermissions | SVCAll |
all VClasses are allowed More... | |
Definition in file SUMOVehicleClass.h.
typedef int SUMOEmissionClass |
Definition at line 226 of file SUMOVehicleClass.h.
typedef int SVCPermissions |
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition at line 213 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 137 of file SUMOVehicleClass.h.
enum SUMOVehicleShape |
Definition of vehicle classes to differ between different appearences.
Definition at line 58 of file SUMOVehicleClass.h.
bool canParseVehicleClasses | ( | const std::string & | classes | ) |
Checks whether the given string contains only known vehicle classes.
Definition at line 222 of file SUMOVehicleClass.cpp.
References StringTokenizer::hasNext(), StringBijection< T >::hasString(), and StringTokenizer::next().
Referenced by GNEEdge::isValid(), GNELane::isValid(), GNERerouterIntervalDialog::onCmdEditClosingLaneReroute(), GNERerouterIntervalDialog::onCmdEditClosingReroute(), and GNECalibratorVehicleType::setVClass().
bool canParseVehicleShape | ( | const std::string & | shape | ) |
Checks whether the given string contains only known vehicle shape.
Definition at line 308 of file SUMOVehicleClass.cpp.
References StringBijection< T >::hasString().
Referenced by GNECalibratorVehicleType::setShape().
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 185 of file SUMOVehicleClass.cpp.
References StringBijection< T >::get(), StringBijection< T >::getStrings(), and SVC_IGNORING.
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 176 of file SUMOVehicleClass.cpp.
References StringBijection< T >::get(), and StringBijection< T >::hasString().
Referenced by NIXMLTypesHandler::myStartElement(), RONetHandler::myStartElement(), NLHandler::myStartElement(), SUMOVehicleParserHelper::parseVehicleClass(), parseVehicleClasses(), GNECalibratorVehicleType::setVClass(), and TraCI_VehicleType::setVehicleClass().
std::string getVehicleClassNames | ( | SVCPermissions | permissions, |
bool | expand = false |
||
) |
Returns the ids of the given classes, divided using a ' '.
[in] | the | permissions to encode |
[in] | expand | whether 'all' should be used |
Definition at line 152 of file SUMOVehicleClass.cpp.
References getVehicleClassNamesList(), joinToString(), and SVCAll.
Referenced by GNEEdge::getAttribute(), GNELane::getAttribute(), GNELane::getColorValue(), GUILane::getParameterWindow(), GNEDialog_AllowDisallow::onCmdAccept(), GNEInspectorFrame::AttributeInput::onCmdOpenAllowDisallowEditor(), GNEDialog_AllowDisallow::onCmdReset(), GNENet::restrictLane(), GNECalibratorVehicleTypeDialog::updateCalibratorVehicleTypeValues(), GNERerouterIntervalDialog::updateClosingLaneReroutesTable(), GNERerouterIntervalDialog::updateClosingReroutesTable(), GNERerouter::writeAdditional(), writePermissions(), writePreferences(), and NBTypeCont::writeTypes().
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 161 of file SUMOVehicleClass.cpp.
References StringBijection< T >::get(), StringBijection< T >::getStrings(), and SVC_IGNORING.
Referenced by TraCI_Lane::getAllowed(), TraCI_Lane::getDisallowed(), and getVehicleClassNames().
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 299 of file SUMOVehicleClass.cpp.
References StringBijection< T >::get(), and StringBijection< T >::hasString().
Referenced by GNECalibratorVehicleType::setShape(), and TraCI_VehicleType::setShapeClass().
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 314 of file SUMOVehicleClass.cpp.
References StringBijection< T >::getString().
Referenced by TraCI_VehicleType::getShapeClass(), GNECalibratorVehicleTypeDialog::updateCalibratorVehicleTypeValues(), 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 329 of file SUMOVehicleClass.cpp.
References DEFAULT_CONTAINER_TRANSHIP_SPEED(), DEFAULT_PEDESTRIAN_SPEED(), DEFAULT_PEDTYPE_ID(), DEFAULT_VEH_PROB(), DEFAULT_VTYPE_ID(), and SVCAll.
Referenced by NBNode::ApproachingDivider::ApproachingDivider(), NBOwnTLDef::computeLogicAndConts(), NBEdge::divideOnEdges(), 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 319 of file SUMOVehicleClass.cpp.
References SVC_PASSENGER, SVC_RAIL, SVC_RAIL_ELECTRIC, SVC_RAIL_URBAN, and SVC_TRAM.
Referenced by GNENet::addReversedEdge(), NBTrafficLightDefinition::collectAllLinks(), GNELane::drawAsRailway(), GUILane::drawAsRailway(), GNELane::getColorValue(), GUILane::getColorValue(), NWWriter_OpenDrive::getLaneType(), NBNode::getLinkState(), NBEdge::recheckLanes(), and NBEdge::shiftPositionAtNode().
bool isWaterway | ( | SVCPermissions | permissions | ) |
Returns whether an edge with the given permission is a waterway edge.
[in] | permissions | The permissions of the edge |
Definition at line 324 of file SUMOVehicleClass.cpp.
References SVC_SHIP.
Referenced by NBNodeTypeComputer::computeNodeTypes(), NBNodeTypeComputer::computeSingleNodeType(), GNELane::drawAsWaterway(), GUILane::drawAsWaterway(), GUILane::drawGL(), and GUIJunctionWrapper::GUIJunctionWrapper().
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 198 of file SUMOVehicleClass.cpp.
References deprecatedVehicleClassesSeen, StringBijection< T >::getString(), getVehicleClassID(), StringTokenizer::hasNext(), StringBijection< T >::hasString(), StringTokenizer::next(), SVCAll, and WRITE_ERROR.
Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addEdge(), NLHandler::addLane(), NIXMLEdgesHandler::addLane(), NBEdgeCont::applyOptions(), NBNetBuilder::applyOptions(), NIXMLTypesHandler::myStartElement(), MSTriggeredRerouter::myStartElement(), GNERerouterIntervalDialog::onCmdEditClosingLaneReroute(), GNERerouterIntervalDialog::onCmdEditClosingReroute(), GNEInspectorFrame::AttributeInput::onCmdOpenAllowDisallowEditor(), RONetHandler::parseLane(), parseVehicleClasses(), TraCIServerAPI_Edge::processSet(), TraCI_Lane::setAllowed(), GNELane::setAttribute(), and TraCI_Lane::setDisallowed().
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 236 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 251 of file SUMOVehicleClass.cpp.
References StringBijection< T >::getString(), getVehicleClassID(), and WRITE_WARNING.
void writePermissions | ( | OutputDevice & | into, |
SVCPermissions | permissions | ||
) |
writes allowed disallowed attributes if needed;
Definition at line 266 of file SUMOVehicleClass.cpp.
References getVehicleClassNames(), StringBijection< T >::size(), SUMO_ATTR_ALLOW, SUMO_ATTR_DISALLOW, SUMOVehicleClass_MAX, SVCAll, and OutputDevice::writeAttr().
Referenced by NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeLane(), and NBTypeCont::writeTypes().
void writePreferences | ( | OutputDevice & | into, |
SVCPermissions | preferred | ||
) |
writes allowed disallowed attributes if needed;
Definition at line 289 of file SUMOVehicleClass.cpp.
References getVehicleClassNames(), SUMO_ATTR_PREFER, SVCAll, and OutputDevice::writeAttr().
Referenced by NWWriter_XML::writeEdgesAndConnections(), and NWWriter_SUMO::writeLane().
const double DEFAULT_CONTAINER_TRANSHIP_SPEED |
Referenced by MSRouteHandler::myStartElement().
const double DEFAULT_PEDESTRIAN_SPEED |
Referenced by MSRouteHandler::myStartElement(), and SUMOVTypeParameter::SUMOVTypeParameter().
const std::string DEFAULT_PEDTYPE_ID |
const double DEFAULT_VEH_PROB |
Referenced by RORouteHandler::myStartElement(), MSRouteHandler::openRoute(), and RORouteHandler::openRoute().
const std::string DEFAULT_VTYPE_ID |
Referenced by ROPerson::addTrip(), RONet::checkFlows(), RONet::checkVType(), MSVehicleControl::checkVType(), MSRouteHandler::closeVehicle(), RORouteHandler::closeVehicle(), computeRoutes(), MSVehicleControl::getTotalTravelTime(), RONet::getVehicleTypeSecure(), MSVehicleControl::getVType(), MSVehicleControl::MSVehicleControl(), MSCalibrator::myStartElement(), ROMAAssignments::ROMAAssignments(), RONet::RONet(), RODFDetectorCon::writeEmitters(), and MSDevice_Vehroutes::writeOutput().
std::set<std::string> deprecatedVehicleClassesSeen |
Definition at line 90 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 141 of file SUMOVehicleClass.cpp.
Referenced by writePermissions().
StringBijection<SUMOVehicleClass> SumoVehicleClassStrings |
Referenced by CHBuilder< E, V >::buildContractionHierarchy(), CHRouter< E, V, PF >::clone(), GNEAttributeCarrier::discreteChoices(), GUIApplicationWindow::fillMenuBar(), GUIMEVehicle::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), GNECalibratorVehicleTypeDialog::GNECalibratorVehicleTypeDialog(), GUIApplicationWindow::onCmdEditChosen(), GNEAttributeCarrier::parse(), SUMOVehicleParserHelper::parseVehicleClass(), GNENet::revertLaneRestriction(), and toString< SUMOVehicleClass >().
StringBijection<SUMOVehicleShape> SumoVehicleShapeStrings |
const SVCPermissions SVC_UNSPECIFIED |
permissions not specified
Definition at line 143 of file SUMOVehicleClass.cpp.
Referenced by NIXMLEdgesHandler::addEdge(), and NWWriter_SUMO::writeLane().
const SVCPermissions SVCAll |
all VClasses are allowed
Definition at line 142 of file SUMOVehicleClass.cpp.
Referenced by NLHandler::addLane(), NINavTeqHelper::addVehicleClasses(), NINavTeqHelper::addVehicleClassesV6(), NBEdge::dismissVehicleClassInformation(), TraCI_Lane::getAllowed(), NWWriter_DlrNavteq::getAllowedTypes(), NBEdge::getFirstNonPedestrianLaneIndex(), NWWriter_OpenDrive::getLaneType(), getVehicleClassNames(), GNEViewNet::GNEViewNet(), GUIVisualizationSettings::GUIVisualizationSettings(), NBEdge::hasPermissions(), MSEdge::initialize(), isForbidden(), MSTriggeredRerouter::myEndElement(), MSTriggeredRerouter::notifyEnter(), GNEInspectorFrame::AttributeInput::onCmdOpenAllowDisallowEditor(), NIImporter_VISUM::parse_Types(), RONetHandler::parseLane(), parseVehicleClasses(), MSEdge::rebuildAllowedLanes(), NIImporter_DlrNavteq::EdgesHandler::report(), MSLane::resetPermissions(), ROEdge::ROEdge(), MSTriggeredRerouter::setPermissions(), NWWriter_SUMO::writeInternalEdges(), writePermissions(), writePreferences(), and NWWriter_DlrNavteq::writeProhibitedManoeuvres().