41 #ifdef CHECK_MEMORY_LEAKS
43 #endif // CHECK_MEMORY_LEAKS
56 if (!oc.
isSet(
"matsim-output")) {
60 device <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
61 device <<
"<!DOCTYPE network SYSTEM \"http://www.matsim.org/files/dtd/network_v1.dtd\">\n\n";
62 device <<
"<network name=\"NAME\">\n";
64 device <<
" <nodes>\n";
66 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
67 device <<
" <node id=\"" << (*i).first
68 <<
"\" x=\"" << (*i).second->getPosition().x()
69 <<
"\" y=\"" << (*i).second->getPosition().y()
72 device <<
" </nodes>\n";
74 device <<
" <links capperiod=\"01:00:00\">\n";
76 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
77 device <<
" <link id=\"" << (*i).first
78 <<
"\" from=\"" << (*i).second->getFromNode()->getID()
79 <<
"\" to=\"" << (*i).second->getToNode()->getID()
80 <<
"\" length=\"" << (*i).second->getLoadedLength()
81 <<
"\" capacity=\"" << (oc.
getFloat(
"lanes-from-capacity.norm") * (*i).second->getNumLanes())
82 <<
"\" freespeed=\"" << (*i).second->getSpeed()
83 <<
"\" permlanes=\"" << (*i).second->getNumLanes()
86 device <<
" </links>\n";
88 device <<
"</network>\n";
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
NBEdgeCont & getEdgeCont()
Returns the edge container.
Storage for edges, including some functionality operating on multiple edges.
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
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.
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into a MATSim-file.
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.