SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
RODFNet.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// A DFROUTER-network
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12
// Copyright (C) 2001-2014 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 RODFNet_h
23
#define RODFNet_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
35
#include <
router/RONet.h
>
36
#include <
utils/options/OptionsCont.h
>
37
#include "
RODFDetector.h
"
38
#include "
RODFRouteDesc.h
"
39
#include "
RODFRouteCont.h
"
40
#include <
utils/common/StdDefs.h
>
41
#include <
utils/common/SUMOTime.h
>
42
43
44
// ===========================================================================
45
// class definitions
46
// ===========================================================================
51
class
RODFNet
:
public
RONet
{
52
public
:
56
RODFNet
(
bool
amInHighwayMode);
57
58
60
~RODFNet
();
61
62
63
void
buildApproachList
();
64
65
void
computeTypes
(
RODFDetectorCon
& dets,
66
bool
sourcesStrict)
const
;
67
void
buildRoutes
(
RODFDetectorCon
& det,
bool
keepUnfoundEnds,
bool
includeInBetween,
68
bool
keepShortestOnly,
int
maxFollowingLength)
const
;
69
SUMOReal
getAbsPos
(
const
RODFDetector
& det)
const
;
70
71
void
buildEdgeFlowMap
(
const
RODFDetectorFlows
& flows,
72
const
RODFDetectorCon
& detectors,
73
SUMOTime
startTime,
SUMOTime
endTime,
SUMOTime
stepOffset);
74
75
void
revalidateFlows
(
const
RODFDetectorCon
& detectors,
76
RODFDetectorFlows
& flows,
77
SUMOTime
startTime,
SUMOTime
endTime,
SUMOTime
stepOffset);
78
79
80
void
removeEmptyDetectors
(
RODFDetectorCon
& detectors,
81
RODFDetectorFlows
& flows);
82
83
void
reportEmptyDetectors
(
RODFDetectorCon
& detectors,
84
RODFDetectorFlows
& flows);
85
86
void
buildDetectorDependencies
(
RODFDetectorCon
& detectors);
87
88
void
mesoJoin
(
RODFDetectorCon
& detectors,
RODFDetectorFlows
& flows);
89
90
bool
hasDetector
(
ROEdge
* edge)
const
;
91
const
std::vector<std::string>&
getDetectorList
(
ROEdge
* edge)
const
;
92
93
94
protected
:
95
void
revalidateFlows
(
const
RODFDetector
* detector,
96
RODFDetectorFlows
& flows,
97
SUMOTime
startTime,
SUMOTime
endTime,
SUMOTime
stepOffset);
98
bool
isSource
(
const
RODFDetector
& det,
99
const
RODFDetectorCon
& detectors,
bool
strict)
const
;
100
bool
isFalseSource
(
const
RODFDetector
& det,
101
const
RODFDetectorCon
& detectors)
const
;
102
bool
isDestination
(
const
RODFDetector
& det,
103
const
RODFDetectorCon
& detectors)
const
;
104
105
ROEdge
*
getDetectorEdge
(
const
RODFDetector
& det)
const
;
106
bool
isSource
(
const
RODFDetector
& det,
ROEdge
* edge,
107
std::vector<ROEdge*>& seen,
const
RODFDetectorCon
& detectors,
108
bool
strict)
const
;
109
bool
isFalseSource
(
const
RODFDetector
& det,
ROEdge
* edge,
110
std::vector<ROEdge*>& seen,
const
RODFDetectorCon
& detectors)
const
;
111
bool
isDestination
(
const
RODFDetector
& det,
ROEdge
* edge, std::vector<ROEdge*>& seen,
112
const
RODFDetectorCon
& detectors)
const
;
113
114
void
computeRoutesFor
(
ROEdge
* edge,
RODFRouteDesc
& base,
int
no,
115
bool
keepUnfoundEnds,
116
bool
keepShortestOnly,
117
std::vector<ROEdge*>& visited,
const
RODFDetector
& det,
118
RODFRouteCont
& into,
const
RODFDetectorCon
& detectors,
119
int
maxFollowingLength,
120
std::vector<ROEdge*>& seen)
const
;
121
122
void
buildDetectorEdgeDependencies
(
RODFDetectorCon
& dets)
const
;
123
124
bool
hasApproaching
(
ROEdge
* edge)
const
;
125
bool
hasApproached
(
ROEdge
* edge)
const
;
126
127
bool
hasInBetweenDetectorsOnly
(
ROEdge
* edge,
128
const
RODFDetectorCon
& detectors)
const
;
129
bool
hasSourceDetector
(
ROEdge
* edge,
130
const
RODFDetectorCon
& detectors)
const
;
131
132
struct
IterationEdge
{
133
int
depth
;
134
ROEdge
*
edge
;
135
};
136
137
protected
:
138
class
DFRouteDescByTimeComperator
{
139
public
:
141
explicit
DFRouteDescByTimeComperator
() { }
142
144
~DFRouteDescByTimeComperator
() { }
145
147
bool
operator()
(
const
RODFRouteDesc
& nod1,
const
RODFRouteDesc
& nod2)
const
{
148
return
nod1.
duration_2
> nod2.
duration_2
;
149
}
150
};
151
152
private
:
154
struct
idComp
{
155
bool
operator()
(
ROEdge
*
const
lhs,
ROEdge
*
const
rhs)
const
{
156
return
lhs->
getID
() < rhs->
getID
();
157
}
158
};
159
161
std::map<ROEdge*, std::vector<ROEdge*> >
myApproachingEdges
;
162
164
std::map<ROEdge*, std::vector<ROEdge*> >
myApproachedEdges
;
165
166
mutable
std::map<ROEdge*, std::vector<std::string>,
idComp
>
myDetectorsOnEdges
;
167
mutable
std::map<std::string, ROEdge*>
myDetectorEdges
;
168
169
bool
myAmInHighwayMode
;
170
mutable
size_t
mySourceNumber
,
mySinkNumber
,
myInBetweenNumber
,
myInvalidNumber
;
171
173
std::vector<std::string>
myDisallowedEdges
;
174
175
176
bool
myKeepTurnarounds
;
177
178
};
179
180
181
#endif
182
183
/****************************************************************************/
184
tmp
buildd
sumo-0.21.0+dfsg
src
dfrouter
RODFNet.h
Generated on Thu Nov 20 2014 19:49:58 for SUMO - Simulation of Urban MObility by
1.8.1.2