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
ROLoader.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// Loader for networks and route imports
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12
// Copyright (C) 2001-2012 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 ROLoader_h
23
#define ROLoader_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 <string>
36
#include <xercesc/sax2/SAX2XMLReader.hpp>
37
#include <
utils/common/SUMOTime.h
>
38
#include <
utils/common/SUMOAbstractRouter.h
>
39
#include <
utils/common/ValueTimeLine.h
>
40
#include <
utils/xml/SAXWeightsHandler.h
>
41
42
43
// ===========================================================================
44
// class declarations
45
// ===========================================================================
46
class
OptionsCont
;
47
class
RONet
;
48
class
ROTypedXMLRoutesLoader
;
49
class
ROAbstractEdgeBuilder
;
50
class
GUIRouterRunThread;
51
class
ROVehicle
;
52
53
54
// ===========================================================================
55
// class definitions
56
// ===========================================================================
65
class
ROLoader
{
66
public
:
73
ROLoader
(
OptionsCont
& oc,
bool
emptyDestinationsAllowed) ;
74
75
77
virtual
~ROLoader
();
78
80
virtual
void
loadNet
(
RONet
& toFill,
ROAbstractEdgeBuilder
& eb);
81
83
bool
loadWeights
(
RONet
& net,
const
std::string& optionName,
84
const
std::string& measure,
bool
useLanes);
85
88
unsigned
int
openRoutes
(
RONet
& net);
89
92
void
processRoutesStepWise
(
SUMOTime
start,
SUMOTime
end,
93
RONet
& net,
SUMOAbstractRouter<ROEdge, ROVehicle>
&router);
94
97
void
processAllRoutes
(
SUMOTime
start,
SUMOTime
end,
98
RONet
& net,
SUMOAbstractRouter<ROEdge, ROVehicle>
&router);
99
101
void
processAllRoutesWithBulkRouter
(
SUMOTime
start,
SUMOTime
end,
102
RONet
& net,
SUMOAbstractRouter<ROEdge, ROVehicle>
&router);
103
104
bool
makeSingleStep
(
SUMOTime
end,
RONet
& net,
SUMOAbstractRouter<ROEdge, ROVehicle>
&router);
105
106
protected
:
128
bool
openTypedRoutes
(
const
std::string& optionName,
RONet
& net) ;
129
130
140
SUMOTime
getMinTimeStep
()
const
;
141
142
143
149
class
EdgeFloatTimeLineRetriever_EdgeWeight
:
public
SAXWeightsHandler::EdgeFloatTimeLineRetriever
{
150
public
:
152
EdgeFloatTimeLineRetriever_EdgeWeight
(
RONet
& net) :
myNet
(net) {}
153
155
~EdgeFloatTimeLineRetriever_EdgeWeight
() { }
156
165
void
addEdgeWeight
(
const
std::string&
id
,
166
SUMOReal
val,
SUMOReal
beg,
SUMOReal
end)
const
;
167
168
private
:
170
RONet
&
myNet
;
171
172
};
173
174
180
class
EdgeFloatTimeLineRetriever_EdgeTravelTime
:
public
SAXWeightsHandler::EdgeFloatTimeLineRetriever
{
181
public
:
183
EdgeFloatTimeLineRetriever_EdgeTravelTime
(
RONet
& net) :
myNet
(net) {}
184
186
~EdgeFloatTimeLineRetriever_EdgeTravelTime
() {}
187
196
void
addEdgeWeight
(
const
std::string&
id
,
197
SUMOReal
val,
SUMOReal
beg,
SUMOReal
end)
const
;
198
199
private
:
201
RONet
&
myNet
;
202
203
};
204
205
206
207
protected
:
208
ROTypedXMLRoutesLoader
*
buildNamedHandler
(
const
std::string& optionName,
209
const
std::string& file,
RONet
& net) ;
210
211
212
void
writeStats
(
SUMOTime
time,
SUMOTime
start,
int
absNo) ;
213
214
216
void
destroyHandlers
() ;
217
218
219
protected
:
221
OptionsCont
&
myOptions
;
222
224
typedef
std::vector<ROTypedXMLRoutesLoader*>
RouteLoaderCont
;
225
227
RouteLoaderCont
myHandler
;
228
230
bool
myEmptyDestinationsAllowed
;
231
232
233
private
:
235
ROLoader
(
const
ROLoader
& src);
236
238
ROLoader
&
operator=
(
const
ROLoader
& src);
239
241
bool
myLogSteps
;
242
};
243
244
245
#endif
246
247
/****************************************************************************/
248
tmp
buildd
sumo-0.15.0~dfsg
src
router
ROLoader.h
Generated on Sun May 27 2012 14:52:10 for SUMO - Simulation of Urban MObility by
1.8.1