SUMO - Simulation of Urban MObility
ROMAAssignments.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Assignment methods
18 /****************************************************************************/
19 #ifndef ROMAAssignments_h
20 #define ROMAAssignments_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
29 #include <utils/common/SUMOTime.h>
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
34 class RONet;
35 class ODMatrix;
37 class ROEdge;
38 class ROMAEdge;
39 class ROVehicle;
40 
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
52 public:
54  ROMAAssignments(const SUMOTime begin, const SUMOTime end, const bool additiveTraffic,
55  const double adaptionFactor, RONet& net, ODMatrix& matrix, SUMOAbstractRouter<ROEdge, ROVehicle>& router);
56 
59 
61  return myDefaultVehicle;
62  }
63 
64  // @brief calculate edge capacity for the given edge
65  static double getCapacity(const ROEdge* edge);
66 
67  // @brief calculate edge travel time for the given edge and number of vehicles per hour
68  double capacityConstraintFunction(const ROEdge* edge, const double flow) const;
69 
70  // @brief clear effort storage
71  void resetFlows();
72 
73  // @brief incremental method
74  void incremental(const int numIter, const bool verbose);
75 
76  // @brief UE method
77  void ue();
78 
79  // @brief SUE method
80  void sue(const int maxOuterIteration, const int maxInnerIteration, const int kPaths, const double penalty, const double tolerance, const std::string routeChoiceMethod);
81 
93  static double getPenalizedEffort(const ROEdge* const e, const ROVehicle* const v, double t);
94 
106  static double getPenalizedTT(const ROEdge* const e, const ROVehicle* const v, double t);
107 
119  static double getTravelTime(const ROEdge* const e, const ROVehicle* const v, double t);
120 
121 private:
123  bool addRoute(ConstROEdgeVector& edges, std::vector<RORoute*>& paths, std::string routeId, double prob);
124 
126  void getKPaths(const int kPaths, const double penalty);
127 
128 private:
131  const bool myAdditiveTraffic;
132  const double myAdaptionFactor;
136  static std::map<const ROEdge* const, double> myPenalties;
138 
139 #ifdef HAVE_FOX
140 private:
141  class RoutingTask : public FXWorkerThread::Task {
142  public:
143  RoutingTask(ROMAAssignments& assign, ODCell* c, const SUMOTime begin, const double linkFlow)
144  : myAssign(assign), myCell(c), myBegin(begin), myLinkFlow(linkFlow) {}
145  void run(FXWorkerThread* context);
146  private:
147  ROMAAssignments& myAssign;
148  ODCell* const myCell;
149  const SUMOTime myBegin;
150  const double myLinkFlow;
151  private:
153  RoutingTask& operator=(const RoutingTask&);
154  };
155 #endif
156 
157 
158 private:
161 
162 };
163 
164 #endif
SUMOAbstractRouter< ROEdge, ROVehicle > & myRouter
long long int SUMOTime
Definition: SUMOTime.h:36
void getKPaths(const int kPaths, const double penalty)
get the k shortest paths
assignment methods
void incremental(const int numIter, const bool verbose)
const SUMOTime myBegin
static std::map< const ROEdge *const, double > myPenalties
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:56
const bool myAdditiveTraffic
const double myAdaptionFactor
const SUMOTime myEnd
ROMAAssignments(const SUMOTime begin, const SUMOTime end, const bool additiveTraffic, const double adaptionFactor, RONet &net, ODMatrix &matrix, SUMOAbstractRouter< ROEdge, ROVehicle > &router)
Constructor.
A vehicle as used by router.
Definition: ROVehicle.h:53
A single O/D-matrix cell.
Definition: ODCell.h:51
An O/D (origin/destination) matrix.
Definition: ODMatrix.h:69
~ROMAAssignments()
Destructor.
static double getCapacity(const ROEdge *edge)
A basic edge for routing applications.
Definition: ROEdge.h:72
double capacityConstraintFunction(const ROEdge *edge, const double flow) const
static double getPenalizedEffort(const ROEdge *const e, const ROVehicle *const v, double t)
Returns the effort to pass an edge including penalties.
The router&#39;s network representation.
Definition: RONet.h:68
bool addRoute(ConstROEdgeVector &edges, std::vector< RORoute *> &paths, std::string routeId, double prob)
add a route and check for duplicates
static double getTravelTime(const ROEdge *const e, const ROVehicle *const v, double t)
Returns the traveltime on an edge without penalties.
ROVehicle * myDefaultVehicle
ROMAAssignments & operator=(const ROMAAssignments &src)
Invalidated assignment operator.
Abstract superclass of a task to be run with an index to keep track of pending tasks.
A thread repeatingly calculating incoming tasks.
void sue(const int maxOuterIteration, const int maxInnerIteration, const int kPaths, const double penalty, const double tolerance, const std::string routeChoiceMethod)
ROVehicle * getDefaultVehicle()
A basic edge for routing applications.
Definition: ROMAEdge.h:58
static double getPenalizedTT(const ROEdge *const e, const ROVehicle *const v, double t)
Returns the traveltime on an edge including penalties.
ODMatrix & myMatrix