|
SUMO - Simulation of Urban MObility
|
A storage for available types of edges. More...
#include <NBTypeCont.h>
Data Structures | |
| struct | TypeDefinition |
Public Member Functions | |
| SumoXMLNodeType | getJunctionType (SUMOReal speed1, SUMOReal speed2) const throw () |
| Returns the type of the junction between two edges of the given types. | |
| bool | insert (const std::string &id, int noLanes, SUMOReal maxSpeed, int prio, const SUMOVehicleClasses &allow, const SUMOVehicleClasses &disallow, SUMOReal width, bool oneWayIsDefault) throw () |
| Adds a type into the list. | |
| bool | insert (const std::string &id, int noLanes, SUMOReal maxSpeed, int prio, SUMOReal width, SUMOVehicleClass vClasses=SVC_UNKNOWN, bool oneWayIsDefault=false) throw () |
| Adds a type into the list. This is a simplified convenience form of insert, if only one allowed vehicle class is necessary. | |
| bool | knows (const std::string &type) const throw () |
| Returns whether the named type is in the container. | |
| bool | markAsToDiscard (const std::string &id) throw () |
| Marks a type as to be discarded. | |
| NBTypeCont () throw () | |
| Constructor. | |
| void | setDefaults (int defaultNoLanes, SUMOReal defaultSpeed, int defaultPriority) throw () |
| Sets the default values. | |
| unsigned int | size () const throw () |
| Returns the number of known types. | |
| ~NBTypeCont () throw () | |
| Destructor. | |
Type-dependant Retrieval methods | |
| int | getNumLanes (const std::string &type) const throw () |
| Returns the number of lanes for the given type. | |
| SUMOReal | getSpeed (const std::string &type) const throw () |
| Returns the maximal velocity for the given type [m/s]. | |
| int | getPriority (const std::string &type) const throw () |
| Returns the priority for the given type. | |
| bool | getIsOneWay (const std::string &type) const throw () |
| Returns whether edges are one-way per default for the given type. | |
| bool | getShallBeDiscarded (const std::string &type) const throw () |
| Returns the information whether edges of this type shall be discarded. | |
| const SUMOVehicleClasses & | getAllowedClasses (const std::string &type) const throw () |
| Returns allowed vehicle classes for the given type. | |
| const SUMOVehicleClasses & | getDisallowedClasses (const std::string &type) const throw () |
| Returns not allowed vehicle classes for the given type. | |
| SUMOReal | getWidth (const std::string &type) const throw () |
| Returns the lane width for the given type [m/s]. | |
Private Types | |
| typedef std::map< std::string, TypeDefinition > | TypesCont |
| A container of types, accessed by the string id. | |
Private Member Functions | |
| const TypeDefinition & | getType (const std::string &name) const |
| Retrieve the name or the default type. | |
| NBTypeCont (const NBTypeCont &s) | |
| invalid copy constructor | |
| NBTypeCont & | operator= (const NBTypeCont &s) |
| invalid assignment operator | |
Private Attributes | |
| TypeDefinition | myDefaultType |
| The default type. | |
| NBJunctionTypesMatrix | myJunctionTypes |
| The matrix of roads to junction type mappings. | |
| TypesCont | myTypes |
| The container of types. | |
A storage for available types of edges.
NBTypeCont stores properties of edge-types of edges. Additionally, a default type is stored which is used if no type information is given.
This structure also contains a structure for determining node types using edge speeds.
Definition at line 52 of file NBTypeCont.h.
typedef std::map<std::string, TypeDefinition> NBTypeCont::TypesCont [private] |
A container of types, accessed by the string id.
Definition at line 250 of file NBTypeCont.h.
| NBTypeCont::NBTypeCont | ( | ) | throw () [inline] |
Constructor.
Definition at line 55 of file NBTypeCont.h.
| NBTypeCont::~NBTypeCont | ( | ) | throw () [inline] |
Destructor.
Definition at line 59 of file NBTypeCont.h.
| NBTypeCont::NBTypeCont | ( | const NBTypeCont & | s | ) | [private] |
invalid copy constructor
| const SUMOVehicleClasses & NBTypeCont::getAllowedClasses | ( | const std::string & | type | ) | const throw () |
Returns allowed vehicle classes for the given type.
If the named type is not known, the default is returned
| [in] | type | The name of the type to return the list of allowed vehicles classes for |
Definition at line 139 of file NBTypeCont.cpp.
Referenced by NIXMLEdgesHandler::addEdge(), and NIImporter_OpenStreetMap::insertEdge().
| const SUMOVehicleClasses & NBTypeCont::getDisallowedClasses | ( | const std::string & | type | ) | const throw () |
Returns not allowed vehicle classes for the given type.
If the named type is not known, the default is returned
| [in] | type | The name of the type to return the list of not allowed vehicles classes for |
Definition at line 145 of file NBTypeCont.cpp.
Referenced by NIXMLEdgesHandler::addEdge(), and NIImporter_OpenStreetMap::insertEdge().
| bool NBTypeCont::getIsOneWay | ( | const std::string & | type | ) | const throw () |
Returns whether edges are one-way per default for the given type.
If the named type is not known, the default is returned
| [in] | type | The name of the type to return the one-way information for |
Definition at line 127 of file NBTypeCont.cpp.
Referenced by NIImporter_OpenStreetMap::insertEdge().
| SumoXMLNodeType NBTypeCont::getJunctionType | ( | SUMOReal | speed1, |
| SUMOReal | speed2 | ||
| ) | const throw () |
Returns the type of the junction between two edges of the given types.
Definition at line 91 of file NBTypeCont.cpp.
Referenced by NBNode::computeType().
| int NBTypeCont::getNumLanes | ( | const std::string & | type | ) | const throw () |
Returns the number of lanes for the given type.
If the named type is not known, the default is returned
| [in] | type | The name of the type to return the lane number for |
Definition at line 109 of file NBTypeCont.cpp.
Referenced by NIXMLEdgesHandler::addEdge(), NIImporter_OpenStreetMap::insertEdge(), NIImporter_ArcView::load(), NIImporter_VISUM::parse_Edges(), and NGNet::toNB().
| int NBTypeCont::getPriority | ( | const std::string & | type | ) | const throw () |
Returns the priority for the given type.
If the named type is not known, the default is returned
| [in] | type | The name of the type to return the priority for |
Definition at line 121 of file NBTypeCont.cpp.
Referenced by NIXMLEdgesHandler::addEdge(), NIImporter_OpenStreetMap::insertEdge(), NIImporter_OpenDrive::loadNetwork(), NIImporter_VISUM::parse_Edges(), and NGNet::toNB().
| bool NBTypeCont::getShallBeDiscarded | ( | const std::string & | type | ) | const throw () |
Returns the information whether edges of this type shall be discarded.
Returns false if the type is not known.
Definition at line 133 of file NBTypeCont.cpp.
| SUMOReal NBTypeCont::getSpeed | ( | const std::string & | type | ) | const throw () |
Returns the maximal velocity for the given type [m/s].
If the named type is not known, the default is returned
| [in] | type | The name of the type to return the speed for |
Definition at line 115 of file NBTypeCont.cpp.
Referenced by NIXMLEdgesHandler::addEdge(), NIImporter_OpenStreetMap::insertEdge(), NIImporter_ArcView::load(), NIImporter_OpenDrive::loadNetwork(), NIImporter_VISUM::parse_Edges(), and NGNet::toNB().
| const NBTypeCont::TypeDefinition & NBTypeCont::getType | ( | const std::string & | name | ) | const [private] |
Retrieve the name or the default type.
If no name is given, the default type is returned
| [in] | name | The name of the type to retrieve |
Definition at line 157 of file NBTypeCont.cpp.
References myDefaultType, and myTypes.
| SUMOReal NBTypeCont::getWidth | ( | const std::string & | type | ) | const throw () |
Returns the lane width for the given type [m/s].
If the named type is not known, the default is returned
| [in] | type | The name of the type to return the width for |
Definition at line 151 of file NBTypeCont.cpp.
Referenced by NIXMLEdgesHandler::addEdge(), NIImporter_OpenStreetMap::insertEdge(), NIImporter_ArcView::load(), and NGNet::toNB().
| bool NBTypeCont::insert | ( | const std::string & | id, |
| int | noLanes, | ||
| SUMOReal | maxSpeed, | ||
| int | prio, | ||
| SUMOReal | width, | ||
| SUMOVehicleClass | vClasses = SVC_UNKNOWN, |
||
| bool | oneWayIsDefault = false |
||
| ) | throw () |
Adds a type into the list. This is a simplified convenience form of insert, if only one allowed vehicle class is necessary.
| [in] | id | The id of the type |
| [in] | noLanes | The number of lanes an edge of this type has |
| [in] | maxSpeed | The speed allowed on an edge of this type |
| [in] | prio | The priority of an edge of this type |
| [in] | width | The width of lanes of edgesof this type |
| [in] | vClasses | The vehicle classes allowed on an edge of this type |
| [in] | oneWayIsDefault | Whether edges of this type are one-way per default |
Definition at line 57 of file NBTypeCont.cpp.
References SVC_UNKNOWN.
Referenced by NIImporter_OpenStreetMap::_loadNetwork(), and NIImporter_VISUM::parse_Types().
| bool NBTypeCont::insert | ( | const std::string & | id, |
| int | noLanes, | ||
| SUMOReal | maxSpeed, | ||
| int | prio, | ||
| const SUMOVehicleClasses & | allow, | ||
| const SUMOVehicleClasses & | disallow, | ||
| SUMOReal | width, | ||
| bool | oneWayIsDefault | ||
| ) | throw () |
Adds a type into the list.
| [in] | id | The id of the type |
| [in] | noLanes | The number of lanes an edge of this type has |
| [in] | maxSpeed | The speed allowed on an edge of this type |
| [in] | prio | The priority of an edge of this type |
| [in] | allow | The list of vehicle classes allowed on an edge of this type |
| [in] | disallow | The list of vehicle classes disallowed on an edge of this type |
| [in] | width | The width of lanes of edgesof this type |
| [in] | oneWayIsDefault | Whether edges of this type are one-way per default |
Definition at line 68 of file NBTypeCont.cpp.
References NBTypeCont::TypeDefinition::allowed, NBTypeCont::TypeDefinition::notAllowed, and NBTypeCont::TypeDefinition::oneWay.
| bool NBTypeCont::knows | ( | const std::string & | type | ) | const throw () |
Returns whether the named type is in the container.
Definition at line 85 of file NBTypeCont.cpp.
Referenced by NIXMLEdgesHandler::addEdge(), and NIImporter_OpenStreetMap::insertEdge().
| bool NBTypeCont::markAsToDiscard | ( | const std::string & | id | ) | throw () |
Marks a type as to be discarded.
| [in] | id | The id of the type |
Definition at line 97 of file NBTypeCont.cpp.
| NBTypeCont& NBTypeCont::operator= | ( | const NBTypeCont & | s | ) | [private] |
invalid assignment operator
| void NBTypeCont::setDefaults | ( | int | defaultNoLanes, |
| SUMOReal | defaultSpeed, | ||
| int | defaultPriority | ||
| ) | throw () |
Sets the default values.
| [in] | defaultNoLanes | The default number of lanes an edge has |
| [in] | defaultSpeed | The default speed allowed on an edge |
| [in] | defaultPriority | The default priority of an edge |
Definition at line 47 of file NBTypeCont.cpp.
| unsigned int NBTypeCont::size | ( | ) | const throw () [inline] |
Returns the number of known types.
Definition at line 104 of file NBTypeCont.h.
References myTypes.
Referenced by NILoader::load().
TypeDefinition NBTypeCont::myDefaultType [private] |
The matrix of roads to junction type mappings.
Definition at line 256 of file NBTypeCont.h.
TypesCont NBTypeCont::myTypes [private] |
The container of types.
Definition at line 253 of file NBTypeCont.h.