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
RODFFrame.cpp
Go to the documentation of this file.
1
/****************************************************************************/
10
// Sets and checks options for df-routing
11
/****************************************************************************/
12
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13
// Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
14
/****************************************************************************/
15
//
16
// This file is part of SUMO.
17
// SUMO is free software: you can redistribute it and/or modify
18
// it under the terms of the GNU General Public License as published by
19
// the Free Software Foundation, either version 3 of the License, or
20
// (at your option) any later version.
21
//
22
/****************************************************************************/
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
34
#include <iostream>
35
#include <fstream>
36
#include <ctime>
37
#include <
utils/options/OptionsCont.h
>
38
#include <
utils/options/Option.h
>
39
#include <
utils/common/MsgHandler.h
>
40
#include <
utils/common/UtilExceptions.h
>
41
#include <
utils/common/ToString.h
>
42
#include <
utils/common/SystemFrame.h
>
43
#include "
RODFFrame.h
"
44
#include <
router/ROFrame.h
>
45
#include <
utils/common/RandHelper.h
>
46
#include <
utils/common/SUMOTime.h
>
47
48
49
#ifdef CHECK_MEMORY_LEAKS
50
#include <
foreign/nvwa/debug_new.h
>
51
#endif // CHECK_MEMORY_LEAKS
52
53
54
// ===========================================================================
55
// method definitions
56
// ===========================================================================
57
void
58
RODFFrame::fillOptions
() {
59
OptionsCont
& oc =
OptionsCont::getOptions
();
60
oc.
addCallExample
(
"-c <CONFIGURATION>"
,
"run routing with options from file"
);
61
62
// insert options sub-topics
63
SystemFrame::addConfigurationOptions
(oc);
// fill this subtopic, too
64
oc.
addOptionSubTopic
(
"Input"
);
65
oc.
addOptionSubTopic
(
"Output"
);
66
oc.
addOptionSubTopic
(
"Processing"
);
67
oc.
addOptionSubTopic
(
"Time"
);
68
SystemFrame::addReportOptions
(oc);
// fill this subtopic, too
69
70
71
// register the options
72
// register input-options
73
oc.
doRegister
(
"net-file"
,
'n'
,
new
Option_FileName
());
74
oc.
addSynonyme
(
"net-file"
,
"net"
);
75
oc.
addDescription
(
"net-file"
,
"Input"
,
"Loads the SUMO-network FILE"
);
76
77
/* never used
78
oc.doRegister("route-files", 'r', new Option_FileName());
79
oc.addDescription("route-files", "Input", "Loads SUMO-routes from FILE");
80
*/
81
82
oc.
doRegister
(
"detector-files"
,
'd'
,
new
Option_FileName
());
83
oc.
addSynonyme
(
"detector-files"
,
"detectors"
);
84
oc.
addDescription
(
"detector-files"
,
"Input"
,
"Loads detector descriptions from FILE"
);
85
86
oc.
doRegister
(
"measure-files"
,
'f'
,
new
Option_FileName
());
87
oc.
addSynonyme
(
"measure-files"
,
"detflows"
);
88
oc.
addSynonyme
(
"measure-files"
,
"detector-flow-files"
,
true
);
89
oc.
addDescription
(
"measure-files"
,
"Input"
,
"Loads detector flows from FILE(s)"
);
90
91
92
// register output options
93
oc.
doRegister
(
"routes-output"
,
'o'
,
new
Option_FileName
());
94
oc.
addDescription
(
"routes-output"
,
"Output"
,
"Saves computed routes to FILE"
);
95
96
oc.
doRegister
(
"routes-for-all"
,
new
Option_Bool
(
false
));
97
oc.
addDescription
(
"routes-for-all"
,
"Output"
,
"Forces DFROUTER to compute routes for in-between detectors"
);
98
99
oc.
doRegister
(
"detector-output"
,
new
Option_FileName
());
100
oc.
addSynonyme
(
"detector-output"
,
"detectors-output"
,
true
);
101
oc.
addDescription
(
"detector-output"
,
"Output"
,
"Saves typed detectors to FILE"
);
102
103
oc.
doRegister
(
"detectors-poi-output"
,
new
Option_FileName
());
104
oc.
addDescription
(
"detectors-poi-output"
,
"Output"
,
"Saves detector positions as pois to FILE"
);
105
106
oc.
doRegister
(
"emitters-output"
,
new
Option_FileName
());
107
oc.
addDescription
(
"emitters-output"
,
"Output"
,
"Saves emitter definitions for source detectors to FILE"
);
108
109
oc.
doRegister
(
"emitters-poi-output"
,
new
Option_FileName
());
// !!! describe
110
oc.
addDescription
(
"emitters-poi-output"
,
"Output"
,
"Saves emitter positions as pois to FILE"
);
111
112
oc.
doRegister
(
"variable-speed-sign-output"
,
new
Option_FileName
());
113
oc.
addSynonyme
(
"variable-speed-sign-output"
,
"speed-trigger-output"
,
true
);
114
oc.
addDescription
(
"variable-speed-sign-output"
,
"Output"
,
"Saves variable seed sign definitions for sink detectors to FILE"
);
115
116
oc.
doRegister
(
"end-reroute-output"
,
new
Option_FileName
());
117
oc.
addDescription
(
"end-reroute-output"
,
"Output"
,
"Saves rerouter definitions for sink detectors to FILE"
);
118
119
oc.
doRegister
(
"validation-output"
,
new
Option_FileName
());
120
oc.
addDescription
(
"validation-output"
,
"Output"
,
""
);
121
122
oc.
doRegister
(
"validation-output.add-sources"
,
new
Option_Bool
(
false
));
123
oc.
addDescription
(
"validation-output.add-sources"
,
"Output"
,
""
);
124
125
126
// register processing options
127
// to guess empty flows
128
oc.
doRegister
(
"guess-empty-flows"
,
new
Option_Bool
(
false
));
// !!! describe
129
oc.
addDescription
(
"guess-empty-flows"
,
"Processing"
,
""
);
130
131
// for guessing source/sink detectors
132
oc.
doRegister
(
"highway-mode"
,
'h'
,
new
Option_Bool
(
false
));
// !!! describe
133
oc.
addDescription
(
"highway-mode"
,
"Processing"
,
"Switches to highway-mode"
);
134
135
// for detector reading
136
oc.
doRegister
(
"ignore-invalid-detectors"
,
new
Option_Bool
(
false
));
137
oc.
addDescription
(
"ignore-invalid-detectors"
,
"Processing"
,
"Only warn about unparseable detectors"
);
138
139
// for detector type computation
140
oc.
doRegister
(
"revalidate-detectors"
,
new
Option_Bool
(
false
));
141
oc.
addDescription
(
"revalidate-detectors"
,
"Processing"
,
"Recomputes detector types even if given"
);
142
143
// for route computation
144
oc.
doRegister
(
"revalidate-routes"
,
new
Option_Bool
(
false
));
145
oc.
addDescription
(
"revalidate-routes"
,
"Processing"
,
"Recomputes routes even if given"
);
146
147
oc.
doRegister
(
"all-end-follower"
,
new
Option_Bool
(
false
));
148
oc.
addDescription
(
"all-end-follower"
,
"Processing"
,
"Continues routes till the first street after a sink"
);
149
150
oc.
doRegister
(
"keep-unfinished-routes"
,
new
Option_Bool
(
false
));
151
oc.
addSynonyme
(
"keep-unfinished-routes"
,
"keep-unfound-ends"
,
true
);
152
oc.
addDescription
(
"keep-unfinished-routes"
,
"Processing"
,
"Keeps routes even if they have exhausted max-search-depth"
);
153
154
oc.
doRegister
(
"keep-longer-routes"
,
new
Option_Bool
(
false
));
155
oc.
addDescription
(
"keep-longer-routes"
,
"Processing"
,
"Keeps routes even if a shorter one exists"
);
156
157
oc.
doRegister
(
"max-search-depth"
,
new
Option_Integer
(30));
158
oc.
addSynonyme
(
"max-search-depth"
,
"max-nodet-follower"
,
true
);
159
oc.
addDescription
(
"max-search-depth"
,
"Processing"
,
"Number of edges to follow a route without passing a detector"
);
160
161
oc.
doRegister
(
"emissions-only"
,
new
Option_Bool
(
false
));
162
oc.
addDescription
(
"emissions-only"
,
"Processing"
,
"Writes only emission times"
);
163
164
oc.
doRegister
(
"disallowed-edges"
,
new
Option_String
(
""
));
165
oc.
addDescription
(
"disallowed-edges"
,
"Processing"
,
"Do not route on these edges"
);
166
167
oc.
doRegister
(
"keep-turnarounds"
,
new
Option_Bool
(
false
));
168
oc.
addDescription
(
"keep-turnarounds"
,
"Processing"
,
"Allow turnarounds as route continuations"
);
169
170
oc.
doRegister
(
"min-route-length"
,
new
Option_Float
(-1));
171
oc.
addSynonyme
(
"min-route-length"
,
"min-dist"
,
true
);
172
oc.
addSynonyme
(
"min-route-length"
,
"min-distance"
,
true
);
173
oc.
addDescription
(
"min-route-length"
,
"Processing"
,
"Minimum distance in meters between start and end node of every route."
);
174
175
// flow reading
176
oc.
doRegister
(
"time-factor"
,
new
Option_String
(
"60"
,
"TIME"
));
177
oc.
addDescription
(
"time-factor"
,
"Processing"
,
"Multiply flow times with TIME to get seconds"
);
178
179
oc.
doRegister
(
"time-offset"
,
new
Option_String
(
"0"
,
"TIME"
));
180
oc.
addDescription
(
"time-offset"
,
"Processing"
,
"Subtracts TIME seconds from (scaled) flow times"
);
181
182
oc.
doRegister
(
"time-step"
,
new
Option_String
(
"60"
,
"TIME"
));
183
oc.
addDescription
(
"time-step"
,
"Processing"
,
"Expected distance between two successive data sets"
);
184
185
// saving further structures
186
oc.
doRegister
(
"calibrator-output"
,
new
Option_Bool
(
false
));
// !!!undescribed
187
oc.
addSynonyme
(
"calibrator-output"
,
"write-calibrators"
,
true
);
188
oc.
addDescription
(
"calibrator-output"
,
"Processing"
,
"Write calibrators to FILE"
);
189
190
oc.
doRegister
(
"include-unused-routes"
,
new
Option_Bool
(
false
));
// !!!undescribed
191
oc.
addDescription
(
"include-unused-routes"
,
"Processing"
,
""
);
192
193
//
194
oc.
doRegister
(
"revalidate-flows"
,
new
Option_Bool
(
false
));
195
oc.
addDescription
(
"revalidate-flows"
,
"Processing"
,
""
);
196
197
oc.
doRegister
(
"remove-empty-detectors"
,
new
Option_Bool
(
false
));
198
oc.
addDescription
(
"remove-empty-detectors"
,
"Processing"
,
"Removes empty detectors from the list"
);
199
200
oc.
doRegister
(
"strict-sources"
,
new
Option_Bool
(
false
));
// !!!undescribed
201
oc.
addDescription
(
"strict-sources"
,
"Processing"
,
""
);
202
203
/* disabled, see ticket #521
204
oc.doRegister("join-lanes", new Option_Bool(false));
205
oc.addSynonyme("join-lanes", "mesosim", true);
206
oc.addDescription("join-lanes", "Processing", "Joins detectors lying on same height");
207
*/
208
209
//
210
oc.
doRegister
(
"scale"
,
new
Option_Float
(1.));
211
oc.
addDescription
(
"scale"
,
"Processing"
,
"Scale factor for flows"
);
212
213
// register the simulation settings
214
oc.
doRegister
(
"begin"
,
'b'
,
new
Option_String
(
"0"
,
"TIME"
));
215
oc.
addDescription
(
"begin"
,
"Time"
,
"Defines the begin time; Previous defs will be discarded"
);
216
217
oc.
doRegister
(
"end"
,
'e'
,
new
Option_String
(
"86400"
,
"TIME"
));
218
oc.
addDescription
(
"end"
,
"Time"
,
"Defines the end time; Later defs will be discarded; Defaults to one day"
);
219
220
221
// register report options
222
oc.
doRegister
(
"report-empty-detectors"
,
new
Option_Bool
(
false
));
223
oc.
addDescription
(
"report-empty-detectors"
,
"Report"
,
"Lists detectors with no flow (enable -v)"
);
224
225
oc.
doRegister
(
"print-absolute-flows"
,
new
Option_Bool
(
false
));
226
oc.
addDescription
(
"print-absolute-flows"
,
"Report"
,
"Prints aggregated detector flows"
);
227
228
// register report options
229
oc.
doRegister
(
"no-step-log"
,
new
Option_Bool
(
false
));
230
oc.
addDescription
(
"no-step-log"
,
"Report"
,
"Disable console output of route parsing step"
);
231
232
RandHelper::insertRandOptions
();
233
}
234
235
236
bool
237
RODFFrame::checkOptions
() {
238
return
true
;
239
}
240
241
242
243
/****************************************************************************/
244
home
gladk
tmp
05
sumo-0.17.1~dfsg
src
dfrouter
RODFFrame.cpp
Generated on Sun Jun 16 2013 07:08:25 for SUMO - Simulation of Urban MObility by
1.8.1.2