42 #ifdef CHECK_MEMORY_LEAKS 44 #endif // CHECK_MEMORY_LEAKS 57 if (!oc.
isSet(
"amitran-output")) {
62 device <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
63 device <<
"<network xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/amitran/network.xsd\">\n";
67 std::set<NBNode*> singleRoundaboutNodes;
68 std::set<NBNode*> multiRoundaboutNodes;
70 for (std::set<EdgeSet>::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) {
71 for (EdgeSet::const_iterator j = (*i).begin(); j != (*i).end(); ++j) {
72 if ((*j)->getNumLanes() > 1) {
73 multiRoundaboutNodes.insert((*j)->getFromNode());
75 singleRoundaboutNodes.insert((*j)->getFromNode());
79 std::map<NBNode*, int> nodeIds;
80 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
81 device <<
" <node id=\"" << index;
82 nodeIds[i->second] = index++;
83 if (singleRoundaboutNodes.count(i->second) > 0) {
84 device <<
"\" type=\"roundaboutSingle\"/>\n";
87 if (multiRoundaboutNodes.count(i->second) > 0) {
88 device <<
"\" type=\"roundaboutMulti\"/>\n";
91 switch (i->second->getType()) {
95 device <<
"\" type=\"trafficLight";
98 device <<
"\" type=\"priority";
101 device <<
"\" type=\"priorityStop";
104 device <<
"\" type=\"rightBeforeLeft";
107 device <<
"\" type=\"allwayStop";
110 device <<
"\" type=\"zipper";
113 device <<
"\" type=\"railSignal";
116 device <<
"\" type=\"railCrossing";
120 device <<
"\" type=\"deadEnd";
132 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
133 device <<
" <link id=\"" << index++
134 <<
"\" from=\"" << nodeIds[i->second->getFromNode()]
135 <<
"\" to=\"" << nodeIds[i->second->getToNode()]
137 <<
"\" length=\"" << int(1000 * i->second->getLoadedLength())
138 <<
"\" speedLimitKmh=\"" <<
int(3.6 * (*i).second->getSpeed() + 0.5)
139 <<
"\" laneNr=\"" << (*i).second->getNumLanes()
142 device <<
"</network>\n";
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into a Amitran-file.
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 int getRoadClass(NBEdge *edge)
get the navteq road class
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
NBEdgeCont & getEdgeCont()
Returns the edge container.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Storage for edges, including some functionality operating on multiple edges.
const std::set< EdgeSet > getRoundabouts() const
Returns the determined roundabouts.
NBNodeCont & getNodeCont()
Returns the node container.
Instance responsible for building networks.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
A storage for options typed value containers)
Static storage of an output device and its base (abstract) implementation.
Container for nodes during the netbuilding process.