LCOV - code coverage report
Current view: top level - src/netbuild - NBFrame.cpp (source / functions) Hit Total Coverage
Test: lcov.info Lines: 465 477 97.5 %
Date: 2024-05-06 15:32:35 Functions: 2 2 100.0 %

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

Generated by: LCOV version 1.14