LCOV - code coverage report
Current view: top level - src/netbuild - NBFrame.cpp (source / functions) Coverage Total Hit
Test: lcov.info Lines: 97.5 % 487 475
Test Date: 2024-11-20 15:55:46 Functions: 100.0 % 2 2

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

Generated by: LCOV version 2.0-1