creativity  v1.3.0
Agent-based model of creativity and piracy
SeriesGraphs.hpp
1 #pragma once
2 #include "creativity/cmdargs/CmdArgs.hpp"
3 #include "creativity/data/graph/Series.hpp"
4 #include <limits>
5 #include <string>
6 #include <vector>
7 #include <set>
8 
9 namespace creativity { namespace cmdargs {
10 
13 class SeriesGraphs : public CmdArgs {
14  public:
16  SeriesGraphs();
17 
30  std::string levels = "median,0.5,0.9,0.95";
31 
33  bool per_t_confidence = true;
34 
39  std::vector<std::string> input;
40 
48  std::string output = "series-plots.pdf";
49 
52  bool overwrite = false;
53 
65  std::string title = "%w (%u)";
66 
68  double width = 6;
69 
71  double height = 4;
72 
77  int graph_min_t = -1;
78 
83  int graph_max_t = -1;
84 
94  int data_min_t = 1;
95 
101  int data_max_t = -1;
102 
106  std::vector<int> t_extra;
107 
111  double graph_min_value = std::numeric_limits<double>::quiet_NaN();
112 
116  double graph_max_value = std::numeric_limits<double>::quiet_NaN();
117 
132  bool same_horizontal_scale = false;
133 
142  bool same_vertical_scale = true;
143 
146 
150  double legend_rel_x = 1;
151 
155  double legend_rel_y = 0;
156 
160 
167  double resolution = 96;
168 
170  virtual void postParse(boost::program_options::variables_map &vars) override;
171 
173  virtual std::string usage() const override;
174 
176  virtual std::string help() const override;
177 
179  virtual std::string versionSuffix() const override;
180 
181  protected:
183  virtual void addOptions() override;
184 };
185 
186 }}
187 
std::string title
The title for the graph, with possible substitutions:
Definition: SeriesGraphs.hpp:65
This class handles command line argument parsing.
Definition: CmdArgs.hpp:31
int data_max_t
The maximum t value to display in the graph.
Definition: SeriesGraphs.hpp:101
bool overwrite
Whether to overwrite the output file(s) if it (they) exist.
Definition: SeriesGraphs.hpp:52
virtual std::string usage() const override
Overridden to add " FILE [FILE ...]".
CmdArgs subclass for creativity-series-plots arguments (for plotting quantiles from series and/or qua...
Definition: SeriesGraphs.hpp:13
Primary namespace for all Creativity library code.
Definition: config.hpp:4
double legend_rel_x
The legend relative x value.
Definition: SeriesGraphs.hpp:150
bool same_horizontal_scale
Determines what happens when input series have different maximum time periods, and graph_max_t is set...
Definition: SeriesGraphs.hpp:132
bool per_t_confidence
If true, we&#39;re in per-t confidence mode. If false, we&#39;re in per-source file confidence mode...
Definition: SeriesGraphs.hpp:33
virtual void addOptions() override
Adds series command-line options into the option descriptions.
double graph_max_value
Determines the maximum value to include in the series plot.
Definition: SeriesGraphs.hpp:116
creativity::data::graph::Series::LegendPosition legend_position
The legend position.
Definition: SeriesGraphs.hpp:145
int graph_min_t
The t value at which to start the graph display.
Definition: SeriesGraphs.hpp:77
double width
The width of the resulting graph, in inches.
Definition: SeriesGraphs.hpp:68
std::vector< int > t_extra
Draw heavier graph t grid marks at these points.
Definition: SeriesGraphs.hpp:106
virtual void postParse(boost::program_options::variables_map &vars) override
Overridden to handle t-min/t-max options.
SeriesGraphs()
Constructor for series arguments; takes no arguments.
virtual std::string help() const override
Overridden to add info about input files.
bool same_vertical_scale
Controls vertical axes when graph_min_value or graph_max_value are not set to finite values...
Definition: SeriesGraphs.hpp:142
std::string legend_position_input
The input string, such as "top-left", "outside-center", etc.
Definition: SeriesGraphs.hpp:159
double legend_rel_y
The legend relative y value.
Definition: SeriesGraphs.hpp:155
The legend goes to the right of the graph.
double resolution
The resolution (pixels per inch) for PNG output.
Definition: SeriesGraphs.hpp:167
int graph_max_t
The t value at which to end the graph display.
Definition: SeriesGraphs.hpp:83
double height
The height of the resulting graph, in inches.
Definition: SeriesGraphs.hpp:71
LegendPosition
The possible general positions of the legend.
Definition: Series.hpp:236
std::vector< std::string > input
The input files (series or quantiles) to plot.
Definition: SeriesGraphs.hpp:39
virtual std::string versionSuffix() const override
Overridden to add " -- simulation data series generator".
std::string output
The output filename, which must end in ".pdf", ".png", or ".svg".
Definition: SeriesGraphs.hpp:48
double graph_min_value
Determines the minimum value to include in the series plot.
Definition: SeriesGraphs.hpp:111
std::string levels
The confidence levels to plot as a comma-separated list.
Definition: SeriesGraphs.hpp:30
int data_min_t
The minimum t value required to actually include an observation in the graph.
Definition: SeriesGraphs.hpp:94