31 std::srand(std::time(NULL));
43 if (this->
min > _mean || this->
max < _mean)
53 double _mu,
double _noise)
57 if (_min > _mean || _max < _mean)
61 if (_mu < 0 || _mu > 1)
77 double random =
static_cast<double>(
static_cast<double>(rand()) / RAND_MAX)
80 if (this->
var >= this->
max)
82 if (this->var <= this->
min)
84 this->lastUpdate = _time;
91 gzmsg <<
"\tMean = " << this->
mean << std::endl
92 <<
"\tMin. Limit = " << this->
min << std::endl
93 <<
"\tMax. Limit = " << this->
max << std::endl
94 <<
"\tMu = " << this->
mu << std::endl
95 <<
"\tNoise Amp. = " << this->
noiseAmp << std::endl;
GaussMarkovProcess()
Class constructor.
Implementation of a Gauss-Markov process model.
double min
Minimum limit for the process variable.
double Update(double _time)
Update function for a new time stamp.
double noiseAmp
Gaussian white noise amplitude.
void Print()
Print current model paramters.
void Reset()
Resets the process parameters.
bool SetMean(double _mean)
Set mean process value.
bool SetModel(double _mean, double _min, double _max, double _mu=0, double _noise=0)
Sets all the necessary parameters for the computation.
double mean
Mean process value.
double max
Maximum limit for the process variable.
double var
Process variable.
double mu
Process constant, if zero, process becomes a random walk.
double lastUpdate
Timestamp for the last update.