Fixed comments. Now inputs in parser should be in milliseconds, second isn't a precise enough unit.

This commit is contained in:
Benjamin BOUVIER 2012-08-31 22:37:47 -04:00
commit a3a04e0112

View file

@ -46,9 +46,10 @@ class Distribution : public std::vector< type >
*/ */
virtual int next_element() = 0; virtual int next_element() = 0;
// Idea for function name: enlarge_your_parser
/** /**
* @brief Creates params and retrieves values from parser * @brief Creates params and retrieves values from parser
*
* Parser's params should take milliseconds as inputs.
*/ */
virtual void make_parser( eoParser & parser ) = 0; virtual void make_parser( eoParser & parser ) = 0;
@ -56,7 +57,7 @@ class Distribution : public std::vector< type >
* @brief Returns true if this distribution has been activated by the * @brief Returns true if this distribution has been activated by the
* command line. * command line.
* *
* Serves to main program to check if at least one distribution has been * Used by the main program so as to check if at least one distribution has been
* activated. * activated.
*/ */
bool isActive() { return _active; } bool isActive() { return _active; }
@ -78,13 +79,13 @@ class UniformDistribution : public Distribution
void make_parser( eoParser & parser ) void make_parser( eoParser & parser )
{ {
_active = parser.createParam( false, "uniform", "Uniform distribution", '\0', "Uniform").value(); _active = parser.createParam( false, "uniform", "Uniform distribution", '\0', "Uniform").value();
_min = parser.createParam( 0.0, "uniform-min", "Minimum for uniform distribution", '\0', "Uniform").value(); _min = parser.createParam( 0.0, "uniform-min", "Minimum for uniform distribution, in ms.", '\0', "Uniform").value();
_max = parser.createParam( 1.0, "uniform-max", "Maximum for uniform distribution", '\0', "Uniform").value(); _max = parser.createParam( 1.0, "uniform-max", "Maximum for uniform distribution, in ms.", '\0', "Uniform").value();
} }
int next_element() int next_element()
{ {
return std::floor( 1000. * _rng.uniform( _min, _max ) ); return std::floor( _rng.uniform( _min, _max ) );
} }
protected: protected: