SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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-2015 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>
46 #include <router/ROLoader.h>
47 #include <router/RONet.h>
48 #include <router/ROEdge.h>
53 #include <utils/vehicle/CHRouter.h>
56 #include <utils/options/Option.h>
62 #include <utils/common/ToString.h>
63 #include <utils/xml/XMLSubSys.h>
65 #include <utils/options/Option.h>
68 #include <od/ODCell.h>
69 #include <od/ODDistrict.h>
70 #include <od/ODDistrictCont.h>
71 #include <od/ODDistrictHandler.h>
72 #include <od/ODMatrix.h>
74 
75 #include "ROMAFrame.h"
76 #include "ROMAAssignments.h"
77 #include "ROMAEdgeBuilder.h"
78 #include "ROMARouteHandler.h"
79 #include "ROMAEdge.h"
80 
81 #ifdef CHECK_MEMORY_LEAKS
82 #include <foreign/nvwa/debug_new.h>
83 #endif // CHECK_MEMORY_LEAKS
84 
85 
86 // ===========================================================================
87 // functions
88 // ===========================================================================
89 /* -------------------------------------------------------------------------
90  * data processing methods
91  * ----------------------------------------------------------------------- */
97 void
98 initNet(RONet& net, ROLoader& loader, OptionsCont& oc) {
99  // load the net
100  ROMAEdgeBuilder builder;
101  ROEdge::setGlobalOptions(oc.getBool("weights.expand"), oc.getBool("weights.expand"), oc.getBool("weights.interpolate"), false);
102  loader.loadNet(net, builder);
103  // load the weights when wished/available
104  if (oc.isSet("weight-files")) {
105  loader.loadWeights(net, "weight-files", oc.getString("weight-attribute"), false);
106  }
107  if (oc.isSet("lane-weight-files")) {
108  loader.loadWeights(net, "lane-weight-files", oc.getString("weight-attribute"), true);
109  }
110 }
111 
112 SUMOReal
113 getTravelTime(const ROEdge* const edge, const ROVehicle* const /* veh */, SUMOReal /* time */) {
114  return edge->getLength() / edge->getSpeed();
115 }
116 
117 
121 void
123  std::ofstream outFile(oc.getString("all-pairs-output").c_str(), std::ios::binary);
124  // build the router
126  Dijkstra router(net.getEdgeNo(), oc.getBool("ignore-errors"), &getTravelTime);
127  ConstROEdgeVector into;
128  const int numInternalEdges = net.getInternalEdgeNumber();
129  const int numTotalEdges = (int)net.getEdgeNo();
130  for (int i = numInternalEdges; i < numTotalEdges; i++) {
131  const Dijkstra::EdgeInfo& ei = router.getEdgeInfo(i);
132  if (ei.edge->getFunc() != ROEdge::ET_INTERNAL) {
133  router.compute(ei.edge, 0, 0, 0, into);
134  for (int j = numInternalEdges; j < numTotalEdges; j++) {
135  FileHelpers::writeFloat(outFile, router.getEdgeInfo(j).traveltime);
136  }
137  }
138  }
139 }
140 
141 
145 void
146 writeInterval(OutputDevice& dev, const SUMOTime begin, const SUMOTime end, const RONet& net, const ROVehicle* const veh) {
148  for (std::map<std::string, ROEdge*>::const_iterator i = net.getEdgeMap().begin(); i != net.getEdgeMap().end(); ++i) {
149  ROMAEdge* edge = static_cast<ROMAEdge*>(i->second);
150  if (edge->getFunc() == ROEdge::ET_NORMAL) {
152  dev.writeAttr("traveltime", edge->getTravelTime(veh, STEPS2TIME(begin)));
153  dev.writeAttr("entered", edge->getFlow(STEPS2TIME(begin))).closeTag();
154  }
155  }
156  dev.closeTag();
157 }
158 
159 
163 void
165  // build the router
167  const std::string measure = oc.getString("weight-attribute");
168  const std::string routingAlgorithm = oc.getString("routing-algorithm");
169  const SUMOTime begin = string2time(oc.getString("begin"));
170  const SUMOTime end = string2time(oc.getString("end"));
171  if (measure == "traveltime") {
172  if (routingAlgorithm == "dijkstra") {
173  if (net.hasPermissions()) {
174  if (oc.getInt("paths") > 1) {
176  net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedTT);
177  } else {
179  net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
180  }
181  } else {
182  if (oc.getInt("paths") > 1) {
184  net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedTT);
185  } else {
187  net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
188  }
189  }
190  } else if (routingAlgorithm == "astar") {
191  if (net.hasPermissions()) {
192  if (oc.getInt("paths") > 1) {
194  net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedTT);
195  } else {
197  net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
198  }
199  } else {
200  if (oc.getInt("paths") > 1) {
202  net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedTT);
203  } else {
205  net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
206  }
207  }
208  } else if (routingAlgorithm == "CH") {
209  const SUMOTime weightPeriod = (oc.isSet("weight-files") ?
210  string2time(oc.getString("weight-period")) :
212  if (net.hasPermissions()) {
214  net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, true);
215  } else {
217  net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, false);
218  }
219  } else if (routingAlgorithm == "CHWrapper") {
220  const SUMOTime weightPeriod = (oc.isSet("weight-files") ?
221  string2time(oc.getString("weight-period")) :
223 
225  net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, begin, weightPeriod);
226  } else {
227  throw ProcessError("Unknown routing Algorithm '" + routingAlgorithm + "'!");
228  }
229 
230  } else {
232  if (measure == "CO") {
233  op = &ROEdge::getEmissionEffort<PollutantsInterface::CO>;
234  } else if (measure == "CO2") {
235  op = &ROEdge::getEmissionEffort<PollutantsInterface::CO2>;
236  } else if (measure == "PMx") {
237  op = &ROEdge::getEmissionEffort<PollutantsInterface::PM_X>;
238  } else if (measure == "HC") {
239  op = &ROEdge::getEmissionEffort<PollutantsInterface::HC>;
240  } else if (measure == "NOx") {
241  op = &ROEdge::getEmissionEffort<PollutantsInterface::NO_X>;
242  } else if (measure == "fuel") {
243  op = &ROEdge::getEmissionEffort<PollutantsInterface::FUEL>;
244  } else if (measure == "noise") {
246  } else {
247  throw ProcessError("Unknown measure (weight attribute '" + measure + "')!");
248  }
249  if (net.hasPermissions()) {
250  if (oc.getInt("paths") > 1) {
253  } else {
255  net.getEdgeNo(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic);
256  }
257  } else {
258  if (oc.getInt("paths") > 1) {
261  } else {
263  net.getEdgeNo(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic);
264  }
265  }
266  }
267  // prepare the output
268  net.openOutput(oc.isSet("output-file") ? oc.getString("output-file") : "",
269  oc.isSet("flow-output") ? oc.getString("flow-output") : "", "");
270  // process route definitions
271  try {
272  if (oc.isSet("timeline")) {
273  matrix.applyCurve(matrix.parseTimeLine(oc.getStringVector("timeline"), oc.getBool("timeline.day-in-hours")));
274  }
275  ROVehicle defaultVehicle(SUMOVehicleParameter(), 0, net.getVehicleTypeSecure(DEFAULT_VTYPE_ID), &net);
276  ROMAAssignments a(begin, end, oc.getBool("timesplit"), net, matrix, *router);
277  a.resetFlows();
278  const std::string assignMethod = oc.getString("assignment-method");
279  if (assignMethod == "incremental") {
280  a.incremental(oc.getInt("max-iterations"));
281  } else if (assignMethod == "SUE") {
282  a.sue(oc.getInt("max-iterations"), oc.getInt("max-inner-iterations"),
283  oc.getInt("paths"), oc.getFloat("paths.penalty"), oc.getFloat("tolerance"), oc.getString("route-choice-method"));
284  }
285  // update path costs and output
286  bool haveOutput = false;
287  OutputDevice* dev = net.getRouteOutput();
288  if (dev != 0) {
289  for (std::vector<ODCell*>::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) {
290  const ODCell* const c = *i;
292  for (std::vector<RORoute*>::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) {
293  (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, begin));
294  (*j)->writeXMLDefinition(*dev, 0, true, false);
295  }
296  dev->closeTag();
297  }
298  haveOutput = true;
299  }
300  dev = net.getRouteOutput(true);
301  if (dev != 0) {
302  int num = 0;
303  for (std::vector<ODCell*>::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) {
304  const ODCell* const c = *i;
305  if (c->departures.empty()) {
306  dev->openTag(SUMO_TAG_FLOW).writeAttr(SUMO_ATTR_ID, oc.getString("prefix") + toString(num++));
309  matrix.writeDefaultAttrs(*dev, oc.getBool("ignore-vehicle-type"), c);
311  for (std::vector<RORoute*>::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) {
312  (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, string2time(oc.getString("begin"))));
313  (*j)->writeXMLDefinition(*dev, 0, true, false);
314  }
315  dev->closeTag();
316  dev->closeTag();
317  } else {
318  for (std::map<SUMOTime, std::vector<std::string> >::const_iterator deps = c->departures.begin(); deps != c->departures.end(); ++deps) {
319  const std::string routeDistId = c->origin + "_" + c->destination + "_" + time2string(c->begin) + "_" + time2string(c->end);
320  for (std::vector<std::string>::const_iterator id = deps->second.begin(); id != deps->second.end(); ++id) {
322  matrix.writeDefaultAttrs(*dev, oc.getBool("ignore-vehicle-type"), c);
324  for (std::vector<RORoute*>::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) {
325  (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, string2time(oc.getString("begin"))));
326  (*j)->writeXMLDefinition(*dev, 0, true, false);
327  }
328  dev->closeTag();
329  dev->closeTag();
330  }
331  }
332  }
333  }
334  haveOutput = true;
335  }
336  if (OutputDevice::createDeviceByOption("netload-output", "meandata")) {
337  if (oc.getBool("timesplit")) {
338  SUMOTime lastCell = 0;
339  for (std::vector<ODCell*>::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) {
340  if ((*i)->end > lastCell) {
341  lastCell = (*i)->end;
342  }
343  }
344  const SUMOTime interval = string2time(OptionsCont::getOptions().getString("aggregation-interval"));
345  for (SUMOTime start = begin; start < MIN2(end, lastCell); start += interval) {
346  writeInterval(OutputDevice::getDeviceByOption("netload-output"), start, start + interval, net, a.getDefaultVehicle());
347  }
348  } else {
349  writeInterval(OutputDevice::getDeviceByOption("netload-output"), begin, end, net, a.getDefaultVehicle());
350  }
351  haveOutput = true;
352  }
353  if (!haveOutput) {
354  throw ProcessError("No output file given.");
355  }
356  // end the processing
357  net.cleanup(router);
358  } catch (ProcessError&) {
359  net.cleanup(router);
360  throw;
361  }
362 }
363 
364 
365 /* -------------------------------------------------------------------------
366  * main
367  * ----------------------------------------------------------------------- */
368 int
369 main(int argc, char** argv) {
371  oc.setApplicationDescription("Import O/D-matrices for macroscopic traffic assignment");
372  oc.setApplicationName("marouter", "SUMO marouter Version " + getBuildName(VERSION_STRING));
373  int ret = 0;
374  RONet* net = 0;
375  try {
376  XMLSubSys::init();
378  OptionsIO::setArgs(argc, argv);
380  if (oc.processMetaOptions(argc < 2)) {
382  return 0;
383  }
384  XMLSubSys::setValidation(oc.getString("xml-validation"), oc.getString("xml-validation.net"));
386  if (!ROMAFrame::checkOptions()) {
387  throw ProcessError();
388  }
390  // load data
391  ROLoader loader(oc, false, false);
392  net = new RONet();
393  initNet(*net, loader, oc);
394  if (oc.isSet("all-pairs-output")) {
395  computeAllPairs(*net, oc);
396  if (net->getDistricts().empty()) {
397  delete net;
399  if (ret == 0) {
400  std::cout << "Success." << std::endl;
401  }
402  return ret;
403  }
404  }
405  if (net->getDistricts().empty()) {
406  throw ProcessError("No districts loaded.");
407  }
408  // load districts
409  ODDistrictCont districts;
410  districts.makeDistricts(net->getDistricts());
411  // load the matrix
412  ODMatrix matrix(districts);
413  matrix.loadMatrix(oc);
414  ROMARouteHandler handler(matrix);
415  matrix.loadRoutes(oc, handler);
416  if (matrix.getNoLoaded() == 0) {
417  throw ProcessError("No vehicles loaded.");
418  }
419  if (MsgHandler::getErrorInstance()->wasInformed() && !oc.getBool("ignore-errors")) {
420  throw ProcessError("Loading failed.");
421  }
423  WRITE_MESSAGE(toString(matrix.getNoLoaded()) + " vehicles loaded.");
424 
425  // build routes and parse the incremental rates if the incremental method is choosen.
426  try {
427  computeRoutes(*net, oc, matrix);
428  } catch (XERCES_CPP_NAMESPACE::SAXParseException& e) {
429  WRITE_ERROR(toString(e.getLineNumber()));
430  ret = 1;
431  } catch (XERCES_CPP_NAMESPACE::SAXException& e) {
432  WRITE_ERROR(TplConvert::_2str(e.getMessage()));
433  ret = 1;
434  }
435  if (MsgHandler::getErrorInstance()->wasInformed() || ret != 0) {
436  throw ProcessError();
437  }
438  } catch (const ProcessError& e) {
439  if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) {
440  WRITE_ERROR(e.what());
441  }
442  MsgHandler::getErrorInstance()->inform("Quitting (on error).", false);
443  ret = 1;
444  }
445 
446  delete net;
448  if (ret == 0) {
449  std::cout << "Success." << std::endl;
450  }
451  return ret;
452 }
453 
454 
455 
456 /****************************************************************************/
457 
SUMOReal getNoLoaded() const
Returns the number of loaded vehicles.
Definition: ODMatrix.cpp:465
Computes the shortest path through a contracted network.
Definition: CHRouter.h:74
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:257
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:636
static void init()
Initialises the xml-subsystem.
Definition: XMLSubSys.cpp:58
Computes the shortest path through a network using the Dijkstra algorithm.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
Definition: MsgHandler.cpp:80
long long int SUMOTime
Definition: SUMOTime.h:43
OutputDevice * getRouteOutput(const bool alternative=false)
Definition: RONet.h:414
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:146
SUMOReal getFlow(const SUMOReal time) const
Definition: ROMAEdge.h:93
assignment methods
size_t getEdgeNo() const
Returns the total number of edges the network contains including internal edges.
Definition: RONet.cpp:618
static SUMOReal getNoiseEffort(const ROEdge *const edge, const ROVehicle *const veh, SUMOReal time)
Definition: ROEdge.cpp:180
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
Definition: XMLSubSys.cpp:69
void initNet(RONet &net, ROLoader &loader, OptionsCont &oc)
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)
bool loadWeights(RONet &net, const std::string &optionName, const std::string &measure, bool useLanes)
Loads the net weights.
Definition: ROLoader.cpp:268
SUMOReal getTravelTime(const ROEdge *const edge, const ROVehicle *const , SUMOReal)
static std::ostream & writeFloat(std::ostream &strm, SUMOReal value)
Writes a float binary.
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:61
Computes the shortest path through a network using the A* algorithm.
Definition: AStarRouter.h:71
EdgeFunc getFunc() const
Returns the function of the edge.
Definition: ROEdge.h:186
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid for usage within duarouter...
Definition: ROMAFrame.cpp:284
void computeAllPairs(RONet &net, OptionsCont &oc)
An internal edge which models vehicles driving across a junction. This is currently not used for rout...
Definition: ROEdge.h:93
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:59
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.
Computes the shortest path through a network using the Dijkstra algorithm.
const std::map< std::string, ROEdge * > & getEdgeMap() const
Definition: RONet.cpp:630
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
Definition: OptionsIO.cpp:64
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:69
static void initRandGlobal(MTRand *which=0)
Reads the given random number options and initialises the random number generator in accordance...
Definition: RandHelper.cpp:68
void loadMatrix(OptionsCont &oc)
read a matrix in one of several formats
Definition: ODMatrix.cpp:511
void openOutput(const std::string &filename, const std::string altFilename, const std::string typeFilename)
Opens the output for computed routes.
Definition: RONet.cpp:207
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:60
A vehicle as used by router.
Definition: ROVehicle.h:60
#define max(a, b)
Definition: polyfonts.c:65
A single O/D-matrix cell.
Definition: ODCell.h:58
std::string origin
Name of the origin district.
Definition: ODCell.h:69
static SUMOReal getPenalizedTT(const ROEdge *const e, const ROVehicle *const v, SUMOReal t)
Returns the traveltime on an edge including penalties.
static std::string _2str(const E *const data)
Definition: TplConvert.h:56
An O/D (origin/destination) matrix.
Definition: ODMatrix.h:75
The data loader.
Definition: ROLoader.h:63
bool processMetaOptions(bool missingOptions)
Checks for help and configuration output, returns whether we should exit.
const std::string getBuildName(const std::string &version)
attach some build flags to the version string
Definition: StdDefs.cpp:88
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
void loadRoutes(OptionsCont &oc, SUMOSAXHandler &handler)
read SUMO routes
Definition: ODMatrix.cpp:557
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:48
A container for districts.
T MIN2(T a, T b)
Definition: StdDefs.h:68
SUMOReal vehicleNumber
The number of vehicles.
Definition: ODCell.h:60
std::map< SUMOTime, std::vector< std::string > > departures
mapping of departure times to departing vehicles, if already fixed
Definition: ODCell.h:81
void writeInterval(OutputDevice &dev, const SUMOTime begin, const SUMOTime end, const RONet &net, const ROVehicle *const veh)
#define VERSION_STRING
Definition: version.h:1
static SUMOReal getTravelTime(const ROEdge *const e, const ROVehicle *const v, SUMOReal t)
Returns the traveltime on an edge without penalties.
static void setGlobalOptions(bool useBoundariesOnOverrideTT, bool useBoundariesOnOverrideE, bool interpolate, bool isParallel)
Definition: ROEdge.h:401
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:53
static SUMOReal getPenalizedEffort(const ROEdge *const e, const ROVehicle *const v, SUMOReal t)
Returns the effort to pass an edge including penalties.
void computeRoutes(RONet &net, ROLoader &loader, OptionsCont &oc)
SUMOTime begin
The begin time this cell describes.
Definition: ODCell.h:63
virtual void loadNet(RONet &toFill, ROAbstractEdgeBuilder &eb)
Loads the network.
Definition: ROLoader.cpp:124
A basic edge for routing applications.
Definition: ROEdge.h:73
int getInternalEdgeNumber() const
Returns the number of internal edges the network contains.
Definition: RONet.cpp:624
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:205
static void fillOptions()
Inserts options used by duarouter into the OptionsCont-singleton.
Definition: ROMAFrame.cpp:57
static void getOptions()
Parses the command line arguments and loads the configuration.
Definition: OptionsIO.cpp:71
The router&#39;s network representation.
Definition: RONet.h:72
Structure representing possible vehicle parameter.
SUMOReal getLength() const
Returns the length of the edge.
Definition: ROEdge.h:194
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
void inform(std::string msg, bool addType=true)
adds a new error to the list
Definition: MsgHandler.cpp:89
A storage for options typed value containers)
Definition: OptionsCont.h:108
void applyCurve(const Distribution_Points &ps)
Splits the stored cells dividing them on the given time line.
Definition: ODMatrix.cpp:498
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
virtual SUMOReal recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime) const =0
std::string destination
Name of the destination district.
Definition: ODCell.h:72
bool closeTag()
Closes the most recently opened tag.
#define SUMOReal
Definition: config.h:215
SUMOVTypeParameter * getVehicleTypeSecure(const std::string &id)
Retrieves the named vehicle type.
Definition: RONet.cpp:252
SUMOReal getTravelTime(const ROVehicle *const veh, SUMOReal time) const
Returns the travel time for this edge.
Definition: ROEdge.cpp:156
A normal edge.
Definition: ROEdge.h:81
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:149
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:201
void cleanup(SUMOAbstractRouter< ROEdge, ROVehicle > *router)
closes the file output for computed routes and deletes routers and associated threads if necessary ...
Definition: RONet.cpp:226
static void initOutputOptions()
Definition: MsgHandler.cpp:197
A basic edge for routing applications.
Definition: ROMAEdge.h:65
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
Definition: ROEdge.h:209
vehicles ignoring classes
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Distribution_Points parseTimeLine(const std::vector< std::string > &def, bool timelineDayInHours)
split the given timeline
Definition: ODMatrix.cpp:574
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
Computes the shortest path through a contracted network.
static SUMOReal getTravelTimeStatic(const ROEdge *const edge, const ROVehicle *const veh, SUMOReal time)
Returns the travel time for the given edge.
Definition: ROEdge.h:357
int main(int argc, char *argv[])
void setApplicationName(const std::string &appName, const std::string &fullName)
Sets the application name.