42 #ifdef CHECK_MEMORY_LEAKS
44 #endif // CHECK_MEMORY_LEAKS
57 if (!oc.
isSet(
"amitran-output")) {
61 device <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
62 device <<
"<network xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/amitran/network.xsd\">\n";
66 std::set<NBNode*> singleRoundaboutNodes;
67 std::set<NBNode*> multiRoundaboutNodes;
69 for (std::vector<EdgeVector>::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) {
70 for (EdgeVector::const_iterator j = (*i).begin(); j != (*i).end(); ++j) {
71 if ((*j)->getNumLanes() > 1) {
72 multiRoundaboutNodes.insert((*j)->getFromNode());
74 singleRoundaboutNodes.insert((*j)->getFromNode());
78 std::map<NBNode*, int> nodeIds;
79 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
80 device <<
" <node id=\"" << index;
81 nodeIds[i->second] = index++;
82 if (singleRoundaboutNodes.count(i->second) > 0) {
83 device <<
"\" type=\"roundaboutSingle\"/>\n";
86 if (multiRoundaboutNodes.count(i->second) > 0) {
87 device <<
"\" type=\"roundaboutMulti\"/>\n";
90 switch (i->second->getType()) {
93 device <<
"\" type=\"trafficLight";
96 device <<
"\" type=\"priority";
99 device <<
"\" type=\"priorityStop";
102 device <<
"\" type=\"rightBeforeLeft";
105 device <<
"\" type=\"allwayStop";
109 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";