45 if (!oc.
isSet(
"matsim-output")) {
49 device <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
50 device <<
"<!DOCTYPE network SYSTEM \"http://www.matsim.org/files/dtd/network_v1.dtd\">\n\n";
51 device <<
"<network name=\"NAME\">\n";
53 device <<
" <nodes>\n";
55 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
56 device <<
" <node id=\"" << (*i).first
57 <<
"\" x=\"" << (*i).second->getPosition().x()
58 <<
"\" y=\"" << (*i).second->getPosition().y()
61 device <<
" </nodes>\n";
63 device <<
" <links capperiod=\"01:00:00\">\n";
65 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
66 device <<
" <link id=\"" << (*i).first
67 <<
"\" from=\"" << (*i).second->getFromNode()->getID()
68 <<
"\" to=\"" << (*i).second->getToNode()->getID()
69 <<
"\" length=\"" << (*i).second->getLoadedLength()
70 <<
"\" capacity=\"" << (oc.
getFloat(
"lanes-from-capacity.norm") * (*i).second->getNumLanes())
71 <<
"\" freespeed=\"" << (*i).second->getSpeed()
72 <<
"\" permlanes=\"" << (*i).second->getNumLanes()
75 device <<
" </links>\n";
77 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.