SUMO - Simulation of Urban MObility
NBFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // Sets and checks options for netbuild
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2017 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 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <fstream>
35 #include "NBFrame.h"
36 #include "NBNodeCont.h"
37 #include "NBEdgeCont.h"
39 #include "NBDistrictCont.h"
40 #include "NBRequest.h"
41 #include "NBTypeCont.h"
46 #include <utils/common/ToString.h>
50 
51 
52 // ===========================================================================
53 // method definitions
54 // ===========================================================================
55 void
56 NBFrame::fillOptions(bool forNetgen) {
58  // register building defaults
59  oc.doRegister("default.lanenumber", 'L', new Option_Integer(1));
60  oc.addSynonyme("default.lanenumber", "lanenumber", true);
61  oc.addDescription("default.lanenumber", "Building Defaults", "The default number of lanes in an edge");
62 
63  oc.doRegister("default.lanewidth", new Option_Float(NBEdge::UNSPECIFIED_WIDTH));
64  oc.addSynonyme("default.lanewidth", "lanewidth", true);
65  oc.addDescription("default.lanewidth", "Building Defaults", "The default width of lanes");
66 
67  oc.doRegister("default.speed", 'S', new Option_Float((double) 13.9));
68  oc.addSynonyme("default.speed", "speed", true);
69  oc.addDescription("default.speed", "Building Defaults", "The default speed on an edge (in m/s)");
70 
71  oc.doRegister("default.priority", 'P', new Option_Integer(-1));
72  oc.addSynonyme("default.priority", "priority", true);
73  oc.addDescription("default.priority", "Building Defaults", "The default priority of an edge");
74 
75  oc.doRegister("default.sidewalk-width", new Option_Float((double) 2.0));
76  oc.addDescription("default.sidewalk-width", "Building Defaults", "The default width of added sidewalks");
77 
78  oc.doRegister("default.disallow", new Option_String());
79  oc.addDescription("default.disallow", "Building Defaults", "The default for disallowed vehicle classes");
80 
81  oc.doRegister("default.junctions.keep-clear", new Option_Bool(true));
82  oc.addDescription("default.junctions.keep-clear", "Building Defaults", "Whether junctions should be kept clear by default");
83 
84  oc.doRegister("default.junctions.radius", new Option_Float(1.5));
85  oc.addDescription("default.junctions.radius", "Building Defaults", "The default turning radius of intersections");
86 
87  // register the data processing options
88  oc.doRegister("no-internal-links", new Option_Bool(false)); // !!! not described
89  oc.addDescription("no-internal-links", "Processing", "Omits internal links");
90 
91  oc.doRegister("numerical-ids", new Option_Bool(false));
92  oc.addDescription("numerical-ids", "Processing", "Remaps alphanumerical IDs of nodes and edges to ensure that all IDs are integers");
93 
95  oc.doRegister("reserved-ids", new Option_FileName());
96  oc.addDescription("reserved-ids", "Processing", "Ensures that generated ids do not included any of the typed IDs from FILE (SUMO-GUI selection file format)");
97 
98  if (!forNetgen) {
99  oc.doRegister("dismiss-vclasses", new Option_Bool(false));
100  oc.addDescription("dismiss-vclasses", "Processing", "Removes vehicle class restrictions from imported edges");
101  }
102 
103  oc.doRegister("no-turnarounds", new Option_Bool(false));
104  oc.addDescription("no-turnarounds", "Processing", "Disables building turnarounds");
105 
106  oc.doRegister("no-turnarounds.tls", new Option_Bool(false));
107  oc.addSynonyme("no-turnarounds.tls", "no-tls-turnarounds", true);
108  oc.addDescription("no-turnarounds.tls", "Processing", "Disables building turnarounds at tls-controlled junctions");
109 
110  oc.doRegister("no-left-connections", new Option_Bool(false));
111  oc.addDescription("no-left-connections", "Processing", "Disables building connections to left");
112 
113  if (!forNetgen) {
114  oc.doRegister("geometry.split", new Option_Bool(false)); // !!!not described
115  oc.addSynonyme("geometry.split", "split-geometry", true);
116  oc.addDescription("geometry.split", "Processing", "Splits edges across geometry nodes");
117 
118  oc.doRegister("geometry.remove", 'R', new Option_Bool(false));
119  oc.addSynonyme("geometry.remove", "remove-geometry", true);
120  oc.addDescription("geometry.remove", "Processing", "Replace nodes which only define edge geometry by geometry points (joins edges)");
121 
122  oc.doRegister("geometry.remove.keep-edges.explicit", new Option_String());
123  oc.addDescription("geometry.remove.keep-edges.explicit", "Processing", "Ensure that the given list of edges is not modified");
124 
125  oc.doRegister("geometry.remove.keep-edges.input-file", new Option_FileName());
126  oc.addDescription("geometry.remove.keep-edges.input-file", "Processing",
127  "Ensure that the edges in FILE are not modified (Each id on a single line. Selection files from SUMO-GUI are also supported)");
128 
129  oc.doRegister("geometry.max-segment-length", new Option_Float(0));
130  oc.addDescription("geometry.max-segment-length", "Processing", "splits geometry to restrict segment length");
131 
132  oc.doRegister("geometry.min-dist", new Option_Float(-1));
133  oc.addDescription("geometry.min-dist", "Processing", "reduces too similar geometry points");
134 
135  oc.doRegister("geometry.max-angle", new Option_Float(99));
136  oc.addDescription("geometry.max-angle", "Processing", "Warn about edge geometries with an angle above DEGREES in successive segments");
137 
138  oc.doRegister("geometry.min-radius", new Option_Float(9));
139  oc.addDescription("geometry.min-radius", "Processing", "Warn about edge geometries with a turning radius less than METERS at the start or end");
140 
141  oc.doRegister("geometry.min-radius.fix", new Option_Bool(false));
142  oc.addDescription("geometry.min-radius.fix", "Processing", "Straighten edge geometries to avoid turning radii less than geometry.min-radius");
143 
144  oc.doRegister("geometry.junction-mismatch-threshold", new Option_Float(20));
145  oc.addDescription("geometry.junction-mismatch-threshold", "Processing", "Warn if the junction shape is to far away from the original node position");
146 
147  oc.doRegister("geometry.check-overlap", new Option_Float(0));
148  oc.addDescription("geometry.check-overlap", "Processing", "Warn if edges overlap by more than the given threshold value");
149 
150  oc.doRegister("geometry.check-overlap.vertical-threshold", new Option_Float(4));
151  oc.addDescription("geometry.check-overlap.vertical-threshold", "Processing", "Ignore overlapping edges if they are separated vertically by the given threshold.");
152 
153  oc.doRegister("geometry.max-grade", new Option_Float(10));
154  oc.addDescription("geometry.max-grade", "Processing", "Warn about edge geometries with a grade in % above FLOAT. The threshold applies to roads with a speed limit of 50km/h and is scaled according to road speed.");
155  }
156 
157  oc.doRegister("offset.disable-normalization", new Option_Bool(false));
158  oc.addSynonyme("offset.disable-normalization", "disable-normalize-node-positions", true);
159  oc.addDescription("offset.disable-normalization", "Processing", "Turn off normalizing node positions");
160 
161  oc.doRegister("offset.x", new Option_Float(0));
162  oc.addSynonyme("offset.x", "x-offset-to-apply", true);
163  oc.addDescription("offset.x", "Processing", "Adds FLOAT to net x-positions");
164 
165  oc.doRegister("offset.y", new Option_Float(0));
166  oc.addSynonyme("offset.y", "y-offset-to-apply", true);
167  oc.addDescription("offset.y", "Processing", "Adds FLOAT to net y-positions");
168 
169  oc.doRegister("flip-y-axis", new Option_Bool(false));
170  oc.addSynonyme("flip-y-axis", "flip-y");
171  oc.addDescription("flip-y-axis", "Processing", "Flips the y-coordinate along zero");
172 
173  oc.doRegister("roundabouts.guess", new Option_Bool(false));
174  oc.addSynonyme("roundabouts.guess", "guess-roundabouts", true);
175  oc.addDescription("roundabouts.guess", "Processing", "Enable roundabout-guessing");
176 
177  oc.doRegister("opposites.guess", new Option_Bool(false));
178  oc.addDescription("opposites.guess", "Processing", "Enable guessing of opposite direction lanes usable for overtaking");
179 
180  oc.doRegister("opposites.guess.fix-lengths", new Option_Bool(false));
181  oc.addDescription("opposites.guess.fix-lengths", "Processing", "Ensure that opposite edges have the same length");
182 
183  oc.doRegister("lefthand", new Option_Bool(false));
184  oc.addDescription("lefthand", "Processing", "Assumes left-hand traffic on the network");
185 
186  oc.doRegister("edges.join", new Option_Bool(false));
187  oc.addDescription("edges.join", "Processing",
188  "Merges edges which connect the same nodes and are close to each other (recommended for VISSIM import)");
189 
190  oc.doRegister("junctions.join", new Option_Bool(false));
191  oc.addDescription("junctions.join", "Processing",
192  "Joins junctions that are close to each other (recommended for OSM import)");
193 
194  oc.doRegister("junctions.join-dist", new Option_Float(10));
195  oc.addDescription("junctions.join-dist", "Processing",
196  "Determines the maximal distance for joining junctions (defaults to 10)");
197 
198  if (!forNetgen) {
199  oc.doRegister("junctions.join-exclude", new Option_String());
200  oc.addDescription("junctions.join-exclude", "Processing", "Interprets STR as list of junctions to exclude from joining");
201 
202  oc.doRegister("speed.offset", new Option_Float(0));
203  oc.addDescription("speed.offset", "Processing", "Modifies all edge speeds by adding FLOAT");
204 
205  oc.doRegister("speed.factor", new Option_Float(1));
206  oc.addDescription("speed.factor", "Processing", "Modifies all edge speeds by multiplying by FLOAT");
207 
208  oc.doRegister("speed.minimum", new Option_Float(0));
209  oc.addDescription("speed.minimum", "Processing", "Modifies all edge speeds to at least FLOAT");
210  }
211 
212  oc.doRegister("junctions.corner-detail", new Option_Integer(0));
213  oc.addDescription("junctions.corner-detail", "Processing", "Generate INT intermediate points to smooth out intersection corners");
214 
215  oc.doRegister("junctions.internal-link-detail", new Option_Integer(5));
216  oc.addDescription("junctions.internal-link-detail", "Processing", "Generate INT intermediate points to smooth out lanes within the intersection");
217 
218  oc.doRegister("junctions.scurve-stretch", new Option_Float(0));
219  oc.addDescription("junctions.scurve-stretch", "Processing", "Generate longer intersections to allow for smooth s-curves when the number of lanes changes");
220 
221  oc.doRegister("junctions.join-turns", new Option_Bool(false));
222  oc.addDescription("junctions.join-turns", "Processing",
223  "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");
224 
225  oc.doRegister("rectangular-lane-cut", new Option_Bool(false));
226  oc.addDescription("rectangular-lane-cut", "Processing", "Forces rectangular cuts between lanes and intersections");
227 
228  oc.doRegister("check-lane-foes.roundabout", new Option_Bool(true));
229  oc.addDescription("check-lane-foes.roundabout", "Processing",
230  "Allow driving onto a multi-lane road if there are foes on other lanes (at roundabouts)");
231 
232  oc.doRegister("check-lane-foes.all", new Option_Bool(false));
233  oc.addDescription("check-lane-foes.all", "Processing",
234  "Allow driving onto a multi-lane road if there are foes on other lanes (everywhere)");
235 
236  oc.doRegister("sidewalks.guess", new Option_Bool(false));
237  oc.addDescription("sidewalks.guess", "Processing",
238  "Guess pedestrian sidewalks based on edge speed");
239 
240  oc.doRegister("sidewalks.guess.max-speed", new Option_Float((double) 13.89));
241  oc.addDescription("sidewalks.guess.max-speed", "Processing",
242  "Add sidewalks for edges with a speed equal or below the given limit");
243 
244  oc.doRegister("sidewalks.guess.min-speed", new Option_Float((double) 5.8));
245  oc.addDescription("sidewalks.guess.min-speed", "Processing",
246  "Add sidewalks for edges with a speed above the given limit");
247 
248  oc.doRegister("sidewalks.guess.from-permissions", new Option_Bool(false));
249  oc.addDescription("sidewalks.guess.from-permissions", "Processing",
250  "Add sidewalks for edges that allow pedestrians on any of their lanes regardless of speed");
251 
252  oc.doRegister("sidewalks.guess.exclude", new Option_String());
253  oc.addDescription("sidewalks.guess.exclude", "Processing",
254  "Do not guess sidewalks for the given list of edges");
255 
256  oc.doRegister("crossings.guess", new Option_Bool(false));
257  oc.addDescription("crossings.guess", "Processing",
258  "Guess pedestrian crossings based on the presence of sidewalks");
259 
260  oc.doRegister("crossings.guess.speed-threshold", new Option_Float(13.89));
261  oc.addDescription("crossings.guess.speed-threshold", "Processing",
262  "At uncontrolled nodes, do not build crossings across edges with a speed above the threshold");
263 
264  oc.doRegister("walkingareas", new Option_Bool(false));
265  oc.addDescription("walkingareas", "Processing", "Always build walking areas even if there are no crossings");
266 
267  // tls setting options
268  // explicit tls
269  oc.doRegister("tls.set", new Option_String());
270  oc.addSynonyme("tls.set", "explicite-tls", true);
271  oc.addDescription("tls.set", "TLS Building", "Interprets STR as list of junctions to be controlled by TLS");
272 
273  oc.doRegister("tls.unset", new Option_String());
274  oc.addSynonyme("tls.unset", "explicite-no-tls", true);
275  oc.addDescription("tls.unset", "TLS Building", "Interprets STR as list of junctions to be not controlled by TLS");
276 
277  // tls-guessing
278  oc.doRegister("tls.guess", new Option_Bool(false));
279  oc.addSynonyme("tls.guess", "guess-tls", true);
280  oc.addDescription("tls.guess", "TLS Building", "Turns on TLS guessing");
281 
282  if (!forNetgen) {
283  oc.doRegister("tls.taz-nodes", new Option_Bool(false));
284  oc.addSynonyme("tls.taz-nodes", "tls-guess.district-nodes", true);
285  oc.addDescription("tls.taz-nodes", "TLS Building", "Sets district nodes as tls-controlled"); // !!! describe
286  }
287 
288  oc.doRegister("tls-guess.joining", new Option_Bool(false));
289  oc.addDescription("tls-guess.joining", "TLS Building", "Includes node clusters into guess"); // !!! describe
290 
291  oc.doRegister("tls.join", new Option_Bool(false));
292  oc.addSynonyme("tls.join", "try-join-tls", true);
293  oc.addDescription("tls.join", "TLS Building", "Tries to cluster tls-controlled nodes"); // !!! describe
294 
295  oc.doRegister("tls.join-dist", new Option_Float(20));
296  oc.addDescription("tls.join-dist", "TLS Building",
297  "Determines the maximal distance for joining traffic lights (defaults to 20)");
298 
299  oc.doRegister("tls.uncontrolled-within", new Option_Bool(false));
300  oc.addDescription("tls.uncontrolled-within", "TLS Building",
301  "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");
302 
303  if (!forNetgen) {
304  oc.doRegister("tls.guess-signals", new Option_Bool(false));
305  oc.addDescription("tls.guess-signals", "TLS Building", "Interprets tls nodes surrounding an intersection as signal positions for a larger TLS. This is typical pattern for OSM-derived networks");
306 
307  oc.doRegister("tls.guess-signals.dist", new Option_Float(25));
308  oc.addDescription("tls.guess-signals.dist", "TLS Building", "Distance for interpreting nodes as signal locations");
309  }
310 
311 
312  // computational
313  oc.doRegister("tls.cycle.time", new Option_Integer(90));
314  oc.addDescription("tls.cycle.time", "TLS Building", "Use INT as cycle duration");
315 
316  oc.doRegister("tls.green.time", new Option_Integer(31));
317  oc.addSynonyme("tls.green.time", "traffic-light-green", true);
318  oc.addDescription("tls.green.time", "TLS Building", "Use INT as green phase duration");
319 
320  oc.doRegister("tls.yellow.min-decel", 'D', new Option_Float(3.0));
321  oc.addSynonyme("tls.yellow.min-decel", "min-decel", true);
322  oc.addDescription("tls.yellow.min-decel", "TLS Building", "Defines smallest vehicle deceleration");
323 
324  oc.doRegister("tls.yellow.patch-small", new Option_Bool(false));
325  oc.addSynonyme("tls.yellow.patch-small", "patch-small-tyellow", true);
326  oc.addDescription("tls.yellow.patch-small", "TLS Building", "Given yellow times are patched even if being too short");
327 
328  oc.doRegister("tls.yellow.time", new Option_Integer(-1));
329  oc.addSynonyme("tls.yellow.time", "traffic-light-yellow", true);
330  oc.addDescription("tls.yellow.time", "TLS Building", "Set INT as fixed time for yellow phase durations");
331 
332  oc.doRegister("tls.red.time", new Option_Integer(5));
333  oc.addDescription("tls.red.time", "TLS Building", "Set INT as fixed time for red phase duration at traffic lights that do not have a conflicting flow");
334 
335  oc.doRegister("tls.allred.time", new Option_Integer(0));
336  oc.addDescription("tls.allred.time", "TLS Building", "Set INT as fixed time for intermediate red phase after every switch");
337 
338  oc.doRegister("tls.left-green.time", new Option_Integer(6));
339  oc.addDescription("tls.left-green.time", "TLS Building", "Use INT as green phase duration for left turns (s). Setting this value to 0 disables additional left-turning phases");
340 
341  // tls-shifts
342  oc.doRegister("tls.half-offset", new Option_String());
343  oc.addSynonyme("tls.half-offset", "tl-logics.half-offset", true);
344  oc.addDescription("tls.half-offset", "TLS Building", "TLSs in STR will be shifted by half-phase");
345 
346  oc.doRegister("tls.quarter-offset", new Option_String());
347  oc.addSynonyme("tls.quarter-offset", "tl-logics.quarter-offset", true);
348  oc.addDescription("tls.quarter-offset", "TLS Building", "TLSs in STR will be shifted by quarter-phase");
349 
350  // tls type
351  oc.doRegister("tls.default-type", new Option_String("static"));
352  oc.addDescription("tls.default-type", "TLS Building", "TLSs with unspecified type will use STR as their algorithm");
353 
354  oc.doRegister("tls.min-dur", new Option_Integer(5));
355  oc.addDescription("tls.min-dur", "TLS Building", "Default minimum phase duration for traffic lights with variable phase length");
356 
357  oc.doRegister("tls.max-dur", new Option_Integer(50));
358  oc.addDescription("tls.max-dur", "TLS Building", "Default maximum phase duration for traffic lights with variable phase length");
359 
360  // edge pruning
361  oc.doRegister("keep-edges.min-speed", new Option_Float(-1));
362  oc.addSynonyme("keep-edges.min-speed", "edges-min-speed", true);
363  oc.addDescription("keep-edges.min-speed", "Edge Removal", "Only keep edges with speed in meters/second > FLOAT");
364 
365  oc.doRegister("remove-edges.explicit", new Option_String());
366  oc.addSynonyme("remove-edges.explicit", "remove-edges");
367  oc.addDescription("remove-edges.explicit", "Edge Removal", "Remove edges in STR");
368 
369  oc.doRegister("keep-edges.explicit", new Option_String());
370  oc.addSynonyme("keep-edges.explicit", "keep-edges");
371  oc.addDescription("keep-edges.explicit", "Edge Removal", "Only keep edges in STR or those which are kept due to other keep-edges or remove-edges options");
372 
373  oc.doRegister("keep-edges.input-file", new Option_FileName());
374  oc.addDescription("keep-edges.input-file", "Edge Removal", "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");
375 
376  oc.doRegister("remove-edges.input-file", new Option_FileName());
377  oc.addDescription("remove-edges.input-file", "Edge Removal", "Remove edges in FILE. (Each id on a single line. Selection files from SUMO-GUI are also supported)");
378 
379  if (!forNetgen) {
380  oc.doRegister("keep-edges.postload", new Option_Bool(false));
381  oc.addDescription("keep-edges.postload", "Edge Removal", "Remove edges after joining");
382  }
383 
384  oc.doRegister("keep-edges.in-boundary", new Option_String());
385  oc.addDescription("keep-edges.in-boundary", "Edge Removal", "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,...>)");
386 
387  oc.doRegister("keep-edges.in-geo-boundary", new Option_String());
388  oc.addDescription("keep-edges.in-geo-boundary", "Edge Removal", "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,...>)");
389 
390  if (!forNetgen) {
391  oc.doRegister("keep-edges.by-vclass", new Option_String());
392  oc.addDescription("keep-edges.by-vclass", "Edge Removal", "Only keep edges which allow one of the vclasss in STR");
393 
394  oc.doRegister("remove-edges.by-vclass", new Option_String());
395  oc.addDescription("remove-edges.by-vclass", "Edge Removal", "Remove edges which allow only vclasses from STR");
396 
397  oc.doRegister("keep-edges.by-type", new Option_String());
398  oc.addDescription("keep-edges.by-type", "Edge Removal", "Only keep edges where type is in STR");
399 
400  oc.doRegister("keep-edges.components", new Option_Integer(0));
401  oc.addDescription("keep-edges.components", "Edge Removal", "Only keep the INT largest weakly connected compoonents");
402 
403  oc.doRegister("remove-edges.by-type", new Option_String());
404  oc.addDescription("remove-edges.by-type", "Edge Removal", "Remove edges where type is in STR");
405 
406  oc.doRegister("remove-edges.isolated", new Option_Bool(false));
407  oc.addSynonyme("remove-edges.isolated", "remove-isolated", true);
408  oc.addDescription("remove-edges.isolated", "Edge Removal", "Removes isolated edges");
409  }
410 
411 
412  // unregulated nodes options
413  oc.doRegister("keep-nodes-unregulated", new Option_Bool(false));
414  oc.addSynonyme("keep-nodes-unregulated", "keep-unregulated");
415  oc.addDescription("keep-nodes-unregulated", "Unregulated Nodes", "All nodes will be unregulated");
416 
417  oc.doRegister("keep-nodes-unregulated.explicit", new Option_String());
418  oc.addSynonyme("keep-nodes-unregulated.explicit", "keep-unregulated.explicit");
419  oc.addSynonyme("keep-nodes-unregulated.explicit", "keep-unregulated.nodes", true);
420  oc.addDescription("keep-nodes-unregulated.explicit", "Unregulated Nodes", "Do not regulate nodes in STR");
421 
422  oc.doRegister("keep-nodes-unregulated.district-nodes", new Option_Bool(false));
423  oc.addSynonyme("keep-nodes-unregulated.district-nodes", "keep-unregulated.district-nodes");
424  oc.addDescription("keep-nodes-unregulated.district-nodes", "Unregulated Nodes", "Do not regulate district nodes");
425 
426  // ramp guessing options
427  if (!forNetgen) {
428  oc.doRegister("ramps.guess", new Option_Bool(false));
429  oc.addSynonyme("ramps.guess", "guess-ramps", true);
430  oc.addDescription("ramps.guess", "Ramp Guessing", "Enable ramp-guessing");
431 
432  oc.doRegister("ramps.max-ramp-speed", new Option_Float(-1));
433  oc.addSynonyme("ramps.max-ramp-speed", "ramp-guess.max-ramp-speed", true);
434  oc.addDescription("ramps.max-ramp-speed", "Ramp Guessing", "Treat edges with speed > FLOAT as no ramps");
435 
436  oc.doRegister("ramps.min-highway-speed", new Option_Float((double)(79 / 3.6)));
437  oc.addSynonyme("ramps.min-highway-speed", "ramp-guess.min-highway-speed", true);
438  oc.addDescription("ramps.min-highway-speed", "Ramp Guessing", "Treat edges with speed < FLOAT as no highways");
439 
440  oc.doRegister("ramps.ramp-length", new Option_Float(100));
441  oc.addSynonyme("ramps.ramp-length", "ramp-guess.ramp-length", true);
442  oc.addDescription("ramps.ramp-length", "Ramp Guessing", "Use FLOAT as ramp-length");
443 
444  oc.doRegister("ramps.set", new Option_String());
445  oc.addSynonyme("ramps.set", "ramp-guess.explicite", true);
446  oc.addDescription("ramps.set", "Ramp Guessing", "Tries to handle the given edges as ramps");
447 
448  oc.doRegister("ramps.unset", new Option_String());
449  oc.addDescription("ramps.unset", "Ramp Guessing", "Do not consider the given edges as ramps");
450 
451  oc.doRegister("ramps.no-split", new Option_Bool(false));
452  oc.addSynonyme("ramps.no-split", "ramp-guess.no-split", true);
453  oc.addDescription("ramps.no-split", "Ramp Guessing", "Avoids edge splitting");
454  }
455 }
456 
457 
458 bool
461  bool ok = true;
462  //
463  if (!oc.isDefault("tls-guess.joining")) {
464  WRITE_WARNING("'--tls-guess.joining' was joined with '--tls.join'.\n Please use '--tls.join' in future only.");
465  if (!oc.isSet("tls.join")) {
466  oc.set("tls.join", "true");
467  }
468  }
469  if (!SUMOXMLDefinitions::TrafficLightTypes.hasString(oc.getString("tls.default-type"))) {
470  WRITE_ERROR("unsupported value '" + oc.getString("tls.default-type") + "' for option '--tls.default-type'");
471  ok = false;
472  }
473  if (oc.isSet("keep-edges.in-boundary") && oc.isSet("keep-edges.in-geo-boundary")) {
474  WRITE_ERROR("only one of the options 'keep-edges.in-boundary' or 'keep-edges.in-geo-boundary' may be given");
475  ok = false;
476  }
477  if (oc.getBool("no-internal-links") && oc.getBool("crossings.guess")) {
478  WRITE_ERROR("only one of the options 'no-internal-links' or 'crossings.guess' may be given");
479  ok = false;
480  }
481  if (oc.getBool("no-internal-links") && oc.getBool("walkingareas")) {
482  WRITE_ERROR("only one of the options 'no-internal-links' or 'walkareas' may be given");
483  ok = false;
484  }
485  if (!oc.isDefault("tls.green.time") && !oc.isDefault("tls.cycle.time")) {
486  WRITE_ERROR("only one of the options 'tls.green.time' or 'tls.cycle.time' may be given");
487  ok = false;
488  }
489  if (oc.getInt("junctions.internal-link-detail") < 2) {
490  WRITE_ERROR("junctions.internal-link-detail must >= 2");
491  ok = false;
492  }
493  if (oc.getFloat("junctions.scurve-stretch") > 0) {
494  if (oc.getBool("no-internal-links")) {
495  WRITE_WARNING("option 'junctions.scurve-stretch' requires internal lanes to work. Option '--no-internal-links' was disabled.");
496  }
497  // make sure the option is set so heuristics cannot ignore it
498  oc.set("no-internal-links", "false");
499  }
500  return ok;
501 }
502 
503 
504 /****************************************************************************/
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Definition: OptionsCont.cpp:82
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
Definition: NBFrame.cpp:459
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:256
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:65
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:206
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
An integer-option.
Definition: Option.h:313
A storage for options typed value containers)
Definition: OptionsCont.h:99
static void fillOptions(bool forNetgen)
Inserts options used by the network converter.
Definition: NBFrame.cpp:56
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.