private void PrepareEstimator()
        {
            _estimator = new LMEstimator();

            //liczmy stddev

            double sum     = 0;
            double howmany = 0;

            foreach (var data in _data)
            {
                _estimator.SetCoeffs(data.GetCoeffsData());
                foreach (DataEntry dataEntry in data.GetData())
                {
                    double real = dataEntry.GetValue("TIME");
                    double esti = _estimator.EstimateValue(dataEntry);
                    double temp = Math.Pow((real - esti), 2);
                    sum     += temp;
                    howmany += 1.0;
                }
            }

            double std = sum / (howmany - 2);

            _estimator.SetStd(std);
        }
示例#2
0
        private void PrepareTasks()
        {
            _allTasks = new Queue <ITask>();
            foreach (var data in _data)
            {
                _estimator.SetCoeffs(data.GetCoeffsData());

                foreach (var datanerty in data.GetData())
                {
                    var task = new BasicTask();
                    task.RealTime      = (int)Math.Round(datanerty.GetValue("TIME"));
                    task.EstimatedTime = (int)Math.Round(_estimator.EstimateValue(datanerty));

                    _allTasks.Enqueue(task);
                }
            }
        }