SUMO - Simulation of Urban MObility
AGFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // Configuration of the options of ActivityGen
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
14 // activitygen module
15 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
16 /****************************************************************************/
17 //
18 // This file is part of SUMO.
19 // SUMO is free software: you can redistribute it and/or modify
20 // it under the terms of the GNU General Public License as published by
21 // the Free Software Foundation, either version 3 of the License, or
22 // (at your option) any later version.
23 //
24 /****************************************************************************/
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #ifdef HAVE_VERSION_H
37 #include <version.h>
38 #endif
39 
40 #include "AGFrame.h"
41 #include <utils/common/StdDefs.h>
42 #include <router/ROFrame.h>
43 #include <duarouter/RODUAFrame.h>
47 
48 
49 // ===========================================================================
50 // method definitions
51 // ===========================================================================
54  // Options handling
55  oc.addCallExample("--net-file <INPUT>.net.xml --stat-file <INPUT>.stat.xml --output <OUTPUT>.rou.xml --rand",
56  "generate a trips file from a stats file on a given net using arbitrary random seed");
57  oc.addCallExample("--net-file <INPUT>.net.xml --stat-file <INPUT>.stat.xml --output <OUTPUT>.rou.xml --duration-d <NBR_OF_DAYS>",
58  "generate a trips file from a stats file on a given net for numerous days (with fixed random seed)");
59 
60  // Add categories and insert the standard options
62  oc.addOptionSubTopic("Input");
63  oc.addOptionSubTopic("Output");
64  oc.addOptionSubTopic("Processing");
65  oc.addOptionSubTopic("Time");
68 
69  // Insert options
70  oc.doRegister("net-file", 'n', new Option_FileName());
71  oc.addSynonyme("net-file", "net");
72  oc.addDescription("net-file", "Input", "Use FILE as SUMO-network to create trips for");
73 
74  oc.doRegister("stat-file", 's', new Option_FileName());
75  oc.addDescription("stat-file", "Input", "Loads the SUMO-statistics FILE");
76 
77  oc.doRegister("output-file", 'o', new Option_FileName());
78  oc.addSynonyme("output-file", "output", true);
79  oc.addDescription("output-file", "Output", "Write generated trips to FILE");
80 
81  oc.doRegister("debug", new Option_Bool(false));
82  oc.addDescription("debug", "Report",
83  "Detailed messages about every single step");
84 
85  // TODO: What time options are consistent with other parts of SUMO and
86  // useful for the user?
87  oc.doRegister("begin", 'b', new Option_Integer(0));
88  oc.addDescription("begin", "Time", "Sets the time of beginning of the simulation during the first day (in seconds)");
89 
90  oc.doRegister("end", 'e', new Option_Integer(0));
91  oc.addDescription("end", "Time", "Sets the time of ending of the simulation during the last day (in seconds)");
92 
93  oc.doRegister("duration-d", new Option_Integer(1));
94  oc.addDescription("duration-d", "Time", "Sets the duration of the simulation in days");
95 }
96 
97 
99  return true;
100 }
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Definition: OptionsCont.cpp:86
static void insertRandOptions()
Initialises the given options container with random number options.
Definition: RandHelper.cpp:53
static void addReportOptions(OptionsCont &oc)
Adds reporting options to the given container.
Definition: SystemFrame.cpp:75
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:50
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:69
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:313
A storage for options typed value containers)
Definition: OptionsCont.h:99
static bool checkOptions()
Checks set options from the OptionsCont singleton for being valid for usage within ActivityGen...
Definition: AGFrame.cpp:98
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:52