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

Generated by: LCOV version 2.0-1