43 if (!oc.
isSet(
"matsim-output")) {
47 device <<
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
48 device <<
"<!DOCTYPE network SYSTEM \"http://www.matsim.org/files/dtd/network_v1.dtd\">\n\n";
49 device <<
"<network name=\"NAME\">\n";
51 device <<
" <nodes>\n";
53 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
54 device <<
" <node id=\"" << (*i).first
55 <<
"\" x=\"" << (*i).second->getPosition().x()
56 <<
"\" y=\"" << (*i).second->getPosition().y()
59 device <<
" </nodes>\n";
61 device <<
" <links capperiod=\"01:00:00\">\n";
63 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
64 device <<
" <link id=\"" << (*i).first
65 <<
"\" from=\"" << (*i).second->getFromNode()->getID()
66 <<
"\" to=\"" << (*i).second->getToNode()->getID()
67 <<
"\" length=\"" << (*i).second->getLoadedLength()
68 <<
"\" capacity=\"" << (oc.
getFloat(
"lanes-from-capacity.norm") * (*i).second->getNumLanes())
69 <<
"\" freespeed=\"" << (*i).second->getSpeed()
70 <<
"\" permlanes=\"" << (*i).second->getNumLanes()
73 device <<
" </links>\n";
75 device <<
"</network>\n";
Storage for edges, including some functionality operating on multiple edges.
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
Instance responsible for building networks.
NBNodeCont & getNodeCont()
Returns a reference to the node container.
NBEdgeCont & getEdgeCont()
Container for nodes during the netbuilding process.
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 void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into a MATSim-file.
A storage for options typed value containers)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
double getFloat(const std::string &name) const
Returns the double-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)
Static storage of an output device and its base (abstract) implementation.
void close()
Closes the device and removes it from the dictionary.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.