Eclipse SUMO - Simulation of Urban MObility
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 
26 #include <utils/common/SUMOTime.h>
30 #include "RORoutable.h"
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class OptionsCont;
38 class RONet;
39 class ROVehicle;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
53 class ROLoader {
54 public:
61  ROLoader(OptionsCont& oc, const bool emptyDestinationsAllowed, const bool logSteps);
62 
63 
65  virtual ~ROLoader();
66 
68  virtual void loadNet(RONet& toFill, ROAbstractEdgeBuilder& eb);
69 
71  bool loadWeights(RONet& net, const std::string& optionName,
72  const std::string& measure, const bool useLanes, const bool boundariesOverride);
73 
75  void openRoutes(RONet& net);
76 
78  void processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment,
79  RONet& net, const RORouterProvider& provider);
80 
81 protected:
103  bool openTypedRoutes(const std::string& optionName, RONet& net, const bool readAll = false);
104 
105 
112  public:
115 
118 
127  void addEdgeWeight(const std::string& id,
128  double val, double beg, double end) const;
129 
130  private:
133 
134  };
135 
136 
143  public:
146 
149 
158  void addEdgeWeight(const std::string& id,
159  double val, double beg, double end) const;
160 
161  private:
164 
165  };
166 
167 
168 
169 protected:
170  void writeStats(const SUMOTime time, const SUMOTime start, const SUMOTime absNo, bool endGiven);
171 
172 
173 private:
176 
179 
181  const bool myLogSteps;
182 
185 
186 
187 private:
189  ROLoader(const ROLoader& src);
190 
193 };
long long int SUMOTime
Definition: GUI.h:35
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:142
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:163
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:145
Obtains edge weights from a weights handler and stores them within the edges.
Definition: ROLoader.h:111
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:114
RONet & myNet
The network edges shall be obtained from.
Definition: ROLoader.h:132
The data loader.
Definition: ROLoader.h:53
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
bool openTypedRoutes(const std::string &optionName, RONet &net, const bool readAll=false)
Opens route handler of the given type.
Definition: ROLoader.cpp:225
ROLoader & operator=(const ROLoader &src)
Invalidated assignment operator.
SUMORouteLoaderControl myLoaders
List of route loaders.
Definition: ROLoader.h:184
ROLoader(const ROLoader &src)
Invalidated copy constructor.
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
ROLoader(OptionsCont &oc, const bool emptyDestinationsAllowed, const bool logSteps)
Constructor.
Definition: ROLoader.cpp:95
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:181
OptionsCont & myOptions
Options to use.
Definition: ROLoader.h:175
const bool myEmptyDestinationsAllowed
Information whether empty destinations are allowed.
Definition: ROLoader.h:178
The router's network representation.
Definition: RONet.h:62
A vehicle as used by router.
Definition: ROVehicle.h:50
Interface for a class which obtains read weights for named edges.