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