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-2015 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, RONet& net, ODMatrix& matrix, SUMOAbstractRouter<ROEdge, ROVehicle>& router);
62 
65 
66  // @brief calculate edge travel time with the given road class and max link speed
67  SUMOReal capacityConstraintFunction(const ROEdge* edge, const SUMOReal flow) const;
68 
69  // @brief incremental method
70  void incremental(const int numIter);
71 
72  // @brief UE method
73  void ue();
74 
75  // @brief SUE method
76  void sue(const int maxOuterIteration, const int maxInnerIteration, const int kPaths, const SUMOReal penalty, const SUMOReal tolerance, const std::string routeChoiceMethod);
77 
89  static SUMOReal getPenalizedEffort(const ROEdge* const e, const ROVehicle* const v, SUMOReal t);
90 
102  static SUMOReal getPenalizedTT(const ROEdge* const e, const ROVehicle* const v, SUMOReal t);
103 
115  static SUMOReal getTravelTime(const ROEdge* const e, const ROVehicle* const v, SUMOReal t);
116 
117 private:
119  bool addRoute(ConstROEdgeVector& edges, std::vector<RORoute*>& paths, std::string routeId, SUMOReal costs, SUMOReal prob);
120 
122  void getKPaths(const int kPaths, const SUMOReal penalty);
123 
124 private:
130  static std::map<const ROEdge* const, SUMOReal> myPenalties;
132 
133 private:
136 
137 };
138 
139 #endif
void incremental(const int numIter)
SUMOAbstractRouter< ROEdge, ROVehicle > & myRouter
assignment methods
ROMAAssignments(const SUMOTime begin, const SUMOTime end, RONet &net, ODMatrix &matrix, SUMOAbstractRouter< ROEdge, ROVehicle > &router)
Constructor.
const SUMOTime myBegin
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:59
const SUMOTime myEnd
A vehicle as used by router.
Definition: ROVehicle.h:60
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:74
~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:73
The router's network representation.
Definition: RONet.h:72
void getKPaths(const int kPaths, const SUMOReal penalty)
get the k shortest paths
ROMAAssignments & operator=(const ROMAAssignments &src)
Invalidated assignment operator.
int SUMOTime
Definition: SUMOTime.h:43
bool addRoute(ConstROEdgeVector &edges, std::vector< RORoute * > &paths, std::string routeId, SUMOReal costs, SUMOReal prob)
add a route and check for duplicates
#define SUMOReal
Definition: config.h:218
SUMOReal capacityConstraintFunction(const ROEdge *edge, const SUMOReal flow) const
A basic edge for routing applications.
Definition: ROMAEdge.h:65
static ROVehicle * myDefaultVehicle
ODMatrix & myMatrix