44 if (!oc.
isSet(
"amitran-output")) {
49 device <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
50 device <<
"<network xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/amitran/network.xsd\">\n";
54 std::set<NBNode*> singleRoundaboutNodes;
55 std::set<NBNode*> multiRoundaboutNodes;
57 for (std::set<EdgeSet>::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) {
58 for (EdgeSet::const_iterator j = (*i).begin(); j != (*i).end(); ++j) {
59 if ((*j)->getNumLanes() > 1) {
60 multiRoundaboutNodes.insert((*j)->getFromNode());
62 singleRoundaboutNodes.insert((*j)->getFromNode());
66 std::map<NBNode*, int> nodeIds;
67 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
68 device <<
" <node id=\"" << index;
69 nodeIds[i->second] = index++;
70 if (singleRoundaboutNodes.count(i->second) > 0) {
71 device <<
"\" type=\"roundaboutSingle\"/>\n";
74 if (multiRoundaboutNodes.count(i->second) > 0) {
75 device <<
"\" type=\"roundaboutMulti\"/>\n";
78 switch (i->second->getType()) {
82 device <<
"\" type=\"trafficLight";
85 device <<
"\" type=\"priority";
88 device <<
"\" type=\"priorityStop";
91 device <<
"\" type=\"rightBeforeLeft";
94 device <<
"\" type=\"leftBeforeRight";
97 device <<
"\" type=\"allwayStop";
100 device <<
"\" type=\"zipper";
103 device <<
"\" type=\"railSignal";
106 device <<
"\" type=\"railCrossing";
110 device <<
"\" type=\"deadEnd";
122 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
123 device <<
" <link id=\"" << index++
124 <<
"\" from=\"" << nodeIds[i->second->getFromNode()]
125 <<
"\" to=\"" << nodeIds[i->second->getToNode()]
127 <<
"\" length=\"" << int(1000 * i->second->getLoadedLength())
128 <<
"\" speedLimitKmh=\"" << int(3.6 * (*i).second->getSpeed() + 0.5)
129 <<
"\" laneNr=\"" << (*i).second->getNumLanes()
132 device <<
"</network>\n";
@ TRAFFIC_LIGHT_RIGHT_ON_RED
@ TRAFFIC_LIGHT_NOJUNCTION
Storage for edges, including some functionality operating on multiple edges.
const std::set< EdgeSet > getRoundabouts() const
Returns the determined roundabouts.
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
Instance responsible for building networks.
NBNodeCont & getNodeCont()
Returns a reference to the node container.
NBEdgeCont & getEdgeCont()
Container for nodes during the netbuilding process.
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into a Amitran-file.
static int getRoadClass(const NBEdge *const edge)
get the navteq road class
A storage for options typed value containers)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Static storage of an output device and its base (abstract) implementation.
void close()
Closes the device and removes it from the dictionary.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.