Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
ROLoader.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2002-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
21// Loader for networks and route imports
22/****************************************************************************/
23#pragma once
24#include <config.h>
25
30#include "RORoutable.h"
31
32
33// ===========================================================================
34// class declarations
35// ===========================================================================
36class OptionsCont;
38class RONet;
39class ROVehicle;
41
42
43// ===========================================================================
44// class definitions
45// ===========================================================================
54class ROLoader {
55public:
62 ROLoader(OptionsCont& oc, const bool emptyDestinationsAllowed, const bool logSteps);
63
64
66 virtual ~ROLoader();
67
69 virtual void loadNet(RONet& toFill, ROAbstractEdgeBuilder& eb);
70
72 bool loadWeights(RONet& net, const std::string& optionName,
73 const std::string& measure, const bool useLanes, const bool boundariesOverride);
74
76 void openRoutes(RONet& net);
77
79 void processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment,
80 RONet& net, const RORouterProvider& provider);
81
83
84protected:
106 bool openTypedRoutes(const std::string& optionName, RONet& net, const bool readAll = false);
107
108
115 public:
118
121
130 void addEdgeWeight(const std::string& id,
131 double val, double beg, double end) const;
132
133 private:
136
137 };
138
139
146 public:
149
152
161 void addEdgeWeight(const std::string& id,
162 double val, double beg, double end) const;
163
164 private:
167
168 };
169
170
171
172protected:
173 void writeStats(const SUMOTime time, const SUMOTime start, const SUMOTime absNo, bool endGiven);
174
175
176private:
179
182
184 const bool myLogSteps;
185
188
189
190private:
192 ROLoader(const ROLoader& src);
193
196};
long long int SUMOTime
Definition GUI.h:36
A storage for options typed value containers)
Definition OptionsCont.h:89
Interface for building instances of router-edges.
Obtains edge travel times from a weights handler and stores them within the edges.
Definition ROLoader.h:145
RONet & myNet
The network edges shall be obtained from.
Definition ROLoader.h:166
void addEdgeWeight(const std::string &id, double val, double beg, double end) const
Adds a travel time for a given edge and time period.
Definition ROLoader.cpp:54
EdgeFloatTimeLineRetriever_EdgeTravelTime(RONet &net)
Constructor.
Definition ROLoader.h:148
Obtains edge weights from a weights handler and stores them within the edges.
Definition ROLoader.h:114
void addEdgeWeight(const std::string &id, double val, double beg, double end) const
Adds an effort for a given edge and time period.
Definition ROLoader.cpp:75
EdgeFloatTimeLineRetriever_EdgeWeight(RONet &net)
Constructor.
Definition ROLoader.h:117
RONet & myNet
The network edges shall be obtained from.
Definition ROLoader.h:135
The data loader.
Definition ROLoader.h:54
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:254
ROLoader & operator=(const ROLoader &src)
Invalidated assignment operator.
bool openTypedRoutes(const std::string &optionName, RONet &net, const bool readAll=false)
Opens route handler of the given type.
Definition ROLoader.cpp:225
SUMORouteLoaderControl myLoaders
List of route loaders.
Definition ROLoader.h:187
ROLoader(const ROLoader &src)
Invalidated copy constructor.
SUMORouteHandler * getRouteHandler()
Definition ROLoader.cpp:308
void processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment, RONet &net, const RORouterProvider &provider)
Loads routes from all previously build route loaders.
Definition ROLoader.cpp:193
virtual ~ROLoader()
Destructor.
Definition ROLoader.cpp:103
virtual void loadNet(RONet &toFill, ROAbstractEdgeBuilder &eb)
Loads the network.
Definition ROLoader.cpp:108
void writeStats(const SUMOTime time, const SUMOTime start, const SUMOTime absNo, bool endGiven)
Definition ROLoader.cpp:296
void openRoutes(RONet &net)
Builds and opens all route loaders.
Definition ROLoader.cpp:163
const bool myLogSteps
Information whether the routing steps should be logged.
Definition ROLoader.h:184
OptionsCont & myOptions
Options to use.
Definition ROLoader.h:178
const bool myEmptyDestinationsAllowed
Information whether empty destinations are allowed.
Definition ROLoader.h:181
The router's network representation.
Definition RONet.h:63
A vehicle as used by router.
Definition ROVehicle.h:50
Interface for a class which obtains read weights for named edges.
Parser for routes during their loading.