bool SynchroObserver::observe(map<string,Group3D*> g3D,map<string,Group2D*> g2D,map<string,Group1D*> g1D, map<string,GroupSwitch*> gs) { bool res = false; vector<int>::iterator nit = _timeDoneObserver.begin(); vector<float>::iterator thit = _thresholds.begin(); for(vector<Observer*>::iterator oit = _observers.begin();oit != _observers.end();oit++){ int count = 0; (*oit)->observe(g3D,g2D,g1D,gs); map<string,float> probas = (*oit)->getProbabilities(); for(map<string,float>::iterator pit = probas.begin();pit != probas.end();pit++){ if(pit->second > *thit) count++; } res = res || (count >= *nit); nit++; thit++; } if(res){ updateProbability("0",1.0); _lastProbaOne = _timestamp; } else{ if(_timestamp - _lastProbaOne > _timeToSwitch) updateProbability("0",0.0); else updateProbability("0",1.0); } return true; }
void BinomialDistTab::on_nSpinBox_valueChanged(int n) { binPlotter->setN(n); binPlotter->setXMax(n); binPlotter->setXMin(-1); binPlotter->update(); kminSpinBox->setMaximum(n); kmaxSpinBox->setMaximum(n); updateProbability(); }
void BinomialDistTab::on_kmaxSpinBox_valueChanged(int) { if(kminSpinBox->value() > kmaxSpinBox->value() || joinCheckBox->isChecked()) kminSpinBox->setValue(kmaxSpinBox->value()); binPlotter->setKMax(kmaxSpinBox->value()); updateProbability(); binPlotter->update(); }
void BinomialDistTab::on_pDSpinBox_valueChanged(double p) { binPlotter->setP(p); updateProbability(); binPlotter->update(); }
BinomialDistTab::BinomialDistTab(QWidget* parent) : QWidget(parent) { setupUi(this); binPlotter->setOptions(// Plotter::ZoomFixHorizontal | Plotter::AutoTicksX | Plotter::AutoTicksY); updateProbability(); }