SUMO - Simulation of Urban MObility
marouter_main.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // Main for MAROUTER
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #ifdef HAVE_VERSION_H
35 #include <version.h>
36 #endif
37 
38 #include <xercesc/sax/SAXException.hpp>
39 #include <xercesc/sax/SAXParseException.hpp>
41 #include <iostream>
42 #include <string>
43 #include <limits.h>
44 #include <ctime>
45 #include <vector>
50 #include <utils/common/ToString.h>
54 #include <utils/options/Option.h>
61 #include <utils/vehicle/CHRouter.h>
63 #include <utils/xml/XMLSubSys.h>
64 #include <od/ODCell.h>
65 #include <od/ODDistrict.h>
66 #include <od/ODDistrictCont.h>
67 #include <od/ODDistrictHandler.h>
68 #include <od/ODMatrix.h>
69 #include <router/ROEdge.h>
70 #include <router/ROLoader.h>
71 #include <router/RONet.h>
72 #include <router/RORoute.h>
73 #include <router/RORoutable.h>
74 
75 #include "ROMAFrame.h"
76 #include "ROMAAssignments.h"
77 #include "ROMAEdgeBuilder.h"
78 #include "ROMARouteHandler.h"
79 #include "ROMAEdge.h"
80 
81 
82 // ===========================================================================
83 // functions
84 // ===========================================================================
85 /* -------------------------------------------------------------------------
86  * data processing methods
87  * ----------------------------------------------------------------------- */
93 void
94 initNet(RONet& net, ROLoader& loader, OptionsCont& oc) {
95  // load the net
96  ROMAEdgeBuilder builder;
97  ROEdge::setGlobalOptions(oc.getBool("weights.interpolate"));
98  loader.loadNet(net, builder);
99  // initialize the travel times
100  /* const SUMOTime begin = string2time(oc.getString("begin"));
101  const SUMOTime end = string2time(oc.getString("end"));
102  for (std::map<std::string, ROEdge*>::const_iterator i = net.getEdgeMap().begin(); i != net.getEdgeMap().end(); ++i) {
103  (*i).second->addTravelTime(STEPS2TIME(begin), STEPS2TIME(end), (*i).second->getLength() / (*i).second->getSpeedLimit());
104  }*/
105  // load the weights when wished/available
106  if (oc.isSet("weight-files")) {
107  loader.loadWeights(net, "weight-files", oc.getString("weight-attribute"), false, oc.getBool("weights.expand"));
108  }
109  if (oc.isSet("lane-weight-files")) {
110  loader.loadWeights(net, "lane-weight-files", oc.getString("weight-attribute"), true, oc.getBool("weights.expand"));
111  }
112 }
113 
114 double
115 getTravelTime(const ROEdge* const edge, const ROVehicle* const /* veh */, double /* time */) {
116  return edge->getLength() / edge->getSpeedLimit();
117 }
118 
119 
123 void
125  std::ofstream outFile(oc.getString("all-pairs-output").c_str(), std::ios::binary);
126  // build the router
128  Dijkstra router(ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &getTravelTime);
129  ConstROEdgeVector into;
130  const int numInternalEdges = net.getInternalEdgeNumber();
131  const int numTotalEdges = (int)net.getEdgeNo();
132  for (int i = numInternalEdges; i < numTotalEdges; i++) {
133  const Dijkstra::EdgeInfo& ei = router.getEdgeInfo(i);
134  if (!ei.edge->isInternal()) {
135  router.compute(ei.edge, 0, 0, 0, into);
136  double fromEffort = router.getEffort(ei.edge, 0, 0);
137  for (int j = numInternalEdges; j < numTotalEdges; j++) {
138  double heuTT = router.getEdgeInfo(j).traveltime - fromEffort;
139  FileHelpers::writeFloat(outFile, heuTT);
140  /*
141  if (heuTT >
142  ei.edge->getDistanceTo(router.getEdgeInfo(j).edge)
143  && router.getEdgeInfo(j).traveltime != std::numeric_limits<double>::max()
144  ) {
145  std::cout << " heuristic failure: from=" << ei.edge->getID() << " to=" << router.getEdgeInfo(j).edge->getID()
146  << " fromEffort=" << fromEffort << " heuTT=" << heuTT << " airDist=" << ei.edge->getDistanceTo(router.getEdgeInfo(j).edge) << "\n";
147  }
148  */
149  }
150  }
151  }
152 }
153 
154 
158 void
159 writeInterval(OutputDevice& dev, const SUMOTime begin, const SUMOTime end, const RONet& net, const ROVehicle* const veh) {
161  for (std::map<std::string, ROEdge*>::const_iterator i = net.getEdgeMap().begin(); i != net.getEdgeMap().end(); ++i) {
162  ROMAEdge* edge = static_cast<ROMAEdge*>(i->second);
163  if (edge->getFunction() == EDGEFUNC_NORMAL) {
165  const double traveltime = edge->getTravelTime(veh, STEPS2TIME(begin));
166  const double flow = edge->getFlow(STEPS2TIME(begin));
167  dev.writeAttr("traveltime", traveltime);
168  dev.writeAttr("speed", edge->getLength() / traveltime);
169  dev.writeAttr("entered", flow);
170  dev.writeAttr("flowCapacityRatio", 100. * flow / ROMAAssignments::getCapacity(edge));
171  dev.closeTag();
172  }
173  }
174  dev.closeTag();
175 }
176 
177 
181 void
183  // build the router
185  const std::string measure = oc.getString("weight-attribute");
186  const std::string routingAlgorithm = oc.getString("routing-algorithm");
187  const SUMOTime begin = string2time(oc.getString("begin"));
188  const SUMOTime end = string2time(oc.getString("end"));
189  if (measure == "traveltime") {
190  if (routingAlgorithm == "dijkstra") {
191  if (net.hasPermissions()) {
192  if (oc.getInt("paths") > 1) {
195  } else {
197  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
198  }
199  } else {
200  if (oc.getInt("paths") > 1) {
203  } else {
205  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
206  }
207  }
208  } else if (routingAlgorithm == "astar") {
209  if (net.hasPermissions()) {
210  if (oc.getInt("paths") > 1) {
213  } else {
215  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
216  }
217  } else {
218  if (oc.getInt("paths") > 1) {
221  } else {
223  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
224  }
225  }
226  } else if (routingAlgorithm == "CH") {
227  const SUMOTime weightPeriod = (oc.isSet("weight-files") ?
228  string2time(oc.getString("weight-period")) :
230  if (net.hasPermissions()) {
232  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, true);
233  } else {
235  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, false);
236  }
237  } else if (routingAlgorithm == "CHWrapper") {
238  const SUMOTime weightPeriod = (oc.isSet("weight-files") ?
239  string2time(oc.getString("weight-period")) :
243  begin, end, weightPeriod, oc.getInt("routing-threads"));
244  } else {
245  throw ProcessError("Unknown routing Algorithm '" + routingAlgorithm + "'!");
246  }
247 
248  } else {
250  if (measure == "CO") {
251  op = &ROEdge::getEmissionEffort<PollutantsInterface::CO>;
252  } else if (measure == "CO2") {
253  op = &ROEdge::getEmissionEffort<PollutantsInterface::CO2>;
254  } else if (measure == "PMx") {
255  op = &ROEdge::getEmissionEffort<PollutantsInterface::PM_X>;
256  } else if (measure == "HC") {
257  op = &ROEdge::getEmissionEffort<PollutantsInterface::HC>;
258  } else if (measure == "NOx") {
259  op = &ROEdge::getEmissionEffort<PollutantsInterface::NO_X>;
260  } else if (measure == "fuel") {
261  op = &ROEdge::getEmissionEffort<PollutantsInterface::FUEL>;
262  } else if (measure == "electricity") {
263  op = &ROEdge::getEmissionEffort<PollutantsInterface::ELEC>;
264  } else if (measure == "noise") {
266  } else {
267  throw ProcessError("Unknown measure (weight attribute '" + measure + "')!");
268  }
269  if (net.hasPermissions()) {
270  if (oc.getInt("paths") > 1) {
273  } else {
275  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic);
276  }
277  } else {
278  if (oc.getInt("paths") > 1) {
281  } else {
283  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic);
284  }
285  }
286  }
287  try {
288  const RORouterProvider provider(router, 0, 0);
289  // prepare the output
290  net.openOutput(oc);
291  // process route definitions
292  if (oc.isSet("timeline")) {
293  matrix.applyCurve(matrix.parseTimeLine(oc.getStringVector("timeline"), oc.getBool("timeline.day-in-hours")));
294  }
295  matrix.sortByBeginTime();
296  ROVehicle defaultVehicle(SUMOVehicleParameter(), 0, net.getVehicleTypeSecure(DEFAULT_VTYPE_ID), &net);
297  ROMAAssignments a(begin, end, oc.getBool("additive-traffic"), oc.getFloat("weight-adaption"), net, matrix, *router);
298  a.resetFlows();
299 #ifdef HAVE_FOX
300  const int maxNumThreads = oc.getInt("routing-threads");
301  while ((int)net.getThreadPool().size() < maxNumThreads) {
302  new RONet::WorkerThread(net.getThreadPool(), provider);
303  }
304 #endif
305  const std::string assignMethod = oc.getString("assignment-method");
306  if (assignMethod == "incremental") {
307  a.incremental(oc.getInt("max-iterations"), oc.getBool("verbose"));
308  } else if (assignMethod == "SUE") {
309  a.sue(oc.getInt("max-iterations"), oc.getInt("max-inner-iterations"),
310  oc.getInt("paths"), oc.getFloat("paths.penalty"), oc.getFloat("tolerance"), oc.getString("route-choice-method"));
311  }
312  // update path costs and output
313  bool haveOutput = false;
314  OutputDevice* dev = net.getRouteOutput();
315  if (dev != 0) {
316  std::vector<std::string> tazParamKeys;
317  if (oc.isSet("taz-param")) {
318  tazParamKeys = oc.getStringVector("taz-param");
319  }
320  std::map<SUMOTime, std::string> sortedOut;
321  SUMOTime lastEnd = -1;
322  int num = 0;
323  for (std::vector<ODCell*>::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) {
324  const ODCell* const c = *i;
325  if (lastEnd >= 0 && lastEnd <= c->begin) {
326  for (std::map<SUMOTime, std::string>::const_iterator desc = sortedOut.begin(); desc != sortedOut.end(); ++desc) {
327  dev->writePreformattedTag(desc->second);
328  }
329  sortedOut.clear();
330  }
331  if (c->departures.empty()) {
332  OutputDevice_String od(dev->isBinary(), 1);
333  od.openTag(SUMO_TAG_FLOW).writeAttr(SUMO_ATTR_ID, oc.getString("prefix") + toString(num++));
336  matrix.writeDefaultAttrs(od, oc.getBool("ignore-vehicle-type"), c);
338  for (std::vector<RORoute*>::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) {
339  (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, string2time(oc.getString("begin"))));
340  (*j)->writeXMLDefinition(od, 0, true, false);
341  }
342  od.closeTag();
343  od.closeTag();
344  sortedOut[c->begin] += od.getString();
345  } else {
346  for (std::map<SUMOTime, std::vector<std::string> >::const_iterator deps = c->departures.begin(); deps != c->departures.end(); ++deps) {
347  const std::string routeDistId = c->origin + "_" + c->destination + "_" + time2string(c->begin) + "_" + time2string(c->end);
348  for (std::vector<std::string>::const_iterator id = deps->second.begin(); id != deps->second.end(); ++id) {
349  OutputDevice_String od(dev->isBinary(), 1);
351  matrix.writeDefaultAttrs(od, oc.getBool("ignore-vehicle-type"), c);
353  for (std::vector<RORoute*>::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) {
354  (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, string2time(oc.getString("begin"))));
355  (*j)->writeXMLDefinition(od, 0, true, false);
356  }
357  od.closeTag();
358  if (!tazParamKeys.empty()) {
359  od.openTag(SUMO_TAG_PARAM).writeAttr(SUMO_ATTR_KEY, tazParamKeys[0]).writeAttr(SUMO_ATTR_VALUE, c->origin).closeTag();
360  if (tazParamKeys.size() > 1) {
361  od.openTag(SUMO_TAG_PARAM).writeAttr(SUMO_ATTR_KEY, tazParamKeys[1]).writeAttr(SUMO_ATTR_VALUE, c->destination).closeTag();
362  }
363  }
364  od.closeTag();
365  sortedOut[deps->first] += od.getString();
366  }
367  }
368  }
369  for (std::vector<RORoute*>::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) {
370  delete *j;
371  }
372  if (c->end > lastEnd) {
373  lastEnd = c->end;
374  }
375  }
376  for (std::map<SUMOTime, std::string>::const_iterator desc = sortedOut.begin(); desc != sortedOut.end(); ++desc) {
377  dev->writePreformattedTag(desc->second);
378  }
379  haveOutput = true;
380  }
381  if (OutputDevice::createDeviceByOption("netload-output", "meandata")) {
382  if (oc.getBool("additive-traffic")) {
383  writeInterval(OutputDevice::getDeviceByOption("netload-output"), begin, end, net, a.getDefaultVehicle());
384  } else {
385  SUMOTime lastCell = 0;
386  for (std::vector<ODCell*>::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) {
387  if ((*i)->end > lastCell) {
388  lastCell = (*i)->end;
389  }
390  }
391  const SUMOTime interval = string2time(OptionsCont::getOptions().getString("aggregation-interval"));
392  for (SUMOTime start = begin; start < MIN2(end, lastCell); start += interval) {
393  writeInterval(OutputDevice::getDeviceByOption("netload-output"), start, start + interval, net, a.getDefaultVehicle());
394  }
395  }
396  haveOutput = true;
397  }
398  if (!haveOutput) {
399  throw ProcessError("No output file given.");
400  }
401  // end the processing
402  net.cleanup();
403  } catch (ProcessError&) {
404  for (std::vector<ODCell*>::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) {
405  for (std::vector<RORoute*>::const_iterator j = (*i)->pathsVector.begin(); j != (*i)->pathsVector.end(); ++j) {
406  delete *j;
407  }
408  }
409  net.cleanup();
410  throw;
411  }
412 }
413 
414 
415 /* -------------------------------------------------------------------------
416  * main
417  * ----------------------------------------------------------------------- */
418 int
419 main(int argc, char** argv) {
421  oc.setApplicationDescription("Import O/D-matrices for macroscopic traffic assignment");
422  oc.setApplicationName("marouter", "SUMO marouter Version " VERSION_STRING);
423  int ret = 0;
424  RONet* net = 0;
425  try {
426  XMLSubSys::init();
428  OptionsIO::setArgs(argc, argv);
430  if (oc.processMetaOptions(argc < 2)) {
432  return 0;
433  }
434  XMLSubSys::setValidation(oc.getString("xml-validation"), oc.getString("xml-validation.net"));
436  if (!ROMAFrame::checkOptions()) {
437  throw ProcessError();
438  }
440  // load data
441  ROLoader loader(oc, false, false);
442  net = new RONet();
443  initNet(*net, loader, oc);
444  if (oc.isSet("all-pairs-output")) {
445  computeAllPairs(*net, oc);
446  if (net->getDistricts().empty()) {
447  delete net;
449  if (ret == 0) {
450  std::cout << "Success." << std::endl;
451  }
452  return ret;
453  }
454  }
455  if (net->getDistricts().empty()) {
456  throw ProcessError("No districts loaded.");
457  }
458  // load districts
459  ODDistrictCont districts;
460  districts.makeDistricts(net->getDistricts());
461  // load the matrix
462  ODMatrix matrix(districts);
463  matrix.loadMatrix(oc);
464  ROMARouteHandler handler(matrix);
465  matrix.loadRoutes(oc, handler);
466  if (matrix.getNumLoaded() == 0) {
467  throw ProcessError("No vehicles loaded.");
468  }
469  if (MsgHandler::getErrorInstance()->wasInformed() && !oc.getBool("ignore-errors")) {
470  throw ProcessError("Loading failed.");
471  }
473  WRITE_MESSAGE(toString(matrix.getNumLoaded()) + " vehicles loaded.");
474 
475  // build routes and parse the incremental rates if the incremental method is choosen.
476  try {
477  computeRoutes(*net, oc, matrix);
478  } catch (XERCES_CPP_NAMESPACE::SAXParseException& e) {
479  WRITE_ERROR(toString(e.getLineNumber()));
480  ret = 1;
481  } catch (XERCES_CPP_NAMESPACE::SAXException& e) {
482  WRITE_ERROR(TplConvert::_2str(e.getMessage()));
483  ret = 1;
484  }
485  if (MsgHandler::getErrorInstance()->wasInformed() || ret != 0) {
486  throw ProcessError();
487  }
488  } catch (const ProcessError& e) {
489  if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) {
490  WRITE_ERROR(e.what());
491  }
492  MsgHandler::getErrorInstance()->inform("Quitting (on error).", false);
493  ret = 1;
494  }
495 
496  delete net;
498  if (ret == 0) {
499  std::cout << "Success." << std::endl;
500  }
501  return ret;
502 }
503 
504 
505 
506 /****************************************************************************/
507 
Computes the shortest path through a contracted network.
Definition: CHRouter.h:69
double getFlow(const double time) const
Definition: ROMAEdge.h:93
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:261
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
bool hasPermissions() const
Definition: RONet.cpp:697
const std::vector< ODCell * > & getCells()
Definition: ODMatrix.h:247
static void init()
Initialises the xml-subsystem.
Definition: XMLSubSys.cpp:54
Computes the shortest path through a network using the Dijkstra algorithm.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
Definition: MsgHandler.cpp:76
double getSpeedLimit() const
Returns the speed allowed on this edge.
Definition: ROEdge.h:220
OutputDevice * getRouteOutput(const bool alternative=false)
Definition: RONet.h:455
const std::map< std::string, std::pair< std::vector< std::string >, std::vector< std::string > > > & getDistricts() const
Retrieves all TAZ (districts) from the network.
Definition: RONet.h:153
void computeRoutes(RONet &net, OptionsCont &oc, ODMatrix &matrix)
static void getOptions(const bool commandLineOnly=false)
Parses the command line arguments and loads the configuration.
Definition: OptionsIO.cpp:82
assignment methods
a flow definition (used by router)
double getLength() const
Returns the length of the edge.
Definition: ROEdge.h:205
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
Definition: XMLSubSys.cpp:65
distribution of a route
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
Interface for building instances of duarouter-edges.
void makeDistricts(const std::map< std::string, std::pair< std::vector< std::string >, std::vector< std::string > > > &districts)
create districts from description
void setApplicationDescription(const std::string &appDesc)
Sets the application description.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
int main(int argc, char **argv)
static std::ostream & writeFloat(std::ostream &strm, double value)
Writes a float binary.
OutputDevice & writePreformattedTag(const std::string &val)
writes a preformatted tag to the device but ensures that any pending tags are closed ...
Definition: OutputDevice.h:307
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:60
Computes the shortest path through a network using the A* algorithm.
Definition: AStarRouter.h:85
weights: time range begin
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid for usage within duarouter...
Definition: ROMAFrame.cpp:292
void computeAllPairs(RONet &net, OptionsCont &oc)
double getTravelTime(const ROVehicle *const veh, double time) const
Returns the travel time for this edge.
Definition: ROEdge.cpp:175
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:63
Parser and container for routes during their loading.
std::vector< RORoute * > pathsVector
the list of paths / routes
Definition: ODCell.h:78
const std::string DEFAULT_VTYPE_ID
static void close()
Closes all of an applications subsystems.
double vehicleNumber
The number of vehicles.
Definition: ODCell.h:60
Computes the shortest path through a network using the Dijkstra algorithm.
const std::map< std::string, ROEdge * > & getEdgeMap() const
Definition: RONet.cpp:659
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
Definition: OptionsIO.cpp:62
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:65
void openOutput(const OptionsCont &options, const std::string altFilename="")
Opens the output for computed routes.
Definition: RONet.cpp:239
void loadMatrix(OptionsCont &oc)
read a matrix in one of several formats
Definition: ODMatrix.cpp:561
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
const std::string & getID() const
Returns the id.
Definition: Named.h:66
A vehicle as used by router.
Definition: ROVehicle.h:60
void cleanup()
closes the file output for computed routes and deletes associated threads if necessary ...
Definition: RONet.cpp:259
#define max(a, b)
Definition: polyfonts.c:65
static double getTravelTimeStatic(const ROEdge *const edge, const ROVehicle *const veh, double time)
Returns the travel time for the given edge.
Definition: ROEdge.h:405
double getTravelTime(const ROEdge *const edge, const ROVehicle *const , double)
A single O/D-matrix cell.
Definition: ODCell.h:58
void initNet(RONet &net, ROLoader &loader, OptionsCont &oc)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:56
std::string origin
Name of the origin district.
Definition: ODCell.h:69
parameter associated to a certain key
An O/D (origin/destination) matrix.
Definition: ODMatrix.h:76
The data loader.
Definition: ROLoader.h:63
bool processMetaOptions(bool missingOptions)
Checks for help and configuration output, returns whether we should exit.
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
void loadRoutes(OptionsCont &oc, SUMOSAXHandler &handler)
read SUMO routes
Definition: ODMatrix.cpp:607
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:47
A container for districts.
T MIN2(T a, T b)
Definition: StdDefs.h:68
std::map< SUMOTime, std::vector< std::string > > departures
mapping of departure times to departing vehicles, if already fixed
Definition: ODCell.h:81
int getEdgeNo() const
Returns the total number of edges the network contains including internal edges.
Definition: RONet.cpp:647
SumoXMLEdgeFunc getFunction() const
Returns the function of the edge.
Definition: ROEdge.h:189
void writeInterval(OutputDevice &dev, const SUMOTime begin, const SUMOTime end, const RONet &net, const ROVehicle *const veh)
#define VERSION_STRING
Definition: version.h:1
void sortByBeginTime()
Definition: ODMatrix.cpp:649
SUMOTime begin
The begin time this cell describes.
Definition: ODCell.h:63
static double getCapacity(const ROEdge *edge)
virtual void loadNet(RONet &toFill, ROAbstractEdgeBuilder &eb)
Loads the network.
Definition: ROLoader.cpp:120
A basic edge for routing applications.
Definition: ROEdge.h:78
begin/end of the description of an edge
int getInternalEdgeNumber() const
Returns the number of internal edges the network contains.
Definition: RONet.cpp:653
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:206
static void fillOptions()
Inserts options used by duarouter into the OptionsCont-singleton.
Definition: ROMAFrame.cpp:53
virtual double recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime) const =0
static double getPenalizedEffort(const ROEdge *const e, const ROVehicle *const v, double t)
Returns the effort to pass an edge including penalties.
The router&#39;s network representation.
Definition: RONet.h:76
Structure representing possible vehicle parameter.
static double getTravelTime(const ROEdge *const e, const ROVehicle *const v, double t)
Returns the traveltime on an edge without penalties.
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
weights: time range end
static const ROEdgeVector & getAllEdges()
Returns all ROEdges.
Definition: ROEdge.cpp:320
void inform(std::string msg, bool addType=true)
adds a new error to the list
Definition: MsgHandler.cpp:85
A storage for options typed value containers)
Definition: OptionsCont.h:99
double getNumLoaded() const
Returns the number of loaded vehicles.
Definition: ODMatrix.cpp:514
static void initRandGlobal(std::mt19937 *which=0)
Reads the given random number options and initialises the random number generator in accordance...
Definition: RandHelper.cpp:77
void applyCurve(const Distribution_Points &ps)
Splits the stored cells dividing them on the given time line.
Definition: ODMatrix.cpp:548
static double getNoiseEffort(const ROEdge *const edge, const ROVehicle *const veh, double time)
Definition: ROEdge.cpp:199
static void setGlobalOptions(const bool interpolate)
Definition: ROEdge.h:455
description of a vehicle
an aggreagated-output interval
static bool createDeviceByOption(const std::string &optionName, const std::string &rootElement="", const std::string &schemaFile="")
Creates the device using the output definition stored in the named option.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
std::string destination
Name of the destination district.
Definition: ODCell.h:72
bool closeTag()
Closes the most recently opened tag.
SUMOVTypeParameter * getVehicleTypeSecure(const std::string &id)
Retrieves the named vehicle type.
Definition: RONet.cpp:283
long long int SUMOTime
Definition: TraCIDefs.h:52
SUMOTime end
The end time this cell describes.
Definition: ODCell.h:66
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
void clear()
Clears information whether an error occured previously.
Definition: MsgHandler.cpp:145
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:201
static void initOutputOptions()
Definition: MsgHandler.cpp:193
A basic edge for routing applications.
Definition: ROMAEdge.h:65
static std::string _2str(const int var)
convert int to string
Definition: TplConvert.h:57
bool loadWeights(RONet &net, const std::string &optionName, const std::string &measure, const bool useLanes, const bool boundariesOverride)
Loads the net weights.
Definition: ROLoader.cpp:258
vehicles ignoring classes
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
An output device that encapsulates an ofstream.
static double getPenalizedTT(const ROEdge *const e, const ROVehicle *const v, double t)
Returns the traveltime on an edge including penalties.
Distribution_Points parseTimeLine(const std::vector< std::string > &def, bool timelineDayInHours)
split the given timeline
Definition: ODMatrix.cpp:624
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
bool isBinary() const
Returns whether we have a binary output.
Definition: OutputDevice.h:249
Computes the shortest path through a contracted network.
void setApplicationName(const std::string &appName, const std::string &fullName)
Sets the application name.