36 #include <xercesc/sax/SAXException.hpp> 37 #include <xercesc/sax/SAXParseException.hpp> 84 if (oc.
isSet(
"weight-files")) {
87 if (oc.
isSet(
"lane-weight-files")) {
103 const std::string measure = oc.
getString(
"weight-attribute");
104 const std::string routingAlgorithm = oc.
getString(
"routing-algorithm");
107 if (measure ==
"traveltime") {
108 if (routingAlgorithm ==
"dijkstra") {
116 }
else if (routingAlgorithm ==
"astar") {
119 const AStar::LookupTable* lookup = 0;
120 if (oc.
isSet(
"astar.all-distances")) {
122 }
else if (oc.
isSet(
"astar.landmark-distances")) {
125 begin, end, std::numeric_limits<int>::max(), 1);
128 oc.
isSet(
"astar.save-landmark-distances") ? oc.
getString(
"astar.save-landmark-distances") :
"", oc.
getInt(
"routing-threads"));
133 const AStar::LookupTable* lookup = 0;
134 if (oc.
isSet(
"astar.all-distances")) {
136 }
else if (oc.
isSet(
"astar.landmark-distances")) {
139 begin, end, std::numeric_limits<int>::max(), 1);
142 oc.
isSet(
"astar.save-landmark-distances") ? oc.
getString(
"astar.save-landmark-distances") :
"", oc.
getInt(
"routing-threads"));
146 }
else if (routingAlgorithm ==
"CH") {
149 std::numeric_limits<int>::max());
157 }
else if (routingAlgorithm ==
"CHWrapper") {
160 std::numeric_limits<int>::max());
163 begin, end, weightPeriod, oc.
getInt(
"routing-threads"));
165 throw ProcessError(
"Unknown routing Algorithm '" + routingAlgorithm +
"'!");
169 if (measure ==
"CO") {
170 op = &ROEdge::getEmissionEffort<PollutantsInterface::CO>;
171 }
else if (measure ==
"CO2") {
172 op = &ROEdge::getEmissionEffort<PollutantsInterface::CO2>;
173 }
else if (measure ==
"PMx") {
174 op = &ROEdge::getEmissionEffort<PollutantsInterface::PM_X>;
175 }
else if (measure ==
"HC") {
176 op = &ROEdge::getEmissionEffort<PollutantsInterface::HC>;
177 }
else if (measure ==
"NOx") {
178 op = &ROEdge::getEmissionEffort<PollutantsInterface::NO_X>;
179 }
else if (measure ==
"fuel") {
180 op = &ROEdge::getEmissionEffort<PollutantsInterface::FUEL>;
181 }
else if (measure ==
"electricity") {
182 op = &ROEdge::getEmissionEffort<PollutantsInterface::ELEC>;
183 }
else if (measure ==
"noise") {
186 throw ProcessError(
"Unknown measure (weight attribute '" + measure +
"')!");
197 for (
const std::string& opt : oc.
getStringVector(
"persontrip.transfer.car-walk")) {
198 if (opt ==
"parkingAreas") {
200 }
else if (opt ==
"ptStops") {
202 }
else if (opt ==
"allJunctions") {
255 }
catch (XERCES_CPP_NAMESPACE::SAXParseException& e) {
258 }
catch (XERCES_CPP_NAMESPACE::SAXException& e) {
266 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
272 }
catch (
const std::exception& e) {
273 if (std::string(e.what()) != std::string(
"")) {
286 std::cout <<
"Success." << std::endl;
Computes the shortest path through a contracted network.
IntermodalRouter< E, L, N, V > & getIntermodalRouter() const
static void init()
Initialises the xml-subsystem.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
static void getOptions(const bool commandLineOnly=false)
Parses the command line arguments and loads the configuration.
int main(int argc, char **argv)
void writeIntermodal(const OptionsCont &options, ROIntermodalRouter &router) const
Writes the intermodal network and weights if requested.
void openRoutes(RONet &net)
Builds and opens all route loaders.
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid for usage within duarouter...
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
void initNet(RONet &net, ROLoader &loader, OptionsCont &oc)
static void adaptIntermodalRouter(ROIntermodalRouter &router)
void setApplicationDescription(const std::string &appDesc)
Sets the application description.
Computes the shortest path through a network using the A* algorithm.
bool hasPermissions() const
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const std::string DEFAULT_VTYPE_ID
static void close()
Closes all of an applications subsystems.
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
IntermodalRouter< ROEdge, ROLane, RONode, ROVehicle > ROIntermodalRouter
static OptionsCont & getOptions()
Retrieves the options.
Interface for building instances of duarouter-edges.
void openOutput(const OptionsCont &options)
Opens the output for computed routes.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
A vehicle as used by router.
static void fillOptions()
Inserts options used by duarouter into the OptionsCont-singleton.
void cleanup()
closes the file output for computed routes and deletes associated threads if necessary ...
static double getTravelTimeStatic(const ROEdge *const edge, const ROVehicle *const veh, double time)
Returns the travel time for the given edge.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Computes the shortest path through a network using the Dijkstra algorithm.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool processMetaOptions(bool missingOptions)
Checks for help and configuration output, returns whether we should exit.
SUMOTime string2time(const std::string &r)
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) ...
void computeRoutes(RONet &net, ROLoader &loader, OptionsCont &oc)
public transport stops and access
virtual void loadNet(RONet &toFill, ROAbstractEdgeBuilder &eb)
Loads the network.
The router's network representation.
Structure representing possible vehicle parameter.
static const ROEdgeVector & getAllEdges()
Returns all ROEdges.
void processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment, RONet &net, const RORouterProvider &provider)
Loads routes from all previously build route loaders.
void inform(std::string msg, bool addType=true)
adds a new error to the list
A storage for options typed value containers)
static void initRandGlobal(std::mt19937 *which=0)
Reads the given random number options and initialises the random number generator in accordance...
static double getNoiseEffort(const ROEdge *const edge, const ROVehicle *const veh, double time)
static void setGlobalOptions(const bool interpolate)
SUMOVTypeParameter * getVehicleTypeSecure(const std::string &id)
Retrieves the named vehicle type.
static void initOutputOptions()
static std::string _2str(const int var)
convert int to string
bool loadWeights(RONet &net, const std::string &optionName, const std::string &measure, const bool useLanes, const bool boundariesOverride)
Loads the net weights.
junctions with edges allowing the additional mode
vehicles ignoring classes
Computes the shortest path through a contracted network.
void setApplicationName(const std::string &appName, const std::string &fullName)
Sets the application name.