SUMO - Simulation of Urban MObility
ROMAAssignments.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Assignment methods
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef ROMAAssignments_h
23 #define ROMAAssignments_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
36 #include <utils/common/SUMOTime.h>
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class RONet;
42 class ODMatrix;
44 class ROEdge;
45 class ROMAEdge;
46 class ROVehicle;
47 
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
59 public:
61  ROMAAssignments(const SUMOTime begin, const SUMOTime end, const bool additiveTraffic,
62  const SUMOReal adaptionFactor, RONet& net, ODMatrix& matrix, SUMOAbstractRouter<ROEdge, ROVehicle>& router);
63 
66 
68  return myDefaultVehicle;
69  }
70 
71  // @brief calculate edge capacity for the given edge
72  static SUMOReal getCapacity(const ROEdge* edge);
73 
74  // @brief calculate edge travel time for the given edge and number of vehicles per hour
75  SUMOReal capacityConstraintFunction(const ROEdge* edge, const SUMOReal flow) const;
76 
77  // @brief clear effort storage
78  void resetFlows();
79 
80  // @brief incremental method
81  void incremental(const int numIter, const bool verbose);
82 
83  // @brief UE method
84  void ue();
85 
86  // @brief SUE method
87  void sue(const int maxOuterIteration, const int maxInnerIteration, const int kPaths, const SUMOReal penalty, const SUMOReal tolerance, const std::string routeChoiceMethod);
88 
100  static SUMOReal getPenalizedEffort(const ROEdge* const e, const ROVehicle* const v, SUMOReal t);
101 
113  static SUMOReal getPenalizedTT(const ROEdge* const e, const ROVehicle* const v, SUMOReal t);
114 
126  static SUMOReal getTravelTime(const ROEdge* const e, const ROVehicle* const v, SUMOReal t);
127 
128 private:
130  bool addRoute(ConstROEdgeVector& edges, std::vector<RORoute*>& paths, std::string routeId, SUMOReal prob);
131 
133  void getKPaths(const int kPaths, const SUMOReal penalty);
134 
135 private:
138  const bool myAdditiveTraffic;
143  static std::map<const ROEdge* const, SUMOReal> myPenalties;
145 
146 #ifdef HAVE_FOX
147 private:
148  class RoutingTask : public FXWorkerThread::Task {
149  public:
150  RoutingTask(ROMAAssignments& assign, ODCell* c, const SUMOTime begin, const SUMOReal linkFlow)
151  : myAssign(assign), myCell(c), myBegin(begin), myLinkFlow(linkFlow) {}
152  void run(FXWorkerThread* context);
153  private:
154  ROMAAssignments& myAssign;
155  ODCell* const myCell;
156  const SUMOTime myBegin;
157  const SUMOReal myLinkFlow;
158  private:
160  RoutingTask& operator=(const RoutingTask&);
161  };
162 #endif
163 
164 
165 private:
168 
169 };
170 
171 #endif
SUMOAbstractRouter< ROEdge, ROVehicle > & myRouter
long long int SUMOTime
Definition: SUMOTime.h:43
assignment methods
ROMAAssignments(const SUMOTime begin, const SUMOTime end, const bool additiveTraffic, const SUMOReal adaptionFactor, RONet &net, ODMatrix &matrix, SUMOAbstractRouter< ROEdge, ROVehicle > &router)
Constructor.
void incremental(const int numIter, const bool verbose)
const SUMOTime myBegin
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:62
const bool myAdditiveTraffic
const SUMOTime myEnd
A vehicle as used by router.
Definition: ROVehicle.h:60
A single O/D-matrix cell.
Definition: ODCell.h:58
static SUMOReal getPenalizedTT(const ROEdge *const e, const ROVehicle *const v, SUMOReal t)
Returns the traveltime on an edge including penalties.
void sue(const int maxOuterIteration, const int maxInnerIteration, const int kPaths, const SUMOReal penalty, const SUMOReal tolerance, const std::string routeChoiceMethod)
An O/D (origin/destination) matrix.
Definition: ODMatrix.h:76
bool addRoute(ConstROEdgeVector &edges, std::vector< RORoute * > &paths, std::string routeId, SUMOReal prob)
add a route and check for duplicates
~ROMAAssignments()
Destructor.
static std::map< const ROEdge *const, SUMOReal > myPenalties
static SUMOReal getTravelTime(const ROEdge *const e, const ROVehicle *const v, SUMOReal t)
Returns the traveltime on an edge without penalties.
static SUMOReal getPenalizedEffort(const ROEdge *const e, const ROVehicle *const v, SUMOReal t)
Returns the effort to pass an edge including penalties.
A basic edge for routing applications.
Definition: ROEdge.h:77
static SUMOReal getCapacity(const ROEdge *edge)
The router&#39;s network representation.
Definition: RONet.h:76
ROVehicle * myDefaultVehicle
void getKPaths(const int kPaths, const SUMOReal penalty)
get the k shortest paths
ROMAAssignments & operator=(const ROMAAssignments &src)
Invalidated assignment operator.
#define SUMOReal
Definition: config.h:213
Abstract superclass of a task to be run with an index to keep track of pending tasks.
A thread repeatingly calculating incoming tasks.
SUMOReal capacityConstraintFunction(const ROEdge *edge, const SUMOReal flow) const
ROVehicle * getDefaultVehicle()
A basic edge for routing applications.
Definition: ROMAEdge.h:65
const SUMOReal myAdaptionFactor
ODMatrix & myMatrix