creativity  v1.3.0
Agent-based model of creativity and piracy
Series.hpp
1 #pragma once
2 #include "creativity/cmdargs/CmdArgs.hpp"
3 #include <eris/types.hpp>
4 #include <limits>
5 #include <string>
6 #include <vector>
7 
8 namespace creativity { namespace cmdargs {
9 
11 class Series : public CmdArgs {
12  public:
14  Series();
15 
18  std::string series = "net_u,reader_spending,reader_market_spending,reader_piracy_spending,reader_public_spending,reader_spending_total,books_bought,books_pirated,books_public_copies,books_written_pc,book_quality,book_sales,book_revenue,book_profit,book_author_effort,book_author_scale,book_p0";
19 
21  bool help_series = false;
22 
26  eris::eris_time_t periods = 0;
27 
29  bool allow_unused_periods = false;
30 
36  eris::eris_time_t piracy_begins = 0;
37 
43  eris::eris_time_t policy_begins = 0;
44 
46  bool ignore_errors = false;
47 
49  unsigned int double_precision = std::numeric_limits<double>::max_digits10;
50 
52  unsigned int threads = 0;
53 
55  unsigned int preload = 0;
56 
58  std::vector<std::string> input;
59 
61  bool memory_xz = false;
62 
66  std::string tmpdir;
67 
71  std::string output_dir;
72 
74  virtual std::string usage() const override;
75 
77  virtual std::string help() const override;
78 
80  virtual std::string versionSuffix() const override;
81 
82  protected:
84  virtual void addOptions() override;
85 
88  virtual void postParse(boost::program_options::variables_map &vars) override;
89 };
90 
91 }}
This class handles command line argument parsing.
Definition: CmdArgs.hpp:31
std::vector< std::string > input
The input files to load data from.
Definition: Series.hpp:58
Primary namespace for all Creativity library code.
Definition: config.hpp:4
bool help_series
A plea for help about possible series values.
Definition: Series.hpp:21
bool memory_xz
If true, decompress xz files into memory.
Definition: Series.hpp:61
eris::eris_time_t periods
The number of periods.
Definition: Series.hpp:26
virtual std::string versionSuffix() const override
Overridden to add " -- simulation data series generator".
virtual std::string help() const override
Overridden to add info about input files.
std::string tmpdir
If memory_xz is false, decompress files into temporary files in this directory instead of into the sa...
Definition: Series.hpp:66
std::string output_dir
The output directory; each variable VAR will be written to a "series-VAR.csv" file in the directory...
Definition: Series.hpp:71
bool allow_unused_periods
Whether files are allowed to contain more than periods periods.
Definition: Series.hpp:29
unsigned int threads
Number of threads to use.
Definition: Series.hpp:52
CmdArgs subclass for creativity-series arguments (for generating series values from crstate files)...
Definition: Series.hpp:11
std::string series
comma-separated list of series to display
Definition: Series.hpp:18
virtual void addOptions() override
Adds series command-line options into the option descriptions.
unsigned int double_precision
The precision of double values. The default is full double precision.
Definition: Series.hpp:49
bool ignore_errors
If true, just warn instead of aborting for files that can&#39;t be read or contain invalid period values...
Definition: Series.hpp:46
eris::eris_time_t piracy_begins
The piracy begins period.
Definition: Series.hpp:36
eris::eris_time_t policy_begins
The policy begins period.
Definition: Series.hpp:43
unsigned int preload
Number of files to preload from disk into memory.
Definition: Series.hpp:55
Series()
Constructor for series arguments; takes no arguments.
virtual std::string usage() const override
Overridden to add " FILE [FILE ...]".
virtual void postParse(boost::program_options::variables_map &vars) override
Overridden to make sure an output directory is given.