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 /****************************************************************************/
19 // Configuration of the options of ActivityGen
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #ifdef HAVE_VERSION_H
29 #include <version.h>
30 #endif
31 
32 #include "AGFrame.h"
33 #include <utils/common/StdDefs.h>
34 #include <router/ROFrame.h>
35 #include <duarouter/RODUAFrame.h>
39 
40 
41 // ===========================================================================
42 // method definitions
43 // ===========================================================================
46  // Options handling
47  oc.addCallExample("--net-file <INPUT>.net.xml --stat-file <INPUT>.stat.xml --output <OUTPUT>.rou.xml --rand",
48  "generate a trips file from a stats file on a given net using arbitrary random seed");
49  oc.addCallExample("--net-file <INPUT>.net.xml --stat-file <INPUT>.stat.xml --output <OUTPUT>.rou.xml --duration-d <NBR_OF_DAYS>",
50  "generate a trips file from a stats file on a given net for numerous days (with fixed random seed)");
51 
52  // Add categories and insert the standard options
54  oc.addOptionSubTopic("Input");
55  oc.addOptionSubTopic("Output");
56  oc.addOptionSubTopic("Processing");
57  oc.addOptionSubTopic("Time");
60 
61  // Insert options
62  oc.doRegister("net-file", 'n', new Option_FileName());
63  oc.addSynonyme("net-file", "net");
64  oc.addDescription("net-file", "Input", "Use FILE as SUMO-network to create trips for");
65 
66  oc.doRegister("stat-file", 's', new Option_FileName());
67  oc.addDescription("stat-file", "Input", "Loads the SUMO-statistics FILE");
68 
69  oc.doRegister("output-file", 'o', new Option_FileName());
70  oc.addSynonyme("output-file", "output", true);
71  oc.addDescription("output-file", "Output", "Write generated trips to FILE");
72 
73  oc.doRegister("debug", new Option_Bool(false));
74  oc.addDescription("debug", "Report",
75  "Detailed messages about every single step");
76 
77  // TODO: What time options are consistent with other parts of SUMO and
78  // useful for the user?
79  oc.doRegister("begin", 'b', new Option_Integer(0));
80  oc.addDescription("begin", "Time", "Sets the time of beginning of the simulation during the first day (in seconds)");
81 
82  oc.doRegister("end", 'e', new Option_Integer(0));
83  oc.addDescription("end", "Time", "Sets the time of ending of the simulation during the last day (in seconds)");
84 
85  oc.doRegister("duration-d", new Option_Integer(1));
86  oc.addDescription("duration-d", "Time", "Sets the duration of the simulation in days");
87 }
88 
89 
91  return true;
92 }
SystemFrame::addConfigurationOptions
static void addConfigurationOptions(OptionsCont &oc)
Adds configuration options to the given container.
Definition: SystemFrame.cpp:39
Option_Bool
Definition: Option.h:538
OptionsCont.h
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:57
ROFrame.h
SystemFrame::addReportOptions
static void addReportOptions(OptionsCont &oc)
Adds reporting options to the given container.
Definition: SystemFrame.cpp:64
OptionsCont::addDescription
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
Definition: OptionsCont.cpp:469
AGFrame::fillOptions
static void fillOptions()
Inserts options used by ActivityGen into the OptionsCont singleton.
Definition: AGFrame.cpp:44
SystemFrame.h
OptionsCont::addSynonyme
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:95
AGFrame::checkOptions
static bool checkOptions()
Checks set options from the OptionsCont singleton for being valid for usage within ActivityGen.
Definition: AGFrame.cpp:90
OptionsCont::doRegister
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Definition: OptionsCont.cpp:74
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
RODUAFrame.h
OptionsCont::addOptionSubTopic
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
Definition: OptionsCont.cpp:519
OptionsCont::addCallExample
void addCallExample(const std::string &example, const std::string &desc)
Add a call example.
Definition: OptionsCont.cpp:495
config.h
Option_FileName
Definition: Option.h:783
RandHelper::insertRandOptions
static void insertRandOptions()
Initialises the given options container with random number options.
Definition: RandHelper.cpp:45
RandHelper.h
StdDefs.h
Option_Integer
An integer-option.
Definition: Option.h:331
AGFrame.h