 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
45 if (!oc.
isSet(
"amitran-output")) {
50 device <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
51 device <<
"<network xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/amitran/network.xsd\">\n";
55 std::set<NBNode*> singleRoundaboutNodes;
56 std::set<NBNode*> multiRoundaboutNodes;
58 for (std::set<EdgeSet>::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) {
59 for (EdgeSet::const_iterator j = (*i).begin(); j != (*i).end(); ++j) {
60 if ((*j)->getNumLanes() > 1) {
61 multiRoundaboutNodes.insert((*j)->getFromNode());
63 singleRoundaboutNodes.insert((*j)->getFromNode());
67 std::map<NBNode*, int> nodeIds;
68 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
69 device <<
" <node id=\"" << index;
70 nodeIds[i->second] = index++;
71 if (singleRoundaboutNodes.count(i->second) > 0) {
72 device <<
"\" type=\"roundaboutSingle\"/>\n";
75 if (multiRoundaboutNodes.count(i->second) > 0) {
76 device <<
"\" type=\"roundaboutMulti\"/>\n";
79 switch (i->second->getType()) {
83 device <<
"\" type=\"trafficLight";
86 device <<
"\" type=\"priority";
89 device <<
"\" type=\"priorityStop";
92 device <<
"\" type=\"rightBeforeLeft";
95 device <<
"\" type=\"allwayStop";
98 device <<
"\" type=\"zipper";
101 device <<
"\" type=\"railSignal";
104 device <<
"\" type=\"railCrossing";
108 device <<
"\" type=\"deadEnd";
120 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
121 device <<
" <link id=\"" << index++
122 <<
"\" from=\"" << nodeIds[i->second->getFromNode()]
123 <<
"\" to=\"" << nodeIds[i->second->getToNode()]
125 <<
"\" length=\"" << int(1000 * i->second->getLoadedLength())
126 <<
"\" speedLimitKmh=\"" << int(3.6 * (*i).second->getSpeed() + 0.5)
127 <<
"\" laneNr=\"" << (*i).second->getNumLanes()
130 device <<
"</network>\n";
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
@ NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED
@ NODETYPE_DEAD_END_DEPRECATED
Storage for edges, including some functionality operating on multiple edges.
Instance responsible for building networks.
Static storage of an output device and its base (abstract) implementation.
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
void close()
Closes the device and removes it from the dictionary.
Container for nodes during the netbuilding process.
NBEdgeCont & getEdgeCont()
@ NODETYPE_TRAFFIC_LIGHT_NOJUNCTION
A storage for options typed value containers)
@ NODETYPE_RIGHT_BEFORE_LEFT
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
static int getRoadClass(NBEdge *edge)
get the navteq road class
NBNodeCont & getNodeCont()
Returns a reference to the node container.
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
const std::set< EdgeSet > getRoundabouts() const
Returns the determined roundabouts.
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into a Amitran-file.