![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <string>
#include <set>
#include <limits>
#include <utils/common/StdDefs.h>
#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... | |
const std::string & | getVehicleClassNames (SVCPermissions permissions, bool expand=false) |
Returns the ids of the given classes, divided using a ' '. More... | |
const 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... | |
SVCPermissions | invertPermissions (SVCPermissions permissions) |
negate the given permissions and ensure that only relevant bits are set 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 | isSidewalk (SVCPermissions permissions) |
Returns whether an edge with the given permission is a sidewalk. More... | |
bool | isWaterway (SVCPermissions permissions) |
Returns whether an edge with the given permission is a waterway edge. More... | |
bool | noVehicles (SVCPermissions permissions) |
Returns whether an edge with the given permission forbids vehicles. More... | |
std::map< SVCPermissions, double > | parseStopOffsets (const SUMOSAXAttributes &attrs, bool &ok) |
Extract stopOffsets from attributes of stopOffset element. 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, double networkVersion=NETWORK_VERSION) |
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 std::string | DEFAULT_BIKETYPE_ID |
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... | |
typedef int SUMOEmissionClass |
Definition at line 232 of file SUMOVehicleClass.h.
typedef int SVCPermissions |
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition at line 219 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 134 of file SUMOVehicleClass.h.
enum SUMOVehicleShape |
Definition of vehicle classes to differ between different appearences.
Definition at line 51 of file SUMOVehicleClass.h.
bool canParseVehicleClasses | ( | const std::string & | classes | ) |
Checks whether the given string contains only known vehicle classes.
Definition at line 252 of file SUMOVehicleClass.cpp.
References StringTokenizer::hasNext(), StringTokenizer::next(), parseVehicleClassesCached, and SumoVehicleClassStrings.
Referenced by GNEAttributeCarrier::checkParsedAttribute(), GNEClosingReroute::isValid(), GNEClosingLaneReroute::isValid(), GNEVehicleType::isValid(), GNELane::isValid(), and GNEEdge::isValid().
bool canParseVehicleShape | ( | const std::string & | shape | ) |
Checks whether the given string contains only known vehicle shape.
Definition at line 353 of file SUMOVehicleClass.cpp.
References SumoVehicleShapeStrings.
Referenced by GNEVehicleType::isValid().
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 210 of file SUMOVehicleClass.cpp.
References SumoVehicleClassStrings, 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 201 of file SUMOVehicleClass.cpp.
References SumoVehicleClassStrings.
Referenced by NIXMLTypesHandler::myStartElement(), RONetHandler::myStartElement(), NLHandler::myStartElement(), SUMOVehicleParserHelper::parseVehicleClass(), parseVehicleClasses(), and GNEVehicleType::setAttribute().
const 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 169 of file SUMOVehicleClass.cpp.
References getVehicleClassNamesCached, getVehicleClassNamesList(), joinToString(), SVCAll, and vehicleClassNameAll.
Referenced by IntermodalRouter< E, L, N, V >::compute(), NBNode::computeLanes2Lanes(), GNEClosingReroute::getAttribute(), GNEClosingLaneReroute::getAttribute(), GNELane::getAttribute(), GNEEdge::getAttribute(), GNELane::getAttributeForSelection(), GNEEdge::getAttributeForSelection(), GUILane::getParameterWindow(), GNEDialog_AllowDisallow::onCmdAccept(), GNEDialog_AllowDisallow::onCmdReset(), GNENet::restrictLane(), writePermissions(), writePreferences(), NWWriter_SUMO::writeStopOffsets(), and NBTypeCont::writeTypes().
const 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 182 of file SUMOVehicleClass.cpp.
References SumoVehicleClassStrings, SVC_IGNORING, and vehicleClassNamesListCached.
Referenced by libsumo::Lane::getAllowed(), libsumo::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 343 of file SUMOVehicleClass.cpp.
References SumoVehicleShapeStrings.
Referenced by GNEVehicle::drawGL(), GNEVehicleType::setAttribute(), and GNEVehicleTypeDialog::VTypeAtributes::VShapeRow::setVShapeLabelImage().
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 359 of file SUMOVehicleClass.cpp.
References SumoVehicleShapeStrings.
Referenced by GNEVehicleType::getAttribute(), GUIVehicle::getTypeParameterWindow(), GNEVehicleType::overwriteVType(), and SUMOVTypeParameter::write().
SVCPermissions invertPermissions | ( | SVCPermissions | permissions | ) |
negate the given permissions and ensure that only relevant bits are set
Definition at line 286 of file SUMOVehicleClass.cpp.
References SVCAll.
Referenced by GNEClosingReroute::getAttribute(), GNEClosingLaneReroute::getAttribute(), GNELane::getAttribute(), GNEEdge::getAttribute(), libsumo::Lane::getDisallowed(), parseVehicleClasses(), GNEClosingReroute::setAttribute(), GNEClosingLaneReroute::setAttribute(), GNELane::setAttribute(), libsumo::Lane::setDisallowed(), and libsumo::Edge::setDisallowedVehicleClasses().
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 376 of file SUMOVehicleClass.cpp.
References SVCAll.
Referenced by NBOwnTLDef::allowUnrelated(), NBNode::ApproachingDivider::ApproachingDivider(), NBEdge::divideOnEdges(), noVehicles(), 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 364 of file SUMOVehicleClass.cpp.
References SVC_PASSENGER, and SVC_RAIL_CLASSES.
Referenced by NBRailwayTopologyAnalyzer::addBidiEdgesForStraightConnectivity(), GNENet::addReversedEdge(), MSDevice_Tripinfo::addRideData(), NBEdge::appendTurnaround(), NBEdge::buildInnerEdges(), MSRailSignal::DriveWay::buildRoute(), MSRailSignal::DriveWay::checkCrossingFlanks(), NBTrafficLightDefinition::collectAllLinks(), NBEdge::computeEdge2Edges(), GNELane::drawAsRailway(), GUILane::drawAsRailway(), NIImporter_OpenStreetMap::extendRailwayDistances(), GNELane::getColorValue(), GUILane::getColorValue(), IntermodalNetwork< E, L, N, V >::getDepartEdge(), NWWriter_OpenDrive::getLaneType(), NBNode::getLinkState(), NBRailwayTopologyAnalyzer::getRailNodes(), GUIJunctionWrapper::GUIJunctionWrapper(), NIImporter_OpenStreetMap::insertEdge(), NBEdge::isBidiRail(), NBEdge::isRailDeadEnd(), MSVehicle::planMoveInternal(), NBNodeCont::pruneClusterFringe(), NBEdge::recheckLanes(), and NBEdge::shiftPositionAtNode().
bool isSidewalk | ( | SVCPermissions | permissions | ) |
Returns whether an edge with the given permission is a sidewalk.
[in] | permissions | The permissions of the edge |
Definition at line 382 of file SUMOVehicleClass.cpp.
References SVC_PEDESTRIAN, and SVCAll.
Referenced by noVehicles().
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 370 of file SUMOVehicleClass.cpp.
References SVC_SHIP.
Referenced by NBNodeTypeComputer::computeNodeTypes(), GNELane::drawAsWaterway(), GUILane::drawAsWaterway(), GUILane::drawGL(), and GUIJunctionWrapper::GUIJunctionWrapper().
bool noVehicles | ( | SVCPermissions | permissions | ) |
Returns whether an edge with the given permission forbids vehicles.
[in] | permissions | The permissions of the edge |
Definition at line 388 of file SUMOVehicleClass.cpp.
References isForbidden(), and isSidewalk().
Referenced by libsumo::Edge::getLastStepLength(), MSDelayBasedTrafficLightLogic::init(), and MSActuatedTrafficLightLogic::init().
std::map<SVCPermissions, double> parseStopOffsets | ( | const SUMOSAXAttributes & | attrs, |
bool & | ok | ||
) |
Extract stopOffsets from attributes of stopOffset element.
Definition at line 393 of file SUMOVehicleClass.cpp.
References SUMOSAXAttributes::get(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::hasAttribute(), parseVehicleClasses(), SUMO_ATTR_EXCEPTIONS, SUMO_ATTR_VALUE, SUMO_ATTR_VCLASSES, and WRITE_ERROR.
Referenced by NIImporter_SUMO::addStopOffsets(), NIXMLEdgesHandler::myStartElement(), and NLHandler::myStartElement().
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 223 of file SUMOVehicleClass.cpp.
References deprecatedVehicleClassesSeen, getVehicleClassID(), StringTokenizer::hasNext(), StringTokenizer::next(), parseVehicleClassesCached, SumoVehicleClassStrings, SVCAll, and WRITE_ERROR.
Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addEdge(), NLHandler::addLane(), NIXMLEdgesHandler::addLane(), TraCIServer::addSubscriptionFilter(), NBEdgeCont::applyOptions(), NBNetBuilder::applyOptions(), NIXMLTypesHandler::myStartElement(), MSTriggeredRerouter::myStartElement(), GNEAdditionalHandler::parseAndBuildRerouterClosingLaneReroute(), GNEAdditionalHandler::parseAndBuildRerouterClosingReroute(), RONetHandler::parseLane(), parseStopOffsets(), parseVehicleClasses(), libsumo::Lane::setAllowed(), libsumo::Edge::setAllowedVehicleClasses(), GNEClosingReroute::setAttribute(), GNEClosingLaneReroute::setAttribute(), GNELane::setAttribute(), libsumo::Lane::setDisallowed(), libsumo::Edge::setDisallowedVehicleClasses(), and GNEAdditional::writeAdditional().
SVCPermissions parseVehicleClasses | ( | const std::string & | allowedS, |
const std::string & | disallowedS, | ||
double | networkVersion = NETWORK_VERSION |
||
) |
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 271 of file SUMOVehicleClass.cpp.
References invertPermissions(), parseVehicleClasses(), SVC_RAIL_FAST, 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 292 of file SUMOVehicleClass.cpp.
References getVehicleClassID(), SumoVehicleClassStrings, SVCAll, and WRITE_WARNING.
void writePermissions | ( | OutputDevice & | into, |
SVCPermissions | permissions | ||
) |
writes allowed disallowed attributes if needed;
Definition at line 310 of file SUMOVehicleClass.cpp.
References getVehicleClassNames(), SUMO_ATTR_ALLOW, SUMO_ATTR_DISALLOW, SUMOVehicleClass_MAX, SumoVehicleClassStrings, SVCAll, and OutputDevice::writeAttr().
Referenced by GNEAdditional::writeAdditional(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeLane(), and NBTypeCont::writeTypes().
void writePreferences | ( | OutputDevice & | into, |
SVCPermissions | preferred | ||
) |
writes allowed disallowed attributes if needed;
Definition at line 333 of file SUMOVehicleClass.cpp.
References getVehicleClassNames(), SUMO_ATTR_PREFER, SVCAll, and OutputDevice::writeAttr().
Referenced by NWWriter_XML::writeEdgesAndConnections(), and NWWriter_SUMO::writeLane().
const std::string DEFAULT_BIKETYPE_ID |
Referenced by ROPerson::addTrip(), GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow(), MSVehicleControl::checkVType(), GNERouteHandler::closeVType(), libsumo::Simulation::findIntermodalRoute(), GNEVehicleType::getAttribute(), RONet::getVehicleTypeSecure(), MSVehicleControl::MSVehicleControl(), GNEVehicleTypeFrame::VehicleTypeEditor::onCmdResetVehicleType(), GNEFrameAttributesModuls::AttributesEditorRow::refreshAttributesEditorRow(), GNEFrameModuls::DemandElementSelector::refreshDemandElementSelector(), GNEVehicleTypeFrame::VehicleTypeSelector::refreshVehicleTypeSelector(), RONet::RONet(), MSTransportable::Stage_Trip::setArrived(), GNENet::setViewNet(), and GNEVehicleTypeFrame::VehicleTypeSelector::VehicleTypeSelector().
const double DEFAULT_CONTAINER_TRANSHIP_SPEED |
Referenced by MSRouteHandler::myStartElement().
const double DEFAULT_PEDESTRIAN_SPEED |
const std::string DEFAULT_PEDTYPE_ID |
Referenced by GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow(), RONet::checkVType(), MSVehicleControl::checkVType(), GNERouteHandler::closeVType(), libsumo::Simulation::findIntermodalRoute(), GNEVehicleType::getAttribute(), RONet::getVehicleTypeSecure(), MSVehicleControl::getVType(), GNEPersonTypeFrame::GNEPersonTypeFrame(), MSVehicleControl::MSVehicleControl(), RORouteHandler::myStartElement(), GNEPersonTypeFrame::PersonTypeEditor::onCmdResetPersonType(), SUMOVehicleParserHelper::parseFlowAttributes(), SUMOVehicleParserHelper::parseVehicleAttributes(), GNEPersonTypeFrame::PersonTypeSelector::PersonTypeSelector(), GNEFrameAttributesModuls::AttributesEditorRow::refreshAttributesEditorRow(), GNEFrameModuls::DemandElementSelector::refreshDemandElementSelector(), RONet::RONet(), MSPerson::routeOutput(), GNENet::setViewNet(), GNEFrameModuls::DemandElementSelector::showDemandElementSelector(), and GNEPerson::writeDemandElement().
const double DEFAULT_VEH_PROB |
const std::string DEFAULT_VTYPE_ID |
Referenced by ROPerson::addTrip(), GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow(), RONet::checkFlows(), RONet::checkVType(), MSVehicleControl::checkVType(), MSRouteHandler::closeVehicle(), RORouteHandler::closeVehicle(), GNERouteHandler::closeVType(), computeRoutes(), GNEAttributeCarrier::fillAdditionals(), GNEAttributeCarrier::fillCommonPersonAttributes(), GNEAttributeCarrier::fillVehicleElements(), libsumo::Simulation::findIntermodalRoute(), GNEVehicleType::getAttribute(), RONet::getVehicleTypeSecure(), MSVehicleControl::getVType(), GNEVehicleTypeFrame::GNEVehicleTypeFrame(), MSVehicleControl::MSVehicleControl(), MSCalibrator::myStartElement(), GNEVehicleTypeFrame::VehicleTypeEditor::onCmdResetVehicleType(), GNEVehicleType::overwriteVType(), GNEFrameAttributesModuls::AttributesEditorRow::refreshAttributesEditorRow(), GNEFrameModuls::DemandElementSelector::refreshDemandElementSelector(), GNEPersonTypeFrame::PersonTypeSelector::refreshPersonTypeSelector(), GNEVehicleTypeFrame::VehicleTypeSelector::refreshVehicleTypeSelector(), ROMAAssignments::ROMAAssignments(), RONet::RONet(), GNENet::setViewNet(), GNEFrameModuls::DemandElementSelector::showDemandElementSelector(), GNEVehicleTypeFrame::VehicleTypeSelector::VehicleTypeSelector(), GNEVehicle::writeDemandElement(), RODFDetectorCon::writeEmitters(), and MSDevice_Vehroutes::writeOutput().
std::set<std::string> deprecatedVehicleClassesSeen |
Definition at line 85 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 145 of file SUMOVehicleClass.cpp.
Referenced by MSEdge::rebuildAllowedLanes(), MSEdge::rebuildAllowedTargets(), and writePermissions().
StringBijection<SUMOVehicleClass> SumoVehicleClassStrings |
Referenced by libsumo::Vehicle::add(), CHBuilder< E, V >::buildContractionHierarchy(), canParseVehicleClasses(), CHRouter< E, V, BASE >::clone(), TraCIServerAPI_Simulation::commandPositionConversion(), libsumo::Simulation::convertRoad(), GNEAttributeCarrier::fillDemandElements(), GUIApplicationWindow::fillMenuBar(), GNEAttributeCarrier::fillNetElements(), GUIVehicle::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), getVehicleClassCompoundID(), getVehicleClassID(), getVehicleClassNamesList(), GUIApplicationWindow::onCmdEditChosen(), GNERouteFrame::RouteModeSelector::onCmdSelectVClass(), GNEAttributeCarrier::parse(), SUMOVehicleParserHelper::parseVehicleClass(), parseVehicleClasses(), GNERouteFrame::RouteModeSelector::RouteModeSelector(), toString< SUMOVehicleClass >(), GNEVehicleTypeDialog::VTypeAtributes::VClassRow::VClassRow(), and writePermissions().
StringBijection<SUMOVehicleShape> SumoVehicleShapeStrings |
const SVCPermissions SVC_UNSPECIFIED |
permissions not specified
Definition at line 149 of file SUMOVehicleClass.cpp.
Referenced by NIXMLEdgesHandler::addEdge(), and NWWriter_SUMO::writeLane().
const SVCPermissions SVCAll |
all VClasses are allowed
Definition at line 147 of file SUMOVehicleClass.cpp.
Referenced by NLHandler::addLane(), NINavTeqHelper::addVehicleClasses(), NINavTeqHelper::addVehicleClassesV6(), NBEdge::buildInnerEdges(), NBEdge::dismissVehicleClassInformation(), libsumo::Lane::getAllowed(), NWWriter_DlrNavteq::getAllowedTypes(), GNELane::getAttributeForSelection(), GNEEdge::getAttributeForSelection(), NBNodeShapeComputer::getDefaultRadius(), NBEdge::getFirstNonPedestrianLaneIndex(), NWWriter_OpenDrive::getLaneType(), getVehicleClassNames(), NBEdge::hasPermissions(), MSEdge::initialize(), GUIVisualizationSettings::initNeteditDefaults(), GUIVisualizationSettings::initSumoGuiDefaults(), invertPermissions(), isForbidden(), isSidewalk(), MSTriggeredRerouter::myEndElement(), MSTriggeredRerouter::notifyEnter(), RONetHandler::parseLane(), parseVehicleClasses(), MSEdge::rebuildAllowedLanes(), NIImporter_DlrNavteq::EdgesHandler::report(), MSLane::resetPermissions(), ROEdge::ROEdge(), MSTriggeredRerouter::setPermissions(), writePermissions(), writePreferences(), and NWWriter_DlrNavteq::writeProhibitedManoeuvres().