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-2016 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>
53 #include <utils/options/Option.h>
60 #include <utils/vehicle/CHRouter.h>
62 #include <utils/xml/XMLSubSys.h>
63 #include <od/ODCell.h>
64 #include <od/ODDistrict.h>
65 #include <od/ODDistrictCont.h>
66 #include <od/ODDistrictHandler.h>
67 #include <od/ODMatrix.h>
68 #include <router/ROEdge.h>
69 #include <router/ROLoader.h>
70 #include <router/RONet.h>
71 #include <router/RORoute.h>
72 #include <router/RORoutable.h>
73 
74 #include "ROMAFrame.h"
75 #include "ROMAAssignments.h"
76 #include "ROMAEdgeBuilder.h"
77 #include "ROMARouteHandler.h"
78 #include "ROMAEdge.h"
79 
80 #ifdef CHECK_MEMORY_LEAKS
81 #include <foreign/nvwa/debug_new.h>
82 #endif // CHECK_MEMORY_LEAKS
83 
84 
85 // ===========================================================================
86 // functions
87 // ===========================================================================
88 /* -------------------------------------------------------------------------
89  * data processing methods
90  * ----------------------------------------------------------------------- */
96 void
97 initNet(RONet& net, ROLoader& loader, OptionsCont& oc) {
98  // load the net
99  ROMAEdgeBuilder builder;
100  ROEdge::setGlobalOptions(oc.getBool("weights.interpolate"));
101  loader.loadNet(net, builder);
102  // initialize the travel times
103  /* const SUMOTime begin = string2time(oc.getString("begin"));
104  const SUMOTime end = string2time(oc.getString("end"));
105  for (std::map<std::string, ROEdge*>::const_iterator i = net.getEdgeMap().begin(); i != net.getEdgeMap().end(); ++i) {
106  (*i).second->addTravelTime(STEPS2TIME(begin), STEPS2TIME(end), (*i).second->getLength() / (*i).second->getSpeed());
107  }*/
108  // load the weights when wished/available
109  if (oc.isSet("weight-files")) {
110  loader.loadWeights(net, "weight-files", oc.getString("weight-attribute"), false, oc.getBool("weights.expand"));
111  }
112  if (oc.isSet("lane-weight-files")) {
113  loader.loadWeights(net, "lane-weight-files", oc.getString("weight-attribute"), true, oc.getBool("weights.expand"));
114  }
115 }
116 
117 SUMOReal
118 getTravelTime(const ROEdge* const edge, const ROVehicle* const /* veh */, SUMOReal /* time */) {
119  return edge->getLength() / edge->getSpeed();
120 }
121 
122 
126 void
128  std::ofstream outFile(oc.getString("all-pairs-output").c_str(), std::ios::binary);
129  // build the router
131  Dijkstra router(ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &getTravelTime);
132  ConstROEdgeVector into;
133  const int numInternalEdges = net.getInternalEdgeNumber();
134  const int numTotalEdges = (int)net.getEdgeNo();
135  for (int i = numInternalEdges; i < numTotalEdges; i++) {
136  const Dijkstra::EdgeInfo& ei = router.getEdgeInfo(i);
137  if (ei.edge->getFunc() != ROEdge::ET_INTERNAL) {
138  router.compute(ei.edge, 0, 0, 0, into);
139  for (int j = numInternalEdges; j < numTotalEdges; j++) {
140  FileHelpers::writeFloat(outFile, router.getEdgeInfo(j).traveltime);
141  }
142  }
143  }
144 }
145 
146 
150 void
151 writeInterval(OutputDevice& dev, const SUMOTime begin, const SUMOTime end, const RONet& net, const ROVehicle* const veh) {
153  for (std::map<std::string, ROEdge*>::const_iterator i = net.getEdgeMap().begin(); i != net.getEdgeMap().end(); ++i) {
154  ROMAEdge* edge = static_cast<ROMAEdge*>(i->second);
155  if (edge->getFunc() == ROEdge::ET_NORMAL) {
157  const SUMOReal traveltime = edge->getTravelTime(veh, STEPS2TIME(begin));
158  const SUMOReal flow = edge->getFlow(STEPS2TIME(begin));
159  dev.writeAttr("traveltime", traveltime);
160  dev.writeAttr("speed", edge->getLength() / traveltime);
161  dev.writeAttr("entered", flow);
162  dev.writeAttr("flowCapacityRatio", 100. * flow / ROMAAssignments::getCapacity(edge));
163  dev.closeTag();
164  }
165  }
166  dev.closeTag();
167 }
168 
169 
173 void
175  // build the router
177  const std::string measure = oc.getString("weight-attribute");
178  const std::string routingAlgorithm = oc.getString("routing-algorithm");
179  const SUMOTime begin = string2time(oc.getString("begin"));
180  const SUMOTime end = string2time(oc.getString("end"));
181  if (measure == "traveltime") {
182  if (routingAlgorithm == "dijkstra") {
183  if (net.hasPermissions()) {
184  if (oc.getInt("paths") > 1) {
187  } else {
189  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
190  }
191  } else {
192  if (oc.getInt("paths") > 1) {
195  } else {
197  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
198  }
199  }
200  } else if (routingAlgorithm == "astar") {
201  if (net.hasPermissions()) {
202  if (oc.getInt("paths") > 1) {
205  } else {
207  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
208  }
209  } else {
210  if (oc.getInt("paths") > 1) {
213  } else {
215  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
216  }
217  }
218  } else if (routingAlgorithm == "CH") {
219  const SUMOTime weightPeriod = (oc.isSet("weight-files") ?
220  string2time(oc.getString("weight-period")) :
222  if (net.hasPermissions()) {
224  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, true);
225  } else {
227  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, false);
228  }
229  } else if (routingAlgorithm == "CHWrapper") {
230  const SUMOTime weightPeriod = (oc.isSet("weight-files") ?
231  string2time(oc.getString("weight-period")) :
233 
235  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, begin, weightPeriod);
236  } else {
237  throw ProcessError("Unknown routing Algorithm '" + routingAlgorithm + "'!");
238  }
239 
240  } else {
242  if (measure == "CO") {
243  op = &ROEdge::getEmissionEffort<PollutantsInterface::CO>;
244  } else if (measure == "CO2") {
245  op = &ROEdge::getEmissionEffort<PollutantsInterface::CO2>;
246  } else if (measure == "PMx") {
247  op = &ROEdge::getEmissionEffort<PollutantsInterface::PM_X>;
248  } else if (measure == "HC") {
249  op = &ROEdge::getEmissionEffort<PollutantsInterface::HC>;
250  } else if (measure == "NOx") {
251  op = &ROEdge::getEmissionEffort<PollutantsInterface::NO_X>;
252  } else if (measure == "fuel") {
253  op = &ROEdge::getEmissionEffort<PollutantsInterface::FUEL>;
254  } else if (measure == "electricity") {
255  op = &ROEdge::getEmissionEffort<PollutantsInterface::ELEC>;
256  } else if (measure == "noise") {
258  } else {
259  throw ProcessError("Unknown measure (weight attribute '" + measure + "')!");
260  }
261  if (net.hasPermissions()) {
262  if (oc.getInt("paths") > 1) {
265  } else {
267  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic);
268  }
269  } else {
270  if (oc.getInt("paths") > 1) {
273  } else {
275  ROEdge::getAllEdges(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic);
276  }
277  }
278  }
279  try {
280  // prepare the output
281  net.openOutput(oc.isSet("output-file") ? oc.getString("output-file") : "", "", "");
282  // process route definitions
283  if (oc.isSet("timeline")) {
284  matrix.applyCurve(matrix.parseTimeLine(oc.getStringVector("timeline"), oc.getBool("timeline.day-in-hours")));
285  }
286  matrix.sortByBeginTime();
287  ROVehicle defaultVehicle(SUMOVehicleParameter(), 0, net.getVehicleTypeSecure(DEFAULT_VTYPE_ID), &net);
288  ROMAAssignments a(begin, end, oc.getBool("additive-traffic"), oc.getFloat("weight-adaption"), net, matrix, *router);
289  a.resetFlows();
290 #ifdef HAVE_FOX
291  const RORouterProvider provider(router, 0, 0);
292  const int maxNumThreads = oc.getInt("routing-threads");
293  while ((int)net.getThreadPool().size() < maxNumThreads) {
294  new RONet::WorkerThread(net.getThreadPool(), provider);
295  }
296 #endif
297  const std::string assignMethod = oc.getString("assignment-method");
298  if (assignMethod == "incremental") {
299  a.incremental(oc.getInt("max-iterations"), oc.getBool("verbose"));
300  } else if (assignMethod == "SUE") {
301  a.sue(oc.getInt("max-iterations"), oc.getInt("max-inner-iterations"),
302  oc.getInt("paths"), oc.getFloat("paths.penalty"), oc.getFloat("tolerance"), oc.getString("route-choice-method"));
303  }
304  // update path costs and output
305  bool haveOutput = false;
306  OutputDevice* dev = net.getRouteOutput();
307  if (dev != 0) {
308  int num = 0;
309  for (std::vector<ODCell*>::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) {
310  const ODCell* const c = *i;
311  if (c->departures.empty()) {
312  dev->openTag(SUMO_TAG_FLOW).writeAttr(SUMO_ATTR_ID, oc.getString("prefix") + toString(num++));
315  matrix.writeDefaultAttrs(*dev, oc.getBool("ignore-vehicle-type"), c);
317  for (std::vector<RORoute*>::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) {
318  (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, string2time(oc.getString("begin"))));
319  (*j)->writeXMLDefinition(*dev, 0, true, false);
320  }
321  dev->closeTag();
322  dev->closeTag();
323  } else {
324  for (std::map<SUMOTime, std::vector<std::string> >::const_iterator deps = c->departures.begin(); deps != c->departures.end(); ++deps) {
325  const std::string routeDistId = c->origin + "_" + c->destination + "_" + time2string(c->begin) + "_" + time2string(c->end);
326  for (std::vector<std::string>::const_iterator id = deps->second.begin(); id != deps->second.end(); ++id) {
328  matrix.writeDefaultAttrs(*dev, oc.getBool("ignore-vehicle-type"), c);
330  for (std::vector<RORoute*>::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) {
331  (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, string2time(oc.getString("begin"))));
332  (*j)->writeXMLDefinition(*dev, 0, true, false);
333  }
334  dev->closeTag();
335  dev->closeTag();
336  }
337  }
338  }
339  }
340  haveOutput = true;
341  }
342  if (OutputDevice::createDeviceByOption("netload-output", "meandata")) {
343  if (oc.getBool("additive-traffic")) {
344  writeInterval(OutputDevice::getDeviceByOption("netload-output"), begin, end, net, a.getDefaultVehicle());
345  } else {
346  SUMOTime lastCell = 0;
347  for (std::vector<ODCell*>::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) {
348  if ((*i)->end > lastCell) {
349  lastCell = (*i)->end;
350  }
351  }
352  const SUMOTime interval = string2time(OptionsCont::getOptions().getString("aggregation-interval"));
353  for (SUMOTime start = begin; start < MIN2(end, lastCell); start += interval) {
354  writeInterval(OutputDevice::getDeviceByOption("netload-output"), start, start + interval, net, a.getDefaultVehicle());
355  }
356  }
357  haveOutput = true;
358  }
359  if (!haveOutput) {
360  throw ProcessError("No output file given.");
361  }
362  // end the processing
363  net.cleanup();
364  } catch (ProcessError&) {
365  net.cleanup();
366  throw;
367  }
368 }
369 
370 
371 /* -------------------------------------------------------------------------
372  * main
373  * ----------------------------------------------------------------------- */
374 int
375 main(int argc, char** argv) {
377  oc.setApplicationDescription("Import O/D-matrices for macroscopic traffic assignment");
378  oc.setApplicationName("marouter", "SUMO marouter Version " VERSION_STRING);
379  int ret = 0;
380  RONet* net = 0;
381  try {
382  XMLSubSys::init();
384  OptionsIO::setArgs(argc, argv);
386  if (oc.processMetaOptions(argc < 2)) {
388  return 0;
389  }
390  XMLSubSys::setValidation(oc.getString("xml-validation"), oc.getString("xml-validation.net"));
392  if (!ROMAFrame::checkOptions()) {
393  throw ProcessError();
394  }
396  // load data
397  ROLoader loader(oc, false, false);
398  net = new RONet();
399  initNet(*net, loader, oc);
400  if (oc.isSet("all-pairs-output")) {
401  computeAllPairs(*net, oc);
402  if (net->getDistricts().empty()) {
403  delete net;
405  if (ret == 0) {
406  std::cout << "Success." << std::endl;
407  }
408  return ret;
409  }
410  }
411  if (net->getDistricts().empty()) {
412  throw ProcessError("No districts loaded.");
413  }
414  // load districts
415  ODDistrictCont districts;
416  districts.makeDistricts(net->getDistricts());
417  // load the matrix
418  ODMatrix matrix(districts);
419  matrix.loadMatrix(oc);
420  ROMARouteHandler handler(matrix);
421  matrix.loadRoutes(oc, handler);
422  if (matrix.getNoLoaded() == 0) {
423  throw ProcessError("No vehicles loaded.");
424  }
425  if (MsgHandler::getErrorInstance()->wasInformed() && !oc.getBool("ignore-errors")) {
426  throw ProcessError("Loading failed.");
427  }
429  WRITE_MESSAGE(toString(matrix.getNoLoaded()) + " vehicles loaded.");
430 
431  // build routes and parse the incremental rates if the incremental method is choosen.
432  try {
433  computeRoutes(*net, oc, matrix);
434  } catch (XERCES_CPP_NAMESPACE::SAXParseException& e) {
435  WRITE_ERROR(toString(e.getLineNumber()));
436  ret = 1;
437  } catch (XERCES_CPP_NAMESPACE::SAXException& e) {
438  WRITE_ERROR(TplConvert::_2str(e.getMessage()));
439  ret = 1;
440  }
441  if (MsgHandler::getErrorInstance()->wasInformed() || ret != 0) {
442  throw ProcessError();
443  }
444  } catch (const ProcessError& e) {
445  if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) {
446  WRITE_ERROR(e.what());
447  }
448  MsgHandler::getErrorInstance()->inform("Quitting (on error).", false);
449  ret = 1;
450  }
451 
452  delete net;
454  if (ret == 0) {
455  std::cout << "Success." << std::endl;
456  }
457  return ret;
458 }
459 
460 
461 
462 /****************************************************************************/
463 
SUMOReal getNoLoaded() const
Returns the number of loaded vehicles.
Definition: ODMatrix.cpp:468
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:658
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:432
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)
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:613
static SUMOReal getNoiseEffort(const ROEdge *const edge, const ROVehicle *const veh, SUMOReal time)
Definition: ROEdge.cpp:183
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
Definition: XMLSubSys.cpp:69
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)
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:59
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:190
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid for usage within duarouter...
Definition: ROMAFrame.cpp:290
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:97
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:62
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:625
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
Definition: OptionsIO.cpp:65
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:514
void openOutput(const std::string &filename, const std::string altFilename, const std::string typeFilename)
Opens the output for computed routes.
Definition: RONet.cpp:212
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:65
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:231
#define max(a, b)
Definition: polyfonts.c:65
A single O/D-matrix cell.
Definition: ODCell.h:58
void initNet(RONet &net, ROLoader &loader, OptionsCont &oc)
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.
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
void loadRoutes(OptionsCont &oc, SUMOSAXHandler &handler)
read SUMO routes
Definition: ODMatrix.cpp:560
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:46
A container for districts.
T MIN2(T a, T b)
Definition: StdDefs.h:69
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)
void sortByBeginTime()
Definition: ODMatrix.cpp:607
static SUMOReal getTravelTime(const ROEdge *const e, const ROVehicle *const v, SUMOReal t)
Returns the traveltime on an edge without penalties.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:54
static SUMOReal getPenalizedEffort(const ROEdge *const e, const ROVehicle *const v, SUMOReal t)
Returns the effort to pass an edge including penalties.
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:77
int getInternalEdgeNumber() const
Returns the number of internal edges the network contains.
Definition: RONet.cpp:619
#define VERSION_STRING
Definition: config.h:225
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:206
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:72
static SUMOReal getCapacity(const ROEdge *edge)
The router&#39;s network representation.
Definition: RONet.h:76
Structure representing possible vehicle parameter.
SUMOReal getLength() const
Returns the length of the edge.
Definition: ROEdge.h:198
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
static const ROEdgeVector & getAllEdges()
Returns all ROEdges.
Definition: ROEdge.cpp:282
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:501
static void setGlobalOptions(const bool interpolate)
Definition: ROEdge.h:413
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:213
SUMOVTypeParameter * getVehicleTypeSecure(const std::string &id)
Retrieves the named vehicle type.
Definition: RONet.cpp:255
SUMOReal getTravelTime(const ROVehicle *const veh, SUMOReal time) const
Returns the travel time for this edge.
Definition: ROEdge.cpp:159
A normal edge.
Definition: ROEdge.h:85
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
static void initOutputOptions()
Definition: MsgHandler.cpp:197
A basic edge for routing applications.
Definition: ROMAEdge.h:65
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:268
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
Definition: ROEdge.h:213
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:577
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:369
void setApplicationName(const std::string &appName, const std::string &fullName)
Sets the application name.