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