42 #ifdef CHECK_MEMORY_LEAKS 44 #endif // CHECK_MEMORY_LEAKS 68 TypeDefinition newType(numLanes, maxSpeed, prio, width, permissions, oneWayIsDefault, sidewalkWidth, bikeLaneWidth);
69 TypesCont::iterator old =
myTypes.find(
id);
71 newType.
restrictions.insert(old->second.restrictions.begin(), old->second.restrictions.end());
72 newType.
attrs.insert(old->second.attrs.begin(), old->second.attrs.end());
86 TypesCont::iterator i =
myTypes.find(
id);
90 (*i).second.discard =
true;
97 TypesCont::iterator i =
myTypes.find(
id);
101 (*i).second.attrs.insert(attr);
108 TypesCont::iterator i =
myTypes.find(
id);
112 (*i).second.restrictions[svc] = speed;
119 TypesCont::iterator from =
myTypes.find(fromId);
120 TypesCont::iterator to =
myTypes.find(toId);
124 to->second.restrictions.insert(from->second.restrictions.begin(), from->second.restrictions.end());
125 to->second.attrs.insert(from->second.attrs.begin(), from->second.attrs.end());
132 for (TypesCont::const_iterator i =
myTypes.begin(); i !=
myTypes.end(); ++i) {
163 for (std::map<SUMOVehicleClass, SUMOReal>::const_iterator j = type.
restrictions.begin(); j != type.
restrictions.end(); ++j) {
240 TypesCont::const_iterator i =
myTypes.find(name);
SUMOReal getSpeed(const std::string &type) const
Returns the maximal velocity for the given type [m/s].
void writePermissions(OutputDevice &into, SVCPermissions permissions)
writes allowed disallowed attributes if needed;
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
SUMOReal getBikeLaneWidth(const std::string &type) const
Returns the lane width for a bike lane to be added [m].
std::set< SumoXMLAttr > attrs
The attributes which have been set.
int numLanes
The number of lanes of an edge.
SUMOReal getWidth(const std::string &type) const
Returns the lane width for the given type [m].
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
SUMOReal width
The width of lanes of edges of this type [m].
int getPriority(const std::string &type) const
Returns the priority for the given type.
SUMOReal speed
The maximal velocity on an edge in m/s.
bool markAsSet(const std::string &id, const SumoXMLAttr attr)
Marks an attribute of a type as set.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
int getNumLanes(const std::string &type) const
Returns the number of lanes for the given type.
bool getShallBeDiscarded(const std::string &type) const
Returns the information whether edges of this type shall be discarded.
void setDefaults(int defaultNumLanes, SUMOReal defaultLaneWidth, SUMOReal defaultSpeed, int defaultPriority, SVCPermissions defaultPermissions)
Sets the default values.
bool oneWay
Whether one-way traffic is mostly common for this type (mostly unused)
const TypeDefinition & getType(const std::string &name) const
Retrieve the name or the default type.
bool knows(const std::string &type) const
Returns whether the named type is in the container.
std::string getVehicleClassNames(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
void insert(const std::string &id, int numLanes, SUMOReal maxSpeed, int prio, SVCPermissions permissions, SUMOReal width, bool oneWayIsDefault, SUMOReal sidewalkWidth, SUMOReal bikeLaneWidth)
Adds a type into the list.
bool markAsToDiscard(const std::string &id)
Marks a type as to be discarded.
TypeDefinition myDefaultType
The default type.
SUMOReal getSidewalkWidth(const std::string &type) const
Returns the lane width for a sidewalk to be added [m].
bool copyRestrictionsAndAttrs(const std::string &fromId, const std::string &toId)
Copy restrictions to a type.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
int priority
The priority of an edge.
SVCPermissions permissions
List of vehicle types that are allowed on this edge.
bool getIsOneWay(const std::string &type) const
Returns whether edges are one-way per default for the given type.
std::map< SUMOVehicleClass, SUMOReal > restrictions
The vehicle class specific speed restrictions.
TypesCont myTypes
The container of types.
bool addRestriction(const std::string &id, const SUMOVehicleClass svc, const SUMOReal speed)
Adds a restriction to a type.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void lf()
writes a line feed if applicable
bool wasSet(const std::string &type, const SumoXMLAttr attr) const
Returns whether an attribute of a type was set.
bool discard
Whether edges of this type shall be discarded.
SVCPermissions getPermissions(const std::string &type) const
Returns allowed vehicle classes for the given type.
void writeTypes(OutputDevice &into) const
writes all types a s XML