Eclipse SUMO - Simulation of Urban MObility
AGFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // activitygen module
5 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 // SPDX-License-Identifier: EPL-2.0
11 /****************************************************************************/
20 // Configuration of the options of ActivityGen
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #ifdef HAVE_VERSION_H
30 #include <version.h>
31 #endif
32 
33 #include "AGFrame.h"
34 #include <utils/common/StdDefs.h>
35 #include <router/ROFrame.h>
36 #include <duarouter/RODUAFrame.h>
40 
41 
42 // ===========================================================================
43 // method definitions
44 // ===========================================================================
47  // Options handling
48  oc.addCallExample("--net-file <INPUT>.net.xml --stat-file <INPUT>.stat.xml --output <OUTPUT>.rou.xml --rand",
49  "generate a trips file from a stats file on a given net using arbitrary random seed");
50  oc.addCallExample("--net-file <INPUT>.net.xml --stat-file <INPUT>.stat.xml --output <OUTPUT>.rou.xml --duration-d <NBR_OF_DAYS>",
51  "generate a trips file from a stats file on a given net for numerous days (with fixed random seed)");
52 
53  // Add categories and insert the standard options
55  oc.addOptionSubTopic("Input");
56  oc.addOptionSubTopic("Output");
57  oc.addOptionSubTopic("Processing");
58  oc.addOptionSubTopic("Time");
61 
62  // Insert options
63  oc.doRegister("net-file", 'n', new Option_FileName());
64  oc.addSynonyme("net-file", "net");
65  oc.addDescription("net-file", "Input", "Use FILE as SUMO-network to create trips for");
66 
67  oc.doRegister("stat-file", 's', new Option_FileName());
68  oc.addDescription("stat-file", "Input", "Loads the SUMO-statistics FILE");
69 
70  oc.doRegister("output-file", 'o', new Option_FileName());
71  oc.addSynonyme("output-file", "output", true);
72  oc.addDescription("output-file", "Output", "Write generated trips to FILE");
73 
74  oc.doRegister("debug", new Option_Bool(false));
75  oc.addDescription("debug", "Report",
76  "Detailed messages about every single step");
77 
78  // TODO: What time options are consistent with other parts of SUMO and
79  // useful for the user?
80  oc.doRegister("begin", 'b', new Option_Integer(0));
81  oc.addDescription("begin", "Time", "Sets the time of beginning of the simulation during the first day (in seconds)");
82 
83  oc.doRegister("end", 'e', new Option_Integer(0));
84  oc.addDescription("end", "Time", "Sets the time of ending of the simulation during the last day (in seconds)");
85 
86  oc.doRegister("duration-d", new Option_Integer(1));
87  oc.addDescription("duration-d", "Time", "Sets the duration of the simulation in days");
88 }
89 
90 
92  return true;
93 }
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Definition: OptionsCont.cpp:75
static void insertRandOptions()
Initialises the given options container with random number options.
Definition: RandHelper.cpp:43
static void addReportOptions(OptionsCont &oc)
Adds reporting options to the given container.
Definition: SystemFrame.cpp:65
void addCallExample(const std::string &example, const std::string &desc)
Add a call example.
static void addConfigurationOptions(OptionsCont &oc)
Adds configuration options to the given container.
Definition: SystemFrame.cpp:40
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
Definition: OptionsCont.cpp:96
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
An integer-option.
Definition: Option.h:333
A storage for options typed value containers)
Definition: OptionsCont.h:90
static bool checkOptions()
Checks set options from the OptionsCont singleton for being valid for usage within ActivityGen...
Definition: AGFrame.cpp:91
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
static void fillOptions()
Inserts options used by ActivityGen into the OptionsCont singleton.
Definition: AGFrame.cpp:45