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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // Assignment methods
20 /****************************************************************************/
21 #ifndef ROMAAssignments_h
22 #define ROMAAssignments_h
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 
35 #include <utils/common/SUMOTime.h>
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class RONet;
41 class ODMatrix;
43 class ROEdge;
44 class ROMAEdge;
45 class ROVehicle;
46 
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
58 public:
60  ROMAAssignments(const SUMOTime begin, const SUMOTime end, const bool additiveTraffic,
61  const double adaptionFactor, RONet& net, ODMatrix& matrix, SUMOAbstractRouter<ROEdge, ROVehicle>& router);
62 
65 
67  return myDefaultVehicle;
68  }
69 
70  // @brief calculate edge capacity for the given edge
71  static double getCapacity(const ROEdge* edge);
72 
73  // @brief calculate edge travel time for the given edge and number of vehicles per hour
74  double capacityConstraintFunction(const ROEdge* edge, const double flow) const;
75 
76  // @brief clear effort storage
77  void resetFlows();
78 
79  // @brief incremental method
80  void incremental(const int numIter, const bool verbose);
81 
82  // @brief UE method
83  void ue();
84 
85  // @brief SUE method
86  void sue(const int maxOuterIteration, const int maxInnerIteration, const int kPaths, const double penalty, const double tolerance, const std::string routeChoiceMethod);
87 
99  static double getPenalizedEffort(const ROEdge* const e, const ROVehicle* const v, double t);
100 
112  static double getPenalizedTT(const ROEdge* const e, const ROVehicle* const v, double t);
113 
125  static double getTravelTime(const ROEdge* const e, const ROVehicle* const v, double t);
126 
127 private:
129  bool addRoute(ConstROEdgeVector& edges, std::vector<RORoute*>& paths, std::string routeId, double prob);
130 
132  void getKPaths(const int kPaths, const double penalty);
133 
134 private:
137  const bool myAdditiveTraffic;
138  const double myAdaptionFactor;
142  static std::map<const ROEdge* const, double> myPenalties;
144 
145 #ifdef HAVE_FOX
146 private:
147  class RoutingTask : public FXWorkerThread::Task {
148  public:
149  RoutingTask(ROMAAssignments& assign, ODCell* c, const SUMOTime begin, const double linkFlow)
150  : myAssign(assign), myCell(c), myBegin(begin), myLinkFlow(linkFlow) {}
151  void run(FXWorkerThread* context);
152  private:
153  ROMAAssignments& myAssign;
154  ODCell* const myCell;
155  const SUMOTime myBegin;
156  const double myLinkFlow;
157  private:
159  RoutingTask& operator=(const RoutingTask&);
160  };
161 #endif
162 
163 
164 private:
167 
168 };
169 
170 #endif
SUMOAbstractRouter< ROEdge, ROVehicle > & myRouter
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:62
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:59
A single O/D-matrix cell.
Definition: ODCell.h:57
An O/D (origin/destination) matrix.
Definition: ODMatrix.h:75
~ROMAAssignments()
Destructor.
static double getCapacity(const ROEdge *edge)
A basic edge for routing applications.
Definition: ROEdge.h:77
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:74
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.
long long int SUMOTime
Definition: TraCIDefs.h:51
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:64
static double getPenalizedTT(const ROEdge *const e, const ROVehicle *const v, double t)
Returns the traveltime on an edge including penalties.
ODMatrix & myMatrix