Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
Loading...
Searching...
No Matches
Fauna::param_out_of_range Struct Reference

Exception if an integer or double parameter is out of range. More...

#include <insfile_reader.h>

Inheritance diagram for Fauna::param_out_of_range:

Public Member Functions

 param_out_of_range (const std::string &key, const std::string &value, const std::string &allowed_interval)
 Constructor for a double value. More...
 

Detailed Description

Exception if an integer or double parameter is out of range.

Usually the functions Hft::is_valid() and Parameters::is_valid() are responsible for checking the bounds of a parameter. Use this exception only if the data type of the Hft or Parameters member variable does not allow being assigned the user-specified value.

Constructor & Destructor Documentation

◆ param_out_of_range()

Fauna::param_out_of_range::param_out_of_range ( const std::string &  key,
const std::string &  value,
const std::string &  allowed_interval 
)
inline

Constructor for a double value.

Parameters
keyThe fully qualified TOML key.
valueThe given (invalid) value. Use std::to_string() to convert from double or integer to string.
allowed_intervalThe permitted range of the parameter in mathematical notation. For example [0,1) allows values between zero and one, including zero, but excluding one. Use the infinity symbol, ∞, for intervals not bound on one side.

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