Line data Source code
1 : /****************************************************************************/
2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 : // Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4 : // This program and the accompanying materials are made available under the
5 : // terms of the Eclipse Public License 2.0 which is available at
6 : // https://www.eclipse.org/legal/epl-2.0/
7 : // This Source Code may also be made available under the following Secondary
8 : // Licenses when the conditions for such availability set forth in the Eclipse
9 : // Public License 2.0 are satisfied: GNU General Public License, version 2
10 : // or later which is available at
11 : // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 : // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 : /****************************************************************************/
14 : /// @file NBFrame.cpp
15 : /// @author Daniel Krajzewicz
16 : /// @author Jakob Erdmann
17 : /// @author Michael Behrisch
18 : /// @date 09.05.2011
19 : ///
20 : // Sets and checks options for netbuild
21 : /****************************************************************************/
22 : #include <config.h>
23 :
24 : #include <string>
25 : #include <fstream>
26 : #include <utils/options/OptionsCont.h>
27 : #include <utils/common/MsgHandler.h>
28 : #include <utils/common/UtilExceptions.h>
29 : #include <utils/common/StringTokenizer.h>
30 : #include <utils/common/ToString.h>
31 : #include <utils/geom/GeoConvHelper.h>
32 : #include <utils/iodevices/OutputDevice.h>
33 : #include <utils/xml/SUMOXMLDefinitions.h>
34 :
35 : #include "NBFrame.h"
36 : #include "NBNodeCont.h"
37 : #include "NBEdgeCont.h"
38 : #include "NBTrafficLightLogicCont.h"
39 : #include "NBDistrictCont.h"
40 : #include "NBRequest.h"
41 : #include "NBTypeCont.h"
42 :
43 : // ===========================================================================
44 : // method definitions
45 : // ===========================================================================
46 :
47 : void
48 2547 : NBFrame::fillOptions(OptionsCont& oc, bool forNetgen) {
49 : // register building defaults
50 2547 : oc.doRegister("default.lanenumber", 'L', new Option_Integer(1));
51 5094 : oc.addSynonyme("default.lanenumber", "lanenumber", true);
52 5094 : oc.addDescription("default.lanenumber", "Building Defaults", TL("The default number of lanes in an edge"));
53 :
54 2547 : oc.doRegister("default.lanewidth", new Option_Float(NBEdge::UNSPECIFIED_WIDTH));
55 5094 : oc.addSynonyme("default.lanewidth", "lanewidth", true);
56 5094 : oc.addDescription("default.lanewidth", "Building Defaults", TL("The default width of lanes"));
57 :
58 5094 : oc.doRegister("default.spreadtype", new Option_String("right"));
59 5094 : oc.addDescription("default.spreadtype", "Building Defaults", TL("The default method for computing lane shapes from edge shapes"));
60 :
61 2547 : oc.doRegister("default.speed", 'S', new Option_Float((double) 13.89));
62 5094 : oc.addSynonyme("default.speed", "speed", true);
63 5094 : oc.addDescription("default.speed", "Building Defaults", TL("The default speed on an edge (in m/s)"));
64 :
65 2547 : oc.doRegister("default.friction", new Option_Float(NBEdge::UNSPECIFIED_FRICTION));
66 5094 : oc.addSynonyme("default.friction", "friction", true);
67 5094 : oc.addDescription("default.friction", "Building Defaults", TL("The default friction on an edge"));
68 :
69 2547 : oc.doRegister("default.priority", 'P', new Option_Integer(-1));
70 5094 : oc.addSynonyme("default.priority", "priority", true);
71 5094 : oc.addDescription("default.priority", "Building Defaults", TL("The default priority of an edge"));
72 :
73 2547 : oc.doRegister("default.type", new Option_String());
74 5094 : oc.addDescription("default.type", "Building Defaults", TL("The default edge type"));
75 :
76 2547 : oc.doRegister("default.sidewalk-width", new Option_Float((double) 2.0));
77 5094 : oc.addDescription("default.sidewalk-width", "Building Defaults", TL("The default width of added sidewalks"));
78 :
79 2547 : oc.doRegister("default.bikelane-width", new Option_Float((double) 1.0));
80 5094 : oc.addDescription("default.bikelane-width", "Building Defaults", TL("The default width of added bike lanes"));
81 :
82 2547 : oc.doRegister("default.crossing-width", new Option_Float((double) 4.0));
83 5094 : oc.addDescription("default.crossing-width", "Building Defaults", TL("The default width of a pedestrian crossing"));
84 :
85 2547 : oc.doRegister("default.crossing-speed", new Option_Float(2.78));
86 5094 : oc.addDescription("default.crossing-speed", "Building Defaults", TL("The default speed 'limit' on a pedestrian crossing (in m/s)"));
87 :
88 2547 : oc.doRegister("default.walkingarea-speed", new Option_Float(2.78));
89 5094 : oc.addDescription("default.walkingarea-speed", "Building Defaults", TL("The default speed 'limit' on a pedestrian walkingarea (in m/s)"));
90 :
91 2547 : oc.doRegister("default.allow", new Option_String());
92 5094 : oc.addDescription("default.allow", "Building Defaults", TL("The default for allowed vehicle classes"));
93 :
94 2547 : oc.doRegister("default.disallow", new Option_String());
95 5094 : oc.addDescription("default.disallow", "Building Defaults", TL("The default for disallowed vehicle classes"));
96 :
97 2547 : oc.doRegister("default.junctions.keep-clear", new Option_Bool(true));
98 5094 : oc.addDescription("default.junctions.keep-clear", "Building Defaults", TL("Whether junctions should be kept clear by default"));
99 :
100 2547 : oc.doRegister("default.junctions.radius", new Option_Float(4));
101 5094 : oc.addDescription("default.junctions.radius", "Building Defaults", TL("The default turning radius of intersections"));
102 :
103 2547 : oc.doRegister("default.junctions.type", 'j', new Option_String());
104 5094 : oc.addSynonyme("default.junctions.type", "default-junction-type"); // default netgenerate option name
105 5094 : oc.addDescription("default.junctions.type", "Building Defaults", TL("[traffic_light|priority|right_before_left|left_before_right|traffic_light_right_on_red|priority_stop|allway_stop|...] Determines default junction type (see docs/Networks/PlainXML#node_types)"));
106 :
107 2547 : oc.doRegister("default.connection-length", new Option_Float((double) NBEdge::UNSPECIFIED_LOADED_LENGTH));
108 5094 : oc.addDescription("default.connection-length", "Building Defaults", TL("The default length when overriding connection lengths"));
109 :
110 2547 : oc.doRegister("default.connection.cont-pos", new Option_Float((double)NBEdge::UNSPECIFIED_CONTPOS));
111 5094 : oc.addDescription("default.connection.cont-pos", "Building Defaults", TL("Whether/where connections should have an internal junction"));
112 :
113 5094 : oc.doRegister("default.right-of-way", new Option_String("default"));
114 5094 : oc.addDescription("default.right-of-way", "Building Defaults", TL("The default algorithm for computing right of way rules ('default', 'edgePriority')"));
115 :
116 2547 : oc.doRegister("junctions.right-before-left.speed-threshold", new Option_Float(49 / 3.6));
117 5094 : oc.addDescription("junctions.right-before-left.speed-threshold", "Junctions", TL("Allow building right-before-left junctions when the incoming edge speeds are below FLOAT (m/s)"));
118 :
119 2547 : oc.doRegister("junctions.left-before-right", new Option_Bool(false));
120 5094 : oc.addDescription("junctions.left-before-right", "Junctions", TL("Build left-before-right junctions instead of right-before-left junctions"));
121 :
122 : // register the data processing options
123 2547 : oc.doRegister("no-internal-links", new Option_Bool(false)); // !!! not described
124 5094 : oc.addDescription("no-internal-links", "Junctions", TL("Omits internal links"));
125 :
126 2547 : oc.doRegister("numerical-ids", new Option_Bool(false));
127 5094 : oc.addDescription("numerical-ids", "Processing", TL("Remaps alphanumerical IDs of nodes and edges to ensure that all IDs are integers"));
128 :
129 2547 : oc.doRegister("numerical-ids.node-start", new Option_Integer(std::numeric_limits<int>::max()));
130 5094 : oc.addDescription("numerical-ids.node-start", "Processing", TL("Remaps IDs of nodes to integers starting at INT"));
131 :
132 2547 : oc.doRegister("numerical-ids.edge-start", new Option_Integer(std::numeric_limits<int>::max()));
133 5094 : oc.addDescription("numerical-ids.edge-start", "Processing", TL("Remaps IDs of edges to integers starting at INT"));
134 :
135 : /// @todo not working for netgen
136 2547 : oc.doRegister("reserved-ids", new Option_FileName());
137 5094 : oc.addDescription("reserved-ids", "Processing", TL("Ensures that generated ids do not included any of the typed IDs from FILE (sumo-gui selection file format)"));
138 :
139 2547 : oc.doRegister("kept-ids", new Option_FileName());
140 5094 : oc.addDescription("kept-ids", "Processing", TL("Ensures that objects with typed IDs from FILE (sumo-gui selection file format) are not renamed"));
141 :
142 2547 : if (!forNetgen) {
143 2427 : oc.doRegister("dismiss-vclasses", new Option_Bool(false));
144 4854 : oc.addDescription("dismiss-vclasses", "Processing", TL("Removes vehicle class restrictions from imported edges"));
145 : }
146 :
147 2547 : oc.doRegister("no-turnarounds", new Option_Bool(false));
148 5094 : oc.addDescription("no-turnarounds", "Junctions", TL("Disables building turnarounds"));
149 :
150 2547 : oc.doRegister("no-turnarounds.tls", new Option_Bool(false));
151 5094 : oc.addSynonyme("no-turnarounds.tls", "no-tls-turnarounds", true);
152 5094 : oc.addDescription("no-turnarounds.tls", "Junctions", TL("Disables building turnarounds at tls-controlled junctions"));
153 :
154 2547 : oc.doRegister("no-turnarounds.geometry", new Option_Bool(true));
155 5094 : oc.addDescription("no-turnarounds.geometry", "Junctions", TL("Disables building turnarounds at geometry-like junctions"));
156 :
157 2547 : oc.doRegister("no-turnarounds.except-deadend", new Option_Bool(false));
158 5094 : oc.addDescription("no-turnarounds.except-deadend", "Junctions", TL("Disables building turnarounds except at dead end junctions"));
159 :
160 2547 : oc.doRegister("no-turnarounds.except-turnlane", new Option_Bool(false));
161 5094 : oc.addDescription("no-turnarounds.except-turnlane", "Junctions", TL("Disables building turnarounds except at junctions with a dedicated turning lane"));
162 :
163 2547 : oc.doRegister("no-turnarounds.fringe", new Option_Bool(false));
164 5094 : oc.addDescription("no-turnarounds.fringe", "Junctions", TL("Disables building turnarounds at fringe junctions"));
165 :
166 2547 : oc.doRegister("no-left-connections", new Option_Bool(false));
167 5094 : oc.addDescription("no-left-connections", "Junctions", TL("Disables building connections to left"));
168 :
169 2547 : oc.doRegister("geometry.split", new Option_Bool(false)); // !!!not described
170 5094 : oc.addSynonyme("geometry.split", "split-geometry", true);
171 5094 : oc.addDescription("geometry.split", "Processing", TL("Splits edges across geometry nodes"));
172 :
173 2547 : oc.doRegister("geometry.remove", 'R', new Option_Bool(false));
174 5094 : oc.addSynonyme("geometry.remove", "remove-geometry", true);
175 5094 : oc.addDescription("geometry.remove", "Processing", TL("Replace nodes which only define edge geometry by geometry points (joins edges)"));
176 :
177 2547 : oc.doRegister("geometry.remove.keep-edges.explicit", new Option_StringVector());
178 5094 : oc.addDescription("geometry.remove.keep-edges.explicit", "Processing", TL("Ensure that the given list of edges is not modified"));
179 :
180 2547 : oc.doRegister("geometry.remove.keep-edges.input-file", new Option_FileName());
181 5094 : oc.addDescription("geometry.remove.keep-edges.input-file", "Processing",
182 : "Ensure that the edges in FILE are not modified (Each id on a single line. Selection files from sumo-gui are also supported)");
183 :
184 2547 : if (!forNetgen) {
185 2427 : oc.doRegister("geometry.remove.keep-ptstops", new Option_Bool(false));
186 4854 : oc.addDescription("geometry.remove.keep-ptstops", "Processing", TL("Ensure that edges with public transport stops are not modified"));
187 : }
188 :
189 2547 : oc.doRegister("geometry.remove.min-length", new Option_Float(0));
190 5094 : oc.addDescription("geometry.remove.min-length", "Processing",
191 : "Allow merging edges with differing attributes when their length is below min-length");
192 :
193 2547 : oc.doRegister("geometry.remove.width-tolerance", new Option_Float(0));
194 5094 : oc.addDescription("geometry.remove.width-tolerance", "Processing",
195 : "Allow merging edges with differing lane widths if the difference is below FLOAT");
196 :
197 2547 : oc.doRegister("geometry.remove.max-junction-size", new Option_Float(-1));
198 5094 : oc.addDescription("geometry.remove.max-junction-size", "Processing",
199 : "Prevent removal of junctions with a size above FLOAT as defined by custom edge endpoints");
200 :
201 2547 : oc.doRegister("geometry.max-segment-length", new Option_Float(0));
202 5094 : oc.addDescription("geometry.max-segment-length", "Processing", TL("splits geometry to restrict segment length"));
203 :
204 2547 : if (!forNetgen) {
205 2427 : oc.doRegister("geometry.min-dist", new Option_Float(-1));
206 4854 : oc.addDescription("geometry.min-dist", "Processing", TL("reduces too similar geometry points"));
207 :
208 2427 : oc.doRegister("geometry.max-angle", new Option_Float(99));
209 4854 : oc.addDescription("geometry.max-angle", "Processing", TL("Warn about edge geometries with an angle above DEGREES in successive segments"));
210 :
211 2427 : oc.doRegister("geometry.max-angle.fix", new Option_Bool(false));
212 4854 : oc.addDescription("geometry.max-angle.fix", "Processing", TL("Straighten edge geometries with an angle above max-angle successive segments"));
213 :
214 2427 : oc.doRegister("geometry.min-radius", new Option_Float(9));
215 4854 : oc.addDescription("geometry.min-radius", "Processing", TL("Warn about edge geometries with a turning radius less than METERS at the start or end"));
216 :
217 2427 : oc.doRegister("geometry.min-radius.fix", new Option_Bool(false));
218 4854 : oc.addDescription("geometry.min-radius.fix", "Processing", TL("Straighten edge geometries to avoid turning radii less than geometry.min-radius"));
219 :
220 2427 : oc.doRegister("geometry.min-radius.fix.railways", new Option_Bool(true));
221 4854 : oc.addDescription("geometry.min-radius.fix.railways", "Processing", TL("Straighten edge geometries to avoid turning radii less than geometry.min-radius (only railways)"));
222 :
223 2427 : oc.doRegister("geometry.junction-mismatch-threshold", new Option_Float(20));
224 4854 : oc.addDescription("geometry.junction-mismatch-threshold", "Processing", TL("Warn if the junction shape is too far away from the original node position"));
225 :
226 2427 : oc.doRegister("geometry.check-overlap", new Option_Float(0));
227 4854 : oc.addDescription("geometry.check-overlap", "Processing", TL("Warn if edges overlap by more than the given threshold value"));
228 :
229 2427 : oc.doRegister("geometry.check-overlap.vertical-threshold", new Option_Float(4));
230 4854 : oc.addDescription("geometry.check-overlap.vertical-threshold", "Processing", TL("Ignore overlapping edges if they are separated vertically by the given threshold."));
231 :
232 2427 : oc.doRegister("geometry.avoid-overlap", new Option_Bool(true));
233 4854 : oc.addDescription("geometry.avoid-overlap", "Processing", TL("Modify edge geometries to avoid overlap at junctions"));
234 :
235 2427 : oc.doRegister("join-lanes", new Option_Bool(false));
236 4854 : oc.addDescription("join-lanes", "Processing", TL("join adjacent lanes that have the same permissions and which do not admit lane-changing (sidewalks and disallowed lanes)"));
237 :
238 2427 : oc.doRegister("ptline.match-dist", new Option_Float(100));
239 4854 : oc.addDescription("ptline.match-dist", "Processing", TL("Matches stops outside the road network to the referencing pt line when below the given distance"));
240 : // railway processing options
241 :
242 2427 : oc.doRegister("railway.topology.repair", new Option_Bool(false));
243 4854 : oc.addDescription("railway.topology.repair", "Railway", TL("Repair topology of the railway network"));
244 :
245 2427 : oc.doRegister("railway.topology.repair.minimal", new Option_Bool(false));
246 4854 : oc.addDescription("railway.topology.repair.minimal", "Railway", TL("Repair topology of the railway network just enough to let loaded public transport lines to work"));
247 :
248 2427 : oc.doRegister("railway.topology.repair.connect-straight", new Option_Bool(false));
249 4854 : oc.addDescription("railway.topology.repair.connect-straight", "Railway", TL("Allow bidirectional rail use wherever rails with opposite directions meet at a straight angle"));
250 :
251 2427 : oc.doRegister("railway.topology.repair.stop-turn", new Option_Bool(false));
252 4854 : oc.addDescription("railway.topology.repair.stop-turn", "Railway", TL("Add turn-around connections at all loaded stops."));
253 :
254 2427 : oc.doRegister("railway.topology.repair.bidi-penalty", new Option_Float(1.2));
255 4854 : oc.addDescription("railway.topology.repair.bidi-penalty", "Railway", TL("Penalty factor for adding new bidi edges to connect public transport stops"));
256 :
257 2427 : oc.doRegister("railway.topology.all-bidi", new Option_Bool(false));
258 4854 : oc.addDescription("railway.topology.all-bidi", "Railway", TL("Make all rails usable in both direction"));
259 :
260 2427 : oc.doRegister("railway.topology.all-bidi.input-file", new Option_FileName());
261 4854 : oc.addDescription("railway.topology.all-bidi.input-file", "Railway", TL("Make all rails edge ids from FILE usable in both direction"));
262 :
263 2427 : oc.doRegister("railway.topology.direction-priority", new Option_Bool(false));
264 4854 : oc.addDescription("railway.topology.direction-priority", "Railway", TL("Set edge priority values based on estimated main direction"));
265 :
266 2427 : oc.doRegister("railway.topology.ptline-priority", new Option_StringVector());
267 4854 : oc.addDescription("railway.topology.ptline-priority", "Railway", TL("Set edge priority values based on public transport lines for the given list of vClasses"));
268 :
269 2427 : oc.doRegister("railway.topology.extend-priority", new Option_Bool(false));
270 4854 : oc.addDescription("railway.topology.extend-priority", "Railway", TL("Extend loaded edge priority values based on estimated main direction"));
271 :
272 2427 : oc.doRegister("railway.geometry.straighten", new Option_Bool(false));
273 4854 : oc.addDescription("railway.geometry.straighten", "Railway", TL("Move junctions to straighten a sequence of rail edges"));
274 :
275 2427 : oc.doRegister("railway.signal.guess.by-stops", new Option_Bool(false));
276 4854 : oc.addDescription("railway.signal.guess.by-stops", "Railway", TL("Guess signals that guard public transport stops"));
277 2427 : oc.doRegister("railway.signal.guess.by-stops.split", new Option_Bool(false));
278 4854 : oc.addDescription("railway.signal.guess.by-stops.split", "Railway", TL("Split edges to improve positioning of guessed signals and prevent switches as rail_signals"));
279 :
280 4854 : oc.doRegister("railway.signal.permit-unsignalized", new Option_StringVector({"tram", "cable_car"}));
281 4854 : oc.addDescription("railway.signal.permit-unsignalized", "Railway", TL("List rail classes that may run without rail signals"));
282 :
283 2427 : oc.doRegister("railway.access-distance", new Option_Float(150.f));
284 4854 : oc.addDescription("railway.access-distance", "Railway", TL("The search radius for finding suitable road accesses for rail stops"));
285 4854 : oc.addSynonyme("railway.access-distance", "osm.stop-output.footway-access-distance", true);
286 :
287 2427 : oc.doRegister("railway.max-accesses", new Option_Integer(5));
288 4854 : oc.addDescription("railway.max-accesses", "Railway", TL("The maximum road accesses registered per rail stops"));
289 4854 : oc.addSynonyme("railway.max-accesses", "osm.stop-output.footway-max-accesses", true);
290 :
291 2427 : oc.doRegister("railway.access-factor", new Option_Float(1.5));
292 4854 : oc.addDescription("railway.access-factor", "Railway", TL("The walking length of the access is computed as air-line distance multiplied by FLOAT"));
293 4854 : oc.addSynonyme("railway.access-factor", "osm.stop-output.footway-access-factor", true);
294 :
295 2427 : oc.doRegister("ptstop-output.no-bidi", new Option_Bool(false));
296 4854 : oc.addDescription("ptstop-output.no-bidi", "Processing", TL("Skips automatic generation of stops on the bidi-edge of a loaded stop"));
297 : }
298 :
299 2547 : oc.doRegister("geometry.max-grade", new Option_Float(10));
300 5094 : oc.addDescription("geometry.max-grade", "Processing", TL("Warn about edge geometries with a grade in % above FLOAT."));
301 :
302 2547 : oc.doRegister("geometry.max-grade.fix", new Option_Bool(true));
303 5094 : oc.addDescription("geometry.max-grade.fix", "Processing", TL("Smooth edge geometries with a grade above the warning threshold."));
304 :
305 2547 : oc.doRegister("offset.disable-normalization", new Option_Bool(false));
306 5094 : oc.addSynonyme("offset.disable-normalization", "disable-normalize-node-positions", true);
307 5094 : oc.addDescription("offset.disable-normalization", "Processing", TL("Turn off normalizing node positions"));
308 :
309 2547 : oc.doRegister("offset.x", new Option_Float(0));
310 5094 : oc.addSynonyme("offset.x", "x-offset-to-apply", true);
311 5094 : oc.addDescription("offset.x", "Processing", TL("Adds FLOAT to net x-positions"));
312 :
313 2547 : oc.doRegister("offset.y", new Option_Float(0));
314 5094 : oc.addSynonyme("offset.y", "y-offset-to-apply", true);
315 5094 : oc.addDescription("offset.y", "Processing", TL("Adds FLOAT to net y-positions"));
316 :
317 2547 : oc.doRegister("offset.z", new Option_Float(0));
318 5094 : oc.addDescription("offset.z", "Processing", TL("Adds FLOAT to net z-positions"));
319 :
320 2547 : oc.doRegister("flip-y-axis", new Option_Bool(false));
321 5094 : oc.addSynonyme("flip-y-axis", "flip-y");
322 5094 : oc.addDescription("flip-y-axis", "Processing", TL("Flips the y-coordinate along zero"));
323 :
324 2547 : oc.doRegister("roundabouts.guess", new Option_Bool(true));
325 5094 : oc.addSynonyme("roundabouts.guess", "guess-roundabouts", true);
326 5094 : oc.addDescription("roundabouts.guess", "Processing", TL("Enable roundabout-guessing"));
327 :
328 : // The Putrajaya Roundabout (Malaysia) holds the Guinness record for the world’s largest roundabout with 3.4km.
329 2547 : oc.doRegister("roundabouts.guess.max-length", new Option_Float(3500));
330 5094 : oc.addDescription("roundabouts.guess.max-length", "Processing", TL("Structures with a circumference above FLOAT threshold are not classified as roundabout"));
331 :
332 2547 : oc.doRegister("roundabouts.visibility-distance", new Option_Float(9));
333 5094 : oc.addDescription("roundabouts.visibility-distance", "Processing", TL("Default visibility when approaching a roundabout"));
334 :
335 2547 : oc.doRegister("opposites.guess", new Option_Bool(false));
336 5094 : oc.addDescription("opposites.guess", "Processing", TL("Enable guessing of opposite direction lanes usable for overtaking"));
337 :
338 2547 : oc.doRegister("opposites.guess.fix-lengths", new Option_Bool(true));
339 5094 : oc.addDescription("opposites.guess.fix-lengths", "Processing", TL("Ensure that opposite edges have the same length"));
340 :
341 2547 : oc.doRegister("fringe.guess", new Option_Bool(false));
342 5094 : oc.addDescription("fringe.guess", "Processing", TL("Enable guessing of network fringe nodes"));
343 :
344 2547 : oc.doRegister("fringe.guess.speed-threshold", new Option_Float(50 / 3.6));
345 5094 : oc.addDescription("fringe.guess.speed-threshold", "Processing", TL("Guess disconnected edges above the given speed as outer fringe"));
346 :
347 2547 : oc.doRegister("lefthand", new Option_Bool(false));
348 5094 : oc.addDescription("lefthand", "Processing", TL("Assumes left-hand traffic on the network"));
349 :
350 2547 : oc.doRegister("edges.join", new Option_Bool(false));
351 5094 : oc.addDescription("edges.join", "Processing",
352 2547 : TL("Merges edges which connect the same nodes and are close to each other (recommended for VISSIM import)"));
353 :
354 2547 : oc.doRegister("junctions.join", new Option_Bool(false));
355 5094 : oc.addDescription("junctions.join", "Junctions",
356 2547 : TL("Joins junctions that are close to each other (recommended for OSM import)"));
357 :
358 2547 : oc.doRegister("junctions.join-dist", new Option_Float(10));
359 5094 : oc.addDescription("junctions.join-dist", "Junctions",
360 2547 : TL("Determines the maximal distance for joining junctions (defaults to 10)"));
361 :
362 2547 : oc.doRegister("junctions.join.parallel-threshold", new Option_Float(30));
363 5094 : oc.addDescription("junctions.join.parallel-threshold", "Junctions",
364 2547 : TL("The angular threshold in degrees for rejection of parallel edges when joining junctions"));
365 :
366 2547 : if (!forNetgen) {
367 2427 : oc.doRegister("junctions.join-exclude", new Option_StringVector());
368 4854 : oc.addDescription("junctions.join-exclude", "Junctions", TL("Interprets STR[] as list of junctions to exclude from joining"));
369 : }
370 :
371 2547 : oc.doRegister("junctions.join-same", new Option_Float(-1));
372 5094 : oc.addDescription("junctions.join-same", "Junctions",
373 2547 : TL("Joins junctions that have similar coordinates even if not connected"));
374 :
375 2547 : oc.doRegister("junctions.join-reset", new Option_Bool(false));
376 5094 : oc.addDescription("junctions.join-reset", "Junctions", TL("Reset connections for joined junctions"));
377 :
378 2547 : if (!forNetgen) {
379 2427 : oc.doRegister("junctions.attach-removed", new Option_Float(-1));
380 4854 : oc.addDescription("junctions.attach-removed", "Junctions",
381 2427 : TL("Attach junction to the closest edge within FLOAT distance that has it's id in param removedNodeIDs (for joining networks)"));
382 : }
383 :
384 2547 : oc.doRegister("max-join-ids", new Option_Integer(4));
385 5094 : oc.addDescription("max-join-ids", "Junctions", TL("Abbreviate junction or TLS id if it joins more than INT junctions"));
386 :
387 2547 : if (!forNetgen) {
388 2427 : oc.doRegister("speed.offset", new Option_Float(0));
389 4854 : oc.addDescription("speed.offset", "Processing", TL("Modifies all edge speeds by adding FLOAT"));
390 :
391 2427 : oc.doRegister("speed.factor", new Option_Float(1));
392 4854 : oc.addDescription("speed.factor", "Processing", TL("Modifies all edge speeds by multiplying by FLOAT"));
393 :
394 2427 : oc.doRegister("speed.minimum", new Option_Float(0));
395 4854 : oc.addDescription("speed.minimum", "Processing", TL("Modifies all edge speeds to at least FLOAT"));
396 :
397 2427 : oc.doRegister("edges.join-tram-dist", new Option_Float(-1));
398 4854 : oc.addDescription("edges.join-tram-dist", "Processing",
399 2427 : TL("Joins tram edges into road lanes with similar geometry (within FLOAT distance)"));
400 : }
401 :
402 2547 : oc.doRegister("junctions.corner-detail", new Option_Integer(5));
403 5094 : oc.addDescription("junctions.corner-detail", "Junctions", TL("Generate INT intermediate points to smooth out intersection corners"));
404 :
405 2547 : oc.doRegister("junctions.internal-link-detail", new Option_Integer(5));
406 5094 : oc.addDescription("junctions.internal-link-detail", "Junctions", TL("Generate INT intermediate points to smooth out lanes within the intersection"));
407 :
408 2547 : oc.doRegister("junctions.scurve-stretch", new Option_Float(0));
409 5094 : oc.addDescription("junctions.scurve-stretch", "Junctions", TL("Generate longer intersections to allow for smooth s-curves when the number of lanes changes"));
410 :
411 2547 : oc.doRegister("junctions.join-turns", new Option_Bool(false));
412 5094 : oc.addDescription("junctions.join-turns", "Junctions",
413 2547 : TL("Builds common edges for turning connections with common from- and to-edge. This causes discrepancies between geometrical length and assigned length due to averaging but enables lane-changing while turning"));
414 :
415 2547 : oc.doRegister("junctions.limit-turn-speed", new Option_Float(5.5));
416 5094 : oc.addDescription("junctions.limit-turn-speed", "Junctions",
417 2547 : TL("Limits speed on junctions to an average lateral acceleration of at most FLOAT (m/s^2)"));
418 :
419 2547 : oc.doRegister("junctions.limit-turn-speed.min-angle", new Option_Float(15));
420 5094 : oc.addDescription("junctions.limit-turn-speed.min-angle", "Junctions",
421 2547 : TL("Do not limit turn speed for angular changes below FLOAT (degrees). The value is subtracted from the geometric angle before computing the turning radius."));
422 :
423 2547 : oc.doRegister("junctions.limit-turn-speed.min-angle.railway", new Option_Float(35));
424 5094 : oc.addDescription("junctions.limit-turn-speed.min-angle.railway", "Junctions",
425 2547 : TL("Do not limit turn speed for angular changes below FLOAT (degrees) on railway edges. The value is subtracted from the geometric angle before computing the turning radius."));
426 :
427 2547 : oc.doRegister("junctions.limit-turn-speed.warn.straight", new Option_Float(5));
428 5094 : oc.addDescription("junctions.limit-turn-speed.warn.straight", "Junctions",
429 2547 : TL("Warn about turn speed limits that reduce the speed of straight connections by more than FLOAT"));
430 :
431 2547 : oc.doRegister("junctions.limit-turn-speed.warn.turn", new Option_Float(22));
432 5094 : oc.addDescription("junctions.limit-turn-speed.warn.turn", "Junctions",
433 2547 : TL("Warn about turn speed limits that reduce the speed of turning connections (no u-turns) by more than FLOAT"));
434 :
435 2547 : oc.doRegister("junctions.small-radius", new Option_Float(1.5));
436 5094 : oc.addDescription("junctions.small-radius", "Junctions",
437 2547 : TL("Default radius for junctions that do not require wide vehicle turns"));
438 :
439 2547 : oc.doRegister("junctions.higher-speed", new Option_Bool(false));
440 5094 : oc.addDescription("junctions.higher-speed", "Junctions",
441 2547 : TL("Use maximum value of incoming and outgoing edge speed on junction instead of average"));
442 :
443 2547 : oc.doRegister("junctions.minimal-shape", new Option_Bool(false));
444 5094 : oc.addDescription("junctions.minimal-shape", "Junctions",
445 2547 : TL("Build junctions with minimal shapes (ignoring edge overlap)"));
446 :
447 2547 : oc.doRegister("junctions.endpoint-shape", new Option_Bool(false));
448 5094 : oc.addDescription("junctions.endpoint-shape", "Junctions",
449 2547 : TL("Build junction shapes based on edge endpoints (ignoring edge overlap)"));
450 :
451 2547 : oc.doRegister("internal-junctions.vehicle-width", new Option_Float(1.8));
452 5094 : oc.addDescription("internal-junctions.vehicle-width", "Junctions",
453 2547 : TL("Assumed vehicle width for computing internal junction positions"));
454 :
455 2547 : oc.doRegister("rectangular-lane-cut", new Option_Bool(false));
456 5094 : oc.addDescription("rectangular-lane-cut", "Junctions", TL("Forces rectangular cuts between lanes and intersections"));
457 :
458 2547 : oc.doRegister("check-lane-foes.roundabout", new Option_Bool(true));
459 5094 : oc.addDescription("check-lane-foes.roundabout", "Junctions",
460 2547 : TL("Allow driving onto a multi-lane road if there are foes on other lanes (at roundabouts)"));
461 :
462 2547 : oc.doRegister("check-lane-foes.all", new Option_Bool(false));
463 5094 : oc.addDescription("check-lane-foes.all", "Junctions",
464 2547 : TL("Allow driving onto a multi-lane road if there are foes on other lanes (everywhere)"));
465 :
466 2547 : oc.doRegister("sidewalks.guess", new Option_Bool(false));
467 5094 : oc.addDescription("sidewalks.guess", "Pedestrian",
468 2547 : TL("Guess pedestrian sidewalks based on edge speed"));
469 :
470 2547 : oc.doRegister("sidewalks.guess.max-speed", new Option_Float((double) 13.89));
471 5094 : oc.addDescription("sidewalks.guess.max-speed", "Pedestrian",
472 2547 : TL("Add sidewalks for edges with a speed equal or below the given limit"));
473 :
474 2547 : oc.doRegister("sidewalks.guess.min-speed", new Option_Float((double) 5.8));
475 5094 : oc.addDescription("sidewalks.guess.min-speed", "Pedestrian",
476 2547 : TL("Add sidewalks for edges with a speed above the given limit"));
477 :
478 2547 : oc.doRegister("sidewalks.guess.from-permissions", new Option_Bool(false));
479 5094 : oc.addDescription("sidewalks.guess.from-permissions", "Pedestrian",
480 2547 : TL("Add sidewalks for edges that allow pedestrians on any of their lanes regardless of speed"));
481 :
482 2547 : oc.doRegister("sidewalks.guess.exclude", new Option_StringVector());
483 5094 : oc.addDescription("sidewalks.guess.exclude", "Pedestrian",
484 2547 : TL("Do not guess sidewalks for the given list of edges"));
485 :
486 2547 : oc.doRegister("bikelanes.guess", new Option_Bool(false));
487 5094 : oc.addDescription("bikelanes.guess", "Bicycle",
488 2547 : TL("Guess bike lanes based on edge speed"));
489 :
490 2547 : oc.doRegister("bikelanes.guess.max-speed", new Option_Float((double) 22.22));
491 5094 : oc.addDescription("bikelanes.guess.max-speed", "Bicycle",
492 2547 : TL("Add bike lanes for edges with a speed equal or below the given limit"));
493 :
494 2547 : oc.doRegister("bikelanes.guess.min-speed", new Option_Float((double) 5.8));
495 5094 : oc.addDescription("bikelanes.guess.min-speed", "Bicycle",
496 2547 : TL("Add bike lanes for edges with a speed above the given limit"));
497 :
498 2547 : oc.doRegister("bikelanes.guess.from-permissions", new Option_Bool(false));
499 5094 : oc.addDescription("bikelanes.guess.from-permissions", "Bicycle",
500 2547 : TL("Add bike lanes for edges that allow bicycles on any of their lanes regardless of speed"));
501 :
502 2547 : oc.doRegister("bikelanes.guess.exclude", new Option_StringVector());
503 5094 : oc.addDescription("bikelanes.guess.exclude", "Bicycle",
504 2547 : TL("Do not guess bikelanes for the given list of edges"));
505 :
506 2547 : oc.doRegister("crossings.guess", new Option_Bool(false));
507 5094 : oc.addDescription("crossings.guess", "Pedestrian",
508 2547 : TL("Guess pedestrian crossings based on the presence of sidewalks"));
509 :
510 2547 : oc.doRegister("crossings.guess.speed-threshold", new Option_Float(13.89));
511 5094 : oc.addDescription("crossings.guess.speed-threshold", "Pedestrian",
512 2547 : TL("At uncontrolled nodes, do not build crossings across edges with a speed above the threshold"));
513 :
514 2547 : oc.doRegister("crossings.guess.roundabout-priority", new Option_Bool(true));
515 5094 : oc.addDescription("crossings.guess.roundabout-priority", "Pedestrian",
516 2547 : TL("Give priority to guessed crossings at roundabouts"));
517 :
518 2547 : oc.doRegister("walkingareas", new Option_Bool(false));
519 5094 : oc.addDescription("walkingareas", "Pedestrian", TL("Always build walking areas even if there are no crossings"));
520 :
521 2547 : oc.doRegister("walkingareas.join-dist", new Option_Float(15));
522 5094 : oc.addDescription("walkingareas.join-dist", "Pedestrian", TL("Do not create a walkingarea between sidewalks that are connected by a pedestrian junction within FLOAT"));
523 :
524 : // tls setting options
525 : // explicit tls
526 2547 : oc.doRegister("tls.set", new Option_StringVector());
527 5094 : oc.addSynonyme("tls.set", "explicite-tls", true);
528 5094 : oc.addDescription("tls.set", "TLS Building", TL("Interprets STR[] as list of junctions to be controlled by TLS"));
529 :
530 2547 : oc.doRegister("tls.unset", new Option_StringVector());
531 5094 : oc.addSynonyme("tls.unset", "explicite-no-tls", true);
532 5094 : oc.addDescription("tls.unset", "TLS Building", TL("Interprets STR[] as list of junctions to be not controlled by TLS"));
533 :
534 : // tls-guessing
535 2547 : oc.doRegister("tls.guess", new Option_Bool(false));
536 5094 : oc.addSynonyme("tls.guess", "guess-tls", true);
537 5094 : oc.addDescription("tls.guess", "TLS Building", TL("Turns on TLS guessing"));
538 :
539 2547 : oc.doRegister("tls.guess.threshold", new Option_Float(250 / 3.6));
540 5094 : oc.addDescription("tls.guess.threshold", "TLS Building", TL("Sets minimum value for the sum of all incoming lane speeds when guessing TLS"));
541 :
542 2547 : if (!forNetgen) {
543 2427 : oc.doRegister("tls.taz-nodes", new Option_Bool(false));
544 4854 : oc.addSynonyme("tls.taz-nodes", "tls-guess.district-nodes", true);
545 4854 : oc.addDescription("tls.taz-nodes", "TLS Building", TL("Sets district nodes as tls-controlled")); // !!! describe
546 : }
547 :
548 2547 : oc.doRegister("tls.guess.joining", new Option_Bool(false));
549 5094 : oc.addSynonyme("tls.guess.joining", "tls-guess.joining", true);
550 5094 : oc.addDescription("tls.guess.joining", "TLS Building", TL("Includes node clusters into guess")); // !!! describe
551 :
552 2547 : oc.doRegister("tls.join", new Option_Bool(false));
553 5094 : oc.addSynonyme("tls.join", "try-join-tls", true);
554 5094 : oc.addDescription("tls.join", "TLS Building", TL("Tries to cluster tls-controlled nodes")); // !!! describe
555 :
556 2547 : oc.doRegister("tls.join-dist", new Option_Float(20));
557 5094 : oc.addDescription("tls.join-dist", "TLS Building",
558 2547 : TL("Determines the maximal distance for joining traffic lights (defaults to 20)"));
559 :
560 2547 : oc.doRegister("tls.join-exclude", new Option_StringVector());
561 5094 : oc.addDescription("tls.join-exclude", "TLS Building", TL("Interprets STR[] as list of tls ids to exclude from joining"));
562 :
563 2547 : oc.doRegister("tls.uncontrolled-within", new Option_Bool(false));
564 5094 : oc.addDescription("tls.uncontrolled-within", "TLS Building",
565 2547 : TL("Do not control edges that lie fully within a joined traffic light. This may cause collisions but allows old traffic light plans to be used"));
566 :
567 2547 : oc.doRegister("tls.ignore-internal-junction-jam", new Option_Bool(false));
568 5094 : oc.addDescription("tls.ignore-internal-junction-jam", "TLS Building",
569 2547 : TL("Do not build mutually conflicting response matrix, potentially ignoring vehicles that are stuck at an internal junction when their phase has ended"));
570 :
571 2547 : if (!forNetgen) {
572 2427 : oc.doRegister("tls.guess-signals", new Option_Bool(false));
573 4854 : oc.addDescription("tls.guess-signals", "TLS Building", TL("Interprets tls nodes surrounding an intersection as signal positions for a larger TLS. This is typical pattern for OSM-derived networks"));
574 :
575 2427 : oc.doRegister("tls.guess-signals.dist", new Option_Float(25));
576 4854 : oc.addDescription("tls.guess-signals.dist", "TLS Building", TL("Distance for interpreting nodes as signal locations"));
577 :
578 2427 : oc.doRegister("tls.guess-signals.slack", new Option_Integer(0));
579 4854 : oc.addDescription("tls.guess-signals.slack", "TLS Building", TL("Number of uncontrolled entry edges to accept and still consider the central node as a traffic light"));
580 : }
581 :
582 :
583 : // computational
584 2547 : oc.doRegister("tls.cycle.time", new Option_Integer(90));
585 5094 : oc.addDescription("tls.cycle.time", "TLS Building", TL("Use INT as cycle duration"));
586 :
587 2547 : oc.doRegister("tls.green.time", new Option_Integer(31));
588 5094 : oc.addSynonyme("tls.green.time", "traffic-light-green", true);
589 5094 : oc.addDescription("tls.green.time", "TLS Building", TL("Use INT as green phase duration"));
590 :
591 2547 : oc.doRegister("tls.yellow.min-decel", 'D', new Option_Float(3.0));
592 5094 : oc.addSynonyme("tls.yellow.min-decel", "min-decel", true);
593 5094 : oc.addDescription("tls.yellow.min-decel", "TLS Building", TL("Defines smallest vehicle deceleration"));
594 :
595 2547 : oc.doRegister("tls.yellow.patch-small", new Option_Bool(false));
596 5094 : oc.addSynonyme("tls.yellow.patch-small", "patch-small-tyellow", true);
597 5094 : oc.addDescription("tls.yellow.patch-small", "TLS Building", TL("Given yellow times are patched even if being too short"));
598 :
599 2547 : oc.doRegister("tls.yellow.time", new Option_Integer(-1));
600 5094 : oc.addSynonyme("tls.yellow.time", "traffic-light-yellow", true);
601 5094 : oc.addDescription("tls.yellow.time", "TLS Building", TL("Set INT as fixed time for yellow phase durations"));
602 :
603 2547 : oc.doRegister("tls.red.time", new Option_Integer(5));
604 5094 : oc.addDescription("tls.red.time", "TLS Building", TL("Set INT as fixed time for red phase duration at traffic lights that do not have a conflicting flow"));
605 :
606 2547 : oc.doRegister("tls.allred.time", new Option_Integer(0));
607 5094 : oc.addDescription("tls.allred.time", "TLS Building", TL("Set INT as fixed time for intermediate red phase after every switch"));
608 :
609 2547 : oc.doRegister("tls.minor-left.max-speed", new Option_Float(19.44)); // 70km/h
610 5094 : oc.addDescription("tls.minor-left.max-speed", "TLS Building", TL("Use FLOAT as threshold for allowing left-turning vehicles to move in the same phase as oncoming straight-going vehicles"));
611 :
612 2547 : oc.doRegister("tls.left-green.time", new Option_Integer(6));
613 5094 : oc.addDescription("tls.left-green.time", "TLS Building", TL("Use INT as green phase duration for left turns (s). Setting this value to 0 disables additional left-turning phases"));
614 :
615 2547 : oc.doRegister("tls.nema.vehExt", new Option_Integer(2));
616 5094 : oc.addDescription("tls.nema.vehExt", "TLS Building", TL("Set INT as fixed time for intermediate vehext phase after every switch"));
617 :
618 2547 : oc.doRegister("tls.nema.yellow", new Option_Integer(3));
619 5094 : oc.addDescription("tls.nema.yellow", "TLS Building", TL("Set INT as fixed time for intermediate NEMA yellow phase after every switch"));
620 :
621 2547 : oc.doRegister("tls.nema.red", new Option_Integer(2));
622 5094 : oc.addDescription("tls.nema.red", "TLS Building", TL("Set INT as fixed time for intermediate NEMA red phase after every switch"));
623 :
624 2547 : oc.doRegister("tls.crossing-min.time", new Option_Integer(4));
625 5094 : oc.addDescription("tls.crossing-min.time", "TLS Building", TL("Use INT as minimum green duration for pedestrian crossings (s)."));
626 :
627 2547 : oc.doRegister("tls.crossing-clearance.time", new Option_Integer(5));
628 5094 : oc.addDescription("tls.crossing-clearance.time", "TLS Building", TL("Use INT as clearance time for pedestrian crossings (s)."));
629 :
630 2547 : oc.doRegister("tls.scramble.time", new Option_Integer(5));
631 5094 : oc.addDescription("tls.scramble.time", "TLS Building", TL("Use INT as green phase duration for pedestrian scramble phase (s)."));
632 :
633 : // tls-shifts
634 2547 : oc.doRegister("tls.half-offset", new Option_StringVector());
635 5094 : oc.addSynonyme("tls.half-offset", "tl-logics.half-offset", true);
636 5094 : oc.addDescription("tls.half-offset", "TLS Building", TL("TLSs in STR[] will be shifted by half-phase"));
637 :
638 2547 : oc.doRegister("tls.quarter-offset", new Option_StringVector());
639 5094 : oc.addSynonyme("tls.quarter-offset", "tl-logics.quarter-offset", true);
640 5094 : oc.addDescription("tls.quarter-offset", "TLS Building", TL("TLSs in STR[] will be shifted by quarter-phase"));
641 :
642 : // tls type
643 5094 : oc.doRegister("tls.default-type", new Option_String("static"));
644 5094 : oc.addDescription("tls.default-type", "TLS Building", TL("TLSs with unspecified type will use STR as their algorithm"));
645 :
646 5094 : oc.doRegister("tls.layout", new Option_String("opposites"));
647 5094 : oc.addDescription("tls.layout", "TLS Building", TL("Set phase layout four grouping opposite directions or grouping all movements for one incoming edge ['opposites', 'incoming']"));
648 :
649 2547 : oc.doRegister("tls.no-mixed", new Option_Bool(false));
650 5094 : oc.addDescription("tls.no-mixed", "TLS Building", TL("Avoid phases with green and red signals for different connections from the same lane"));
651 :
652 2547 : oc.doRegister("tls.min-dur", new Option_Integer(5));
653 5094 : oc.addDescription("tls.min-dur", "TLS Building", TL("Default minimum phase duration for traffic lights with variable phase length"));
654 :
655 2547 : oc.doRegister("tls.max-dur", new Option_Integer(50));
656 5094 : oc.addDescription("tls.max-dur", "TLS Building", TL("Default maximum phase duration for traffic lights with variable phase length"));
657 :
658 2547 : oc.doRegister("tls.group-signals", new Option_Bool(false));
659 5094 : oc.addDescription("tls.group-signals", "TLS Building", TL("Assign the same tls link index to connections that share the same states"));
660 :
661 2547 : oc.doRegister("tls.ungroup-signals", new Option_Bool(false));
662 5094 : oc.addDescription("tls.ungroup-signals", "TLS Building", TL("Assign a distinct tls link index to every connection"));
663 :
664 2547 : oc.doRegister("tls.rebuild", new Option_Bool(false));
665 5094 : oc.addDescription("tls.rebuild", "TLS Building", TL("rebuild all traffic light plans in the network"));
666 :
667 : // edge pruning
668 2547 : oc.doRegister("keep-edges.min-speed", new Option_Float(-1));
669 5094 : oc.addSynonyme("keep-edges.min-speed", "edges-min-speed", true);
670 5094 : oc.addDescription("keep-edges.min-speed", "Edge Removal", TL("Only keep edges with speed in meters/second > FLOAT"));
671 :
672 2547 : oc.doRegister("remove-edges.explicit", new Option_StringVector());
673 5094 : oc.addSynonyme("remove-edges.explicit", "remove-edges");
674 5094 : oc.addDescription("remove-edges.explicit", "Edge Removal", TL("Remove edges in STR[]"));
675 :
676 2547 : oc.doRegister("keep-edges.explicit", new Option_StringVector());
677 5094 : oc.addSynonyme("keep-edges.explicit", "keep-edges");
678 5094 : oc.addDescription("keep-edges.explicit", "Edge Removal", TL("Only keep edges in STR[] or those which are kept due to other keep-edges or remove-edges options"));
679 :
680 2547 : oc.doRegister("keep-edges.input-file", new Option_FileName());
681 5094 : oc.addDescription("keep-edges.input-file", "Edge Removal", TL("Only keep edges in FILE (Each id on a single line. Selection files from sumo-gui are also supported) or those which are kept due to other keep-edges or remove-edges options"));
682 :
683 2547 : oc.doRegister("remove-edges.input-file", new Option_FileName());
684 5094 : oc.addDescription("remove-edges.input-file", "Edge Removal", TL("Remove edges in FILE. (Each id on a single line. Selection files from sumo-gui are also supported)"));
685 :
686 2547 : if (!forNetgen) {
687 2427 : oc.doRegister("keep-edges.postload", new Option_Bool(false));
688 4854 : oc.addDescription("keep-edges.postload", "Edge Removal", TL("Remove edges after loading, patching and joining"));
689 : }
690 :
691 2547 : oc.doRegister("keep-edges.in-boundary", new Option_StringVector());
692 5094 : oc.addDescription("keep-edges.in-boundary", "Edge Removal", TL("Only keep edges which are located within the given boundary (given either as CARTESIAN corner coordinates <xmin,ymin,xmax,ymax> or as polygon <x0,y0,x1,y1,...>)"));
693 :
694 2547 : oc.doRegister("keep-edges.in-geo-boundary", new Option_StringVector());
695 5094 : oc.addDescription("keep-edges.in-geo-boundary", "Edge Removal", TL("Only keep edges which are located within the given boundary (given either as GEODETIC corner coordinates <lon-min,lat-min,lon-max,lat-max> or as polygon <lon0,lat0,lon1,lat1,...>)"));
696 :
697 2547 : if (!forNetgen) {
698 2427 : oc.doRegister("keep-edges.by-vclass", new Option_StringVector());
699 4854 : oc.addDescription("keep-edges.by-vclass", "Edge Removal", TL("Only keep edges which allow one of the vclasses in STR[]"));
700 :
701 2427 : oc.doRegister("remove-edges.by-vclass", new Option_StringVector());
702 4854 : oc.addDescription("remove-edges.by-vclass", "Edge Removal", TL("Remove edges which allow only vclasses from STR[]"));
703 :
704 2427 : oc.doRegister("keep-edges.by-type", new Option_StringVector());
705 4854 : oc.addDescription("keep-edges.by-type", "Edge Removal", TL("Only keep edges where type is in STR[]"));
706 :
707 2427 : oc.doRegister("keep-edges.components", new Option_Integer(0));
708 4854 : oc.addDescription("keep-edges.components", "Edge Removal", TL("Only keep the INT largest weakly connected components"));
709 :
710 2427 : oc.doRegister("remove-edges.by-type", new Option_StringVector());
711 4854 : oc.addDescription("remove-edges.by-type", "Edge Removal", TL("Remove edges where type is in STR[]"));
712 :
713 2427 : oc.doRegister("remove-edges.isolated", new Option_Bool(false));
714 4854 : oc.addSynonyme("remove-edges.isolated", "remove-isolated", true);
715 4854 : oc.addDescription("remove-edges.isolated", "Edge Removal", TL("Removes isolated edges"));
716 : }
717 :
718 2547 : oc.doRegister("keep-lanes.min-width", new Option_Float(0.01));
719 5094 : oc.addDescription("keep-lanes.min-width", "Edge Removal", TL("Only keep lanes with width in meters > FLOAT"));
720 :
721 :
722 : // unregulated nodes options
723 2547 : oc.doRegister("keep-nodes-unregulated", new Option_Bool(false));
724 5094 : oc.addSynonyme("keep-nodes-unregulated", "keep-unregulated");
725 5094 : oc.addDescription("keep-nodes-unregulated", "Unregulated Nodes", TL("All nodes will be unregulated"));
726 :
727 2547 : oc.doRegister("keep-nodes-unregulated.explicit", new Option_StringVector());
728 5094 : oc.addSynonyme("keep-nodes-unregulated.explicit", "keep-unregulated.explicit");
729 5094 : oc.addSynonyme("keep-nodes-unregulated.explicit", "keep-unregulated.nodes", true);
730 5094 : oc.addDescription("keep-nodes-unregulated.explicit", "Unregulated Nodes", TL("Do not regulate nodes in STR[]"));
731 :
732 2547 : oc.doRegister("keep-nodes-unregulated.district-nodes", new Option_Bool(false));
733 5094 : oc.addSynonyme("keep-nodes-unregulated.district-nodes", "keep-unregulated.district-nodes");
734 5094 : oc.addDescription("keep-nodes-unregulated.district-nodes", "Unregulated Nodes", TL("Do not regulate district nodes"));
735 :
736 : // ramp guessing options
737 2547 : if (!forNetgen) {
738 2427 : oc.doRegister("ramps.guess", new Option_Bool(false));
739 4854 : oc.addSynonyme("ramps.guess", "guess-ramps", true);
740 4854 : oc.addDescription("ramps.guess", "Ramp Guessing", TL("Enable ramp-guessing"));
741 :
742 2427 : oc.doRegister("ramps.guess-acceleration-lanes", new Option_Bool(true));
743 4854 : oc.addDescription("ramps.guess-acceleration-lanes", "Ramp Guessing", TL("Guess on-ramps and mark acceleration lanes if they exist but do not add new lanes"));
744 :
745 2427 : oc.doRegister("ramps.max-ramp-speed", new Option_Float(-1));
746 4854 : oc.addSynonyme("ramps.max-ramp-speed", "ramp-guess.max-ramp-speed", true);
747 4854 : oc.addDescription("ramps.max-ramp-speed", "Ramp Guessing", TL("Treat edges with speed > FLOAT as no ramps"));
748 :
749 2427 : oc.doRegister("ramps.min-highway-speed", new Option_Float((double)(79 / 3.6)));
750 4854 : oc.addSynonyme("ramps.min-highway-speed", "ramp-guess.min-highway-speed", true);
751 4854 : oc.addDescription("ramps.min-highway-speed", "Ramp Guessing", TL("Treat edges with speed < FLOAT as no highways"));
752 :
753 2427 : oc.doRegister("ramps.ramp-length", new Option_Float(100));
754 4854 : oc.addSynonyme("ramps.ramp-length", "ramp-guess.ramp-length", true);
755 4854 : oc.addDescription("ramps.ramp-length", "Ramp Guessing", TL("Use FLOAT as ramp-length"));
756 :
757 : //The Weaving Length Limit for Short Free Onramps, Chiu Liu, Zhongren WangPhD even suggest 70m
758 2427 : oc.doRegister("ramps.min-weave-length", new Option_Float(50));
759 4854 : oc.addDescription("ramps.min-weave-length", "Ramp Guessing", TL("Use FLOAT as minimum ramp-length"));
760 :
761 2427 : oc.doRegister("ramps.set", new Option_StringVector());
762 4854 : oc.addSynonyme("ramps.set", "ramp-guess.explicite", true);
763 4854 : oc.addDescription("ramps.set", "Ramp Guessing", TL("Tries to handle the given edges as ramps"));
764 :
765 2427 : oc.doRegister("ramps.unset", new Option_StringVector());
766 4854 : oc.addDescription("ramps.unset", "Ramp Guessing", TL("Do not consider the given edges as ramps"));
767 :
768 2427 : oc.doRegister("ramps.no-split", new Option_Bool(false));
769 4854 : oc.addSynonyme("ramps.no-split", "ramp-guess.no-split", true);
770 4854 : oc.addDescription("ramps.no-split", "Ramp Guessing", TL("Avoids edge splitting"));
771 : }
772 2547 : }
773 :
774 :
775 : bool
776 2522 : NBFrame::checkOptions(OptionsCont& oc) {
777 : bool ok = true;
778 : //
779 5044 : if (!SUMOXMLDefinitions::TrafficLightTypes.hasString(oc.getString("tls.default-type"))) {
780 0 : WRITE_ERRORF(TL("unsupported value '%' for option '--tls.default-type'"), oc.getString("tls.default-type"));
781 : ok = false;
782 : }
783 2532 : if (oc.isSet("keep-edges.in-boundary") && oc.isSet("keep-edges.in-geo-boundary")) {
784 0 : WRITE_ERROR(TL("only one of the options 'keep-edges.in-boundary' or 'keep-edges.in-geo-boundary' may be given"));
785 : ok = false;
786 : }
787 3008 : if (oc.getBool("no-internal-links") && oc.getBool("crossings.guess")) {
788 2 : WRITE_ERROR(TL("only one of the options 'no-internal-links' or 'crossings.guess' may be given"));
789 : ok = false;
790 : }
791 3008 : if (oc.getBool("no-internal-links") && oc.getBool("walkingareas")) {
792 0 : WRITE_ERROR(TL("only one of the options 'no-internal-links' or 'walkareas' may be given"));
793 : ok = false;
794 : }
795 2526 : if (!oc.isDefault("tls.green.time") && !oc.isDefault("tls.cycle.time")) {
796 0 : WRITE_ERROR(TL("only one of the options 'tls.green.time' or 'tls.cycle.time' may be given"));
797 : ok = false;
798 : }
799 5044 : if (oc.getInt("tls.green.time") <= 0) {
800 2 : WRITE_ERROR(TL("'tls.green.time' must be positive"));
801 : ok = false;
802 : }
803 5044 : if (oc.getInt("default.lanenumber") < 1) {
804 1 : WRITE_ERROR(TL("default.lanenumber must be at least 1"));
805 : ok = false;
806 : }
807 2525 : if (!oc.isDefault("default.lanewidth") && oc.getFloat("default.lanewidth") < POSITION_EPS) {
808 3 : WRITE_ERROR("default.lanewidth must be at least " + toString(POSITION_EPS));
809 : ok = false;
810 : }
811 2530 : if (!oc.isDefault("default.disallow") && !oc.isDefault("default.allow")) {
812 0 : WRITE_ERROR(TL("only one of the options 'default.disallow' or 'default.allow' may be given"));
813 : ok = false;
814 : }
815 5044 : if (oc.getInt("junctions.internal-link-detail") < 2) {
816 0 : WRITE_ERROR(TL("junctions.internal-link-detail must >= 2"));
817 : ok = false;
818 : }
819 5044 : if (oc.getFloat("junctions.scurve-stretch") > 0) {
820 4 : if (oc.getBool("no-internal-links")) {
821 0 : WRITE_WARNING(TL("Option 'junctions.scurve-stretch' requires internal lanes to work. Option '--no-internal-links' will be disabled."));
822 : }
823 : // make sure the option is set so heuristics cannot ignore it
824 4 : oc.set("no-internal-links", "false");
825 : }
826 2527 : if (oc.getFloat("junctions.small-radius") > oc.getFloat("default.junctions.radius") && oc.getFloat("default.junctions.radius") >= 0) {
827 6 : if (!oc.isDefault("junctions.small-radius")) {
828 2 : WRITE_WARNING(TL("option 'default.junctions.radius' is smaller than option 'junctions.small-radius'"));
829 : } else {
830 6 : oc.setDefault("junctions.small-radius", oc.getValueString("default.junctions.radius"));
831 : }
832 : }
833 5044 : if (oc.getString("tls.layout") != "opposites"
834 2528 : && oc.getString("tls.layout") != "incoming"
835 2528 : && oc.getString("tls.layout") != "alternateOneWay") {
836 0 : WRITE_ERROR(TL("tls.layout must be 'opposites', 'incoming' or 'alternateOneWay'"));
837 : ok = false;
838 : }
839 5046 : if (!oc.isDefault("default.right-of-way") &&
840 2528 : !SUMOXMLDefinitions::RightOfWayValues.hasString(oc.getString("default.right-of-way"))) {
841 0 : WRITE_ERRORF(TL("default.right-of-way must be one of '%'"), toString(SUMOXMLDefinitions::RightOfWayValues.getStrings()));
842 : ok = false;
843 : }
844 2524 : if (oc.getFloat("roundabouts.visibility-distance") < 0 && oc.getFloat("roundabouts.visibility-distance") != NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE) {
845 0 : WRITE_ERROR(TL("roundabouts.visibility-distance must be positive or -1"));
846 : ok = false;
847 : }
848 4895 : if (oc.isDefault("railway.topology.repair") && oc.getBool("railway.topology.repair.connect-straight")) {
849 0 : oc.setDefault("railway.topology.repair", "true");
850 : }
851 4895 : if (oc.isDefault("railway.topology.repair") && oc.getBool("railway.topology.repair.minimal")) {
852 6 : oc.setDefault("railway.topology.repair", "true");
853 : }
854 7325 : if (oc.isDefault("railway.topology.all-bidi") && !oc.isDefault("railway.topology.all-bidi.input-file")) {
855 2 : oc.setDefault("railway.topology.all-bidi", "true");
856 : }
857 7302 : if (oc.isDefault("railway.topology.repair.stop-turn") && !oc.isDefault("railway.topology.repair")) {
858 72 : oc.setDefault("railway.topology.repair.stop-turn", "true");
859 : }
860 5044 : if (!SUMOXMLDefinitions::LaneSpreadFunctions.hasString(oc.getString("default.spreadtype"))) {
861 0 : WRITE_ERRORF(TL("Unknown value for default.spreadtype '%'."), oc.getString("default.spreadtype"));
862 : ok = false;
863 : }
864 : // check whether the junction type to use is properly set
865 5044 : if (oc.isSet("default.junctions.type")) {
866 18 : std::string type = oc.getString("default.junctions.type");
867 50 : if (type != toString(SumoXMLNodeType::TRAFFIC_LIGHT) &&
868 46 : type != toString(SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION) &&
869 46 : type != toString(SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED) &&
870 43 : type != toString(SumoXMLNodeType::PRIORITY) &&
871 40 : type != toString(SumoXMLNodeType::PRIORITY_STOP) &&
872 39 : type != toString(SumoXMLNodeType::ALLWAY_STOP) &&
873 38 : type != toString(SumoXMLNodeType::ZIPPER) &&
874 38 : type != toString(SumoXMLNodeType::NOJUNCTION) &&
875 38 : type != toString(SumoXMLNodeType::RAIL_SIGNAL) &&
876 38 : type != toString(SumoXMLNodeType::RAIL_CROSSING) &&
877 38 : type != toString(SumoXMLNodeType::LEFT_BEFORE_RIGHT) &&
878 35 : type != toString(SumoXMLNodeType::RIGHT_BEFORE_LEFT) &&
879 50 : type != toString(SumoXMLNodeType::NOJUNCTION) &&
880 32 : type != toString(SumoXMLNodeType::UNKNOWN)) {
881 98 : WRITE_ERROR("Only the following junction types are known: " +
882 : toString(SumoXMLNodeType::TRAFFIC_LIGHT) + ", " +
883 : toString(SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION) + ", " +
884 : toString(SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED) + ", " +
885 : toString(SumoXMLNodeType::PRIORITY) + ", " +
886 : toString(SumoXMLNodeType::PRIORITY_STOP) + ", " +
887 : toString(SumoXMLNodeType::ALLWAY_STOP) + ", " +
888 : toString(SumoXMLNodeType::ZIPPER) + ", " +
889 : toString(SumoXMLNodeType::NOJUNCTION) + ", " +
890 : toString(SumoXMLNodeType::RAIL_SIGNAL) + ", " +
891 : toString(SumoXMLNodeType::RAIL_CROSSING) + ", " +
892 : toString(SumoXMLNodeType::LEFT_BEFORE_RIGHT) + ", " +
893 : toString(SumoXMLNodeType::RIGHT_BEFORE_LEFT) + ", " +
894 : toString(SumoXMLNodeType::UNKNOWN));
895 : ok = false;
896 : }
897 : }
898 2522 : return ok;
899 : }
900 :
901 : /****************************************************************************/
|