/* * RandomNumberDistribution_Parameters.hpp * * Created on: Jan 6, 2011 * Author: heber */ #ifndef RANDOMNUMBERDISTRIBUTION_PARAMETERS_HPP_ #define RANDOMNUMBERDISTRIBUTION_PARAMETERS_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include class RandomNumberDistribution; struct RandomNumberDistribution_Parameters { /** Constructor of class RandomNumberDistribution_Parameters. * * @note sets all values to noset_value. */ RandomNumberDistribution_Parameters(); /** Copy constructor of class RandomNumberDistribution_Parameters. * * * @param _ref reference to instance to copy */ RandomNumberDistribution_Parameters(const RandomNumberDistribution_Parameters &_ref); /** Destructor of class RandomNumberDistribution_Parameters. * */ ~RandomNumberDistribution_Parameters(); enum ParamList { param_min, param_max, param_p, param_t, param_median, param_sigma, param_alpha, param_mean, param_a, param_b, param_c, param_lambda }; /** This value is chosen such that no parameter can have it as a sensible * value. */ static const double noset_value; /** Fills the structure from the parameters obtained from \a _distribution. * * @param _distribution */ void getParameters(const RandomNumberDistribution* const _distribution); /** Merges this parameter set with another, where other has priority. * * @note we ignore entries in \a _params with noset_value. * * @param _params other parameter set to update with */ void update(const RandomNumberDistribution_Parameters &_params); /** Checks whether all parameters are set to noset_value values. * * noset_value * * @return true - all are equal noset_value, * false - at least is not equal noset_value */ bool isDefault() const; double min; //!< minimum of distribution double max; //!< minimum of distribution double p; //!< probability of distribution double t; //!< parameter t of distribution double median; //!< median of distribution double sigma; //!< sigma width of distribution double alpha; //!< parameter alpha of distribution double mean; //!< mean of distribution double a; //!< triangle parameter a double b; //!< triangle parameter b double c; //!< triangle parameter c double lambda; //!< exponential decay parameter of distribution typedef std::map< std::string, ParamList > ParamNames; static ParamNames params; }; std::ostream & operator << (std::ostream& ost, const RandomNumberDistribution_Parameters ¶ms); std::istream & operator >> (std::istream& ist, RandomNumberDistribution_Parameters ¶ms); #endif /* RANDOMNUMBERDISTRIBUTION_PARAMETERS_HPP_ */