class Gambit::ModelParameters
[No description available]
Public Functions
Name | |
---|---|
ModelParameters() Default constructor. | |
ModelParameters(const std::vector< std::string > & paramlist) Constructor using vector of strings. | |
ModelParameters(const char ** paramlist) Constructor using array of char arrays. | |
double | getValue(std::string const & inkey) const Get value of named parameter. |
bool | has(const std::string & inkey) const Check if a parameter exists in this object. |
const std::map< std::string, double > & | getValues() const Get values of all parameters. |
std::map< std::string, double >::const_iterator | begin() const Get a const iterator to the first parameter map entry. |
std::map< std::string, double >::const_iterator | end() const Get a const iterator to the last parameter map entry. |
int | getNumberOfPars() const Get number of parameters stored in this object. |
const double & | operator[](std::string const & inkey) const Get parameter value using bracket operator. |
const double & | at(std::string const & inkey) const Get parameter value using ‘at’ syntax. |
void | setValue(std::string const & inkey, double const & value) Set single parameter value. |
void | setValues(std::map< std::string, double > const & params_map, bool missing_is_error =true) Set many parameter values using a map. |
void | setValues(ModelParameters const & donor, bool missing_is_error =true) Set many parameter values using another ModelParameters object. |
std::vector< std::string > | getKeys() const Get parameter keys (names), probably for external iteration. |
void | print() const Dump parameter names and values to stdout (should be for debugging only) |
void | _definePar(const std::string & newkey) Define a parameter with name, value (i.e. add to internal map). Value is initialised to zero. |
void | _definePars(const std::vector< std::string > & v) Define many new parameters at once via a vector of names. |
void | _definePars(const char ** array) Define many new parameters at once via an array of char arrays. |
std::string | getModelName() const Getters/setters for model and output names. |
std::string | getOutputName() const |
void | setModelName(const std::string & in) |
void | setOutputName(const std::string & in) |
Protected Functions
Name | |
---|---|
void | assert_contains(std::string inkey) const Checks if this model container holds a parameter match the supplied name. |
Friends
Name | |
---|---|
std::ostream & | operator«(std::ostream & strm, const ModelParameters & me) Dump parameter names and values to stream (again for debugging only I think) |
Public Functions Documentation
function ModelParameters
ModelParameters()
Default constructor.
function ModelParameters
ModelParameters(
const std::vector< std::string > & paramlist
)
Constructor using vector of strings.
function ModelParameters
ModelParameters(
const char ** paramlist
)
Constructor using array of char arrays.
function getValue
double getValue(
std::string const & inkey
) const
Get value of named parameter.
function has
bool has(
const std::string & inkey
) const
Check if a parameter exists in this object.
function getValues
const std::map< std::string, double > & getValues() const
Get values of all parameters.
function begin
std::map< std::string, double >::const_iterator begin() const
Get a const iterator to the first parameter map entry.
function end
std::map< std::string, double >::const_iterator end() const
Get a const iterator to the last parameter map entry.
function getNumberOfPars
int getNumberOfPars() const
Get number of parameters stored in this object.
function operator[]
const double & operator[](
std::string const & inkey
) const
Get parameter value using bracket operator.
function at
const double & at(
std::string const & inkey
) const
Get parameter value using ‘at’ syntax.
Get parameter value using ‘at’ operator This is no different to the bracket operator method, since keys cannot be added with the bracket method anyhow, but for people who are used to maps it is nice to have.
function setValue
void setValue(
std::string const & inkey,
double const & value
)
Set single parameter value.
function setValues
void setValues(
std::map< std::string, double > const & params_map,
bool missing_is_error =true
)
Set many parameter values using a map.
function setValues
void setValues(
ModelParameters const & donor,
bool missing_is_error =true
)
Set many parameter values using another ModelParameters object.
function getKeys
std::vector< std::string > getKeys() const
Get parameter keys (names), probably for external iteration.
function print
void print() const
Dump parameter names and values to stdout (should be for debugging only)
function _definePar
void _definePar(
const std::string & newkey
)
Define a parameter with name, value (i.e. add to internal map). Value is initialised to zero.
function _definePars
void _definePars(
const std::vector< std::string > & v
)
Define many new parameters at once via a vector of names.
function _definePars
void _definePars(
const char ** array
)
Define many new parameters at once via an array of char arrays.
function getModelName
std::string getModelName() const
Getters/setters for model and output names.
function getOutputName
std::string getOutputName() const
function setModelName
void setModelName(
const std::string & in
)
function setOutputName
void setOutputName(
const std::string & in
)
Protected Functions Documentation
function assert_contains
void assert_contains(
std::string inkey
) const
Checks if this model container holds a parameter match the supplied name.
ModelParameters class member function definitions.
Checks if this model container holds a parameter matching the supplied name
Friends
friend operator«
friend std::ostream & operator<<(
std::ostream & strm,
const ModelParameters & me
);
Dump parameter names and values to stream (again for debugging only I think)
Updated on 2024-07-18 at 13:53:30 +0000