void PerformanceEvaluator::EvaluateIntermediate(pair<StateVector,StateCovarianceMatrix> estimate,
                                                double MOD2PR,
                                                MeasurementVector z,
                                                StateVector x) {
  SVref xEst = estimate.first;
  SCMref P = estimate.second;
  SVref xReal = x;
  StateVector zTemp;
  zTemp << z(0),0,z(1),0,0;

  for(auto v:_performanceValueTuples) {
    string key = v.first;
    VecPtr vec = get<0>(v.second);//get the vector
    PerformanceFunction f = get<1>(v.second);//get the performance function
    if (_runCount == 0) {
      if(key == "MOD2PR"){vec->push_back(MOD2PR);}
      else if(key=="RAWRMSPOS"){vec->push_back(f(zTemp,P,xReal));}
      else{vec->push_back(f(xEst, P, xReal));}
    }
    else {
      if(key == "MOD2PR"){(*vec)[_sampleCount]+=MOD2PR;}
      else if(key=="RAWRMSPOS"){(*vec)[_sampleCount]+=f(zTemp,P,xReal);}
      else{ (*vec)[_sampleCount] += f(xEst, P, xReal);} //then we can perform addition assignment
    }
  }
  _sampleCount++;
}
Пример #2
0
std::vector<Ptr> IMFT<Ptr>::getUnmatchedPtrs()
{
    VecPtr unmatchedPtrs;
    if(cnt < m_nWindow) return unmatchedPtrs;
    for(ListGraph::NodeIt n(m_g); n != INVALID; ++n){
        if((*m_gNodeMap)[n].nFrame == cnt && (*m_gNodeMap)[n].isIn){
            int eId = (*m_gNodeMap)[n].edgeID;
            if(eId < 0){
                unmatchedPtrs.push_back((*m_gNodeMap)[n].ptr);
            }
        }
    }
    return unmatchedPtrs;
}
Пример #3
0
        bool Overlay::process_batch_command (const std::string& cmd, const std::string& args)
        {

          // BATCH_COMMAND overlay.load path # Loads the specified image on the overlay tool.
          if (cmd == "overlay.load") {
            VecPtr<MR::Image::Header> list;
            try { list.push_back (new MR::Image::Header (args)); }
            catch (Exception& e) { e.display(); }
            add_images (list);
            return true;
          }

          // BATCH_COMMAND overlay.opacity value # Sets the overlay opacity to floating value [0-1].
          else if (cmd == "overlay.opacity") {
            try {
              float n = to<float> (args);
              opacity_slider->setSliderPosition(int(1.e3f*n));
            }
            catch (Exception& e) { e.display(); }
            return true;
          }

          return false;
        }