51 if (!oc.
isSet(
"matsim-output")) {
55 device <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
56 device <<
"<!DOCTYPE network SYSTEM \"http://www.matsim.org/files/dtd/network_v1.dtd\">\n\n";
57 device <<
"<network name=\"NAME\">\n";
59 device <<
" <nodes>\n";
61 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
62 device <<
" <node id=\"" << (*i).first
63 <<
"\" x=\"" << (*i).second->getPosition().x()
64 <<
"\" y=\"" << (*i).second->getPosition().y()
67 device <<
" </nodes>\n";
69 device <<
" <links capperiod=\"01:00:00\">\n";
71 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
72 device <<
" <link id=\"" << (*i).first
73 <<
"\" from=\"" << (*i).second->getFromNode()->getID()
74 <<
"\" to=\"" << (*i).second->getToNode()->getID()
75 <<
"\" length=\"" << (*i).second->getLoadedLength()
76 <<
"\" capacity=\"" << (oc.
getFloat(
"lanes-from-capacity.norm") * (*i).second->getNumLanes())
77 <<
"\" freespeed=\"" << (*i).second->getSpeed()
78 <<
"\" permlanes=\"" << (*i).second->getNumLanes()
81 device <<
" </links>\n";
83 device <<
"</network>\n";
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.
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()
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.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
NBNodeCont & getNodeCont()
Returns a reference to 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.