|
creativity
v1.3.0
Agent-based model of creativity and piracy
|
CmdArgs subclass for command-line simulator command-line arguments. More...
#include <creativity/cmdargs/CLI.hpp>
Public Member Functions | |
| CLI (CreativitySettings &s) | |
| Constructor for cli simulation arguments; takes the settings object. | |
| virtual std::string | versionSuffix () const override |
| Overridden to add " -- command-line simulator". | |
Public Member Functions inherited from creativity::cmdargs::CmdArgs | |
| void | parse (int argc, char const *const *argv) |
| Parses options and verifies them. More... | |
| template<typename T , typename A > | |
| std::enable_if< not std::is_unsigned< T >::value, boost::program_options::typed_value< std::vector< T, A > > * >::type | value (std::vector< T, A > &store) |
| Takes a std::vector of values for options that store multiple values. More... | |
| template<typename T , typename A > | |
| std::enable_if< std::is_unsigned< T >::value, boost::program_options::typed_value< std::vector< Validation< T > > > * >::type | value (std::vector< T, A > &store) |
| Takes a std::vector of values for options that store multiple values. More... | |
| virtual std::string | version () const |
| Returns a version string. | |
| virtual std::string | usage () const |
| Returns a usage string such as "Usage: program [ARGS]". More... | |
| virtual std::string | help () const |
| Returns a argument help message. | |
Public Attributes | |
| bool | quiet = false |
| Set to tell cli to shut up (typically when running in batch mode) | |
| bool | memory = false |
| Whether to use in-memory file instead of a temporary file. | |
| bool | overwrite = false |
| Whether `output' can be overwritten. | |
Public Attributes inherited from creativity::cmdargs::Simulator | |
| unsigned int | periods = 300 |
| The number of periods to run the simulation. More... | |
| std::string | policy |
| Stores the –policy= argument given. | |
| std::string | output |
| The output file for simulation results; default is "creativity-SEED.crstate" for the CLI, unset for the GUI. | |
| std::string | tmpdir |
| The temporary directory for results. If empty, use output file dirname. | |
| unsigned int | threads = 0 |
| The number of threads to use. More... | |
| eris::random::rng_t::result_type | seed = eris::random::seed() |
| The seed. More... | |
Protected Member Functions | |
| virtual void | addOptions () override |
| Adds CLI command-line options into the option descriptions. | |
| virtual void | postParse (boost::program_options::variables_map &vars) override |
| Overridden to handle –overwrite option. | |
Protected Member Functions inherited from creativity::cmdargs::Simulator | |
| Simulator ()=delete | |
| Default constructor deleted. | |
| Simulator (CreativitySettings &cs) | |
| Constructs a Simulator object that stores values in the given CreativitySettings object. | |
| void | addOptions () override |
| Adds common options into the options descriptions. More... | |
Protected Member Functions inherited from creativity::cmdargs::CmdArgs | |
| CmdArgs ()=default | |
| Default constructor is protected; use a suitable subclass. | |
Additional Inherited Members | |
Static Public Member Functions inherited from creativity::cmdargs::CmdArgs | |
| template<typename T > | |
| static std::enable_if< not std::is_unsigned< T >::value and not std::is_same< T, bool >::value, boost::program_options::typed_value< T > *>::type | value (T &store) |
| Creates an option value object without any special validation wrapper class. More... | |
| template<typename T > | |
| static std::enable_if< std::is_unsigned< T >::value and not std::is_same< T, bool >::value, boost::program_options::typed_value< Validation< T > > * >::type | value (T &storage) |
| Creates an option value object around an unsigned primitive type, with automatic value storage and default value. More... | |
| static boost::program_options::typed_value< bool > * | value (bool &store) |
Creates an option value for a boolean value, that is, for an switch without an argument, with default value as given in store. | |
| template<typename V > | |
| static boost::program_options::typed_value< V > * | value (typename V::value_type &store) |
| Creates an option value object with explicit validation wrapper class V. More... | |
| template<typename V , typename A > | |
| static boost::program_options::typed_value< std::vector< V > > * | value (std::vector< typename V::value_type, A > &store) |
| Creates an option value object around a vector of options with validation wrapper class V applied to each element of the vector. More... | |
| template<long minimum, long denom = 1, typename T > | |
| static boost::program_options::typed_value< Min< T, minimum, denom > > * | min (T &store) |
Shortcut for value<Min<T, n, d>>(val) with T last (so that it can be inferred from val) | |
| template<long maximum, long denom = 1, typename T > | |
| static boost::program_options::typed_value< Max< T, maximum, denom > > * | max (T &store) |
Shortcut for value<Max<T, n, d>>(val) with T last (so that it can be inferred from val) | |
| template<long min, long max, long denom = 1, typename T > | |
| static boost::program_options::typed_value< Range< T, min, max, denom > > * | range (T &store) |
Shortcut for value<Range<T, a, b, d>>(val) with T last (so that it can be inferred from val) | |
| template<long lower, long denom = 1, typename T > | |
| static boost::program_options::typed_value< Above< T, lower, denom > > * | above (T &store) |
Shortcut for value<Above<T, a, d>>(val) with T last (so that it can be inferred from val) | |
| template<long upper, long denom = 1, typename T > | |
| static boost::program_options::typed_value< Below< T, upper, denom > > * | below (T &store) |
Shortcut for value<Below<T, b, d>>(val) with T last (so that it can be inferred from val) | |
Protected Attributes inherited from creativity::cmdargs::Simulator | |
| boost::program_options::options_description | sim_controls_ {"Simulator controls"} |
| The options (which will be added to the end of options_) containing simulator settings, some of which differ between the CLI and the GUI. | |
| CreativitySettings & | s_ |
| The settings reference in which to store given values. | |
| double | density_ = Creativity::densityFromBoundary(s_.readers, s_.dimensions, s_.boundary) |
| Density pseudo-parameter: the stored value is actually boundary. | |
Protected Attributes inherited from creativity::cmdargs::CmdArgs | |
| std::string | prog_name_ |
| The program name, populated by parse(). More... | |
| boost::program_options::options_description | options_ |
| The options descriptions variable for all options. | |
| boost::program_options::options_description | invisible_ |
| Like options_, but for hidden options that aren't to be displayed in –help output. | |
| boost::program_options::positional_options_description | positional_ |
| Positional options object. | |
CmdArgs subclass for command-line simulator command-line arguments.
1.8.12