creativity  v1.3.0
Agent-based model of creativity and piracy
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
creativity::cmdargs::GUI Class Reference

CmdArgs/Simulator subclass for graphical simulator command-line arguments. More...

#include <creativity/cmdargs/GUI.hpp>

Public Member Functions

 GUI (CreativitySettings &s)
 Constructor for gui simulation arguments; takes the settings object.
 
virtual std::string usage () const override
 Overridden to add " [FILE-TO-LOAD]".
 
virtual std::string help () const override
 Overridden to add information about FILE-TO-LOAD.
 
virtual std::string versionSuffix () const override
 Overridden to add " -- graphical simulator and simulation viewer".
 
- 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.
 

Public Attributes

bool start = false
 Whether to start running the simulation in the GUI right away.
 
bool initialize = false
 Whether to initialize (but not start) the simulation in the GUI right away. More...
 
std::string input
 The input file (for the GUI)
 
bool memory = false
 If true, decompress loaded files and store simulation data in an in-memory buffer.
 
- 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 GUI command-line options into the option descriptions.
 
virtual void postParse (boost::program_options::variables_map &vars) override
 Overridden to handle –initialize and –start options.
 
- 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.
 
CreativitySettingss_
 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.
 

Detailed Description

CmdArgs/Simulator subclass for graphical simulator command-line arguments.

Member Data Documentation

§ initialize

bool creativity::cmdargs::GUI::initialize = false

Whether to initialize (but not start) the simulation in the GUI right away.

Has no effect if start is true.

Inheritance diagram for creativity::cmdargs::GUI:
[legend]
Collaboration diagram for creativity::cmdargs::GUI:
[legend]

The documentation for this class was generated from the following file: