COPASI API  4.16.103
Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
CQFittingWidget Class Reference

#include <CQFittingWidget.h>

Inheritance diagram for CQFittingWidget:
Inheritance graph
[legend]
Collaboration diagram for CQFittingWidget:
Collaboration graph
[legend]

Public Slots

void slotConstraintNumberChanged (int number)
 
void slotParameterNumberChanged (int number)
 
- Public Slots inherited from TaskWidget
void adjustTable ()
 
void slotFinishThread ()
 

Public Member Functions

 CQFittingWidget (QWidget *parent=0, const char *name=0)
 
virtual bool runTask ()
 
 ~CQFittingWidget ()
 
- Public Member Functions inherited from TaskWidget
CCopasiTaskgetTask ()
 
virtual bool leave ()
 
 TaskWidget (QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
 
virtual bool update (ListViews::ObjectType objectType, ListViews::Action action, const std::string &key)
 
 ~TaskWidget ()
 
- Public Member Functions inherited from CopasiWidget
 CopasiWidget (QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
 
bool enter (const std::string &key)
 
CCopasiDataModelgetDataModel ()
 
bool getIgnoreUpdates ()
 
virtual void setFramework (int framework)
 
void setIgnoreUpdates (bool v)
 

Protected Slots

void slotCrossValidationData ()
 
void slotExperimentData ()
 
void slotPageChange (QWidget *currentPage)
 
- Protected Slots inherited from TaskWidget
void assistantBtnClicked ()
 
void reportBtnClicked ()
 
void revertBtnClicked ()
 
void runBtnClicked ()
 
- Protected Slots inherited from CopasiWidget
virtual bool protectedNotify (ListViews::ObjectType objectType, ListViews::Action action, const std::string &key="")
 

Protected Member Functions

virtual CCopasiMethodcreateMethod (const CCopasiMethod::SubType &type)
 
virtual bool loadTask ()
 
virtual bool saveTask ()
 
virtual bool taskFinishedEvent ()
 
- Protected Member Functions inherited from TaskWidget
bool commonAfterRunTask ()
 
bool commonBeforeRunTask ()
 
bool commonRunTask ()
 
virtual bool enterProtected ()
 
void finishTask ()
 
bool loadCommon ()
 
bool loadMethod ()
 
bool saveCommon ()
 
bool saveMethod ()
 

Protected Attributes

std::map< std::string,
std::string > 
mCrossValidationKeyMap
 
std::map< std::string,
std::string > 
mExperimentKeyMap
 
size_t mnParamterSetsBeforeRun
 
CCrossValidationSetmpCrossValidationSet
 
CQFittingItemWidgetmpCurrentList
 
CExperimentSetmpExperimentSet
 
- Protected Attributes inherited from TaskWidget
bool mChanged
 
CQTaskBtnWidgetmpBtnWidget
 
CQTaskHeaderWidgetmpHeaderWidget
 
CCopasiMethodmpMethod
 
QGridLayout * mpMethodLayout
 
CQTaskMethodWidgetmpMethodWidget
 
CProgressBarmProgressBar
 
QSpacerItem * mpSpacer1
 
QSpacerItem * mpSpacer2
 
CCopasiTaskmpTask
 
CQTaskThreadmpTaskThread
 
- Protected Attributes inherited from CopasiWidget
int mFramework
 
bool mIgnoreUpdates
 
std::string mKey
 
CCopasiDataModelmpDataModel
 
ListViewsmpListView
 
CCopasiObjectmpObject
 

Private Member Functions

void destroy ()
 
void init ()
 

Detailed Description

Definition at line 26 of file CQFittingWidget.h.

Constructor & Destructor Documentation

CQFittingWidget::CQFittingWidget ( QWidget *  parent = 0,
const char *  name = 0 
)

Definition at line 48 of file CQFittingWidget.cpp.

References init().

49  : TaskWidget(parent, name)
50 {
51  setupUi(this);
52 
53  init();
54 }
TaskWidget(QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
Definition: TaskWidget.cpp:52
CQFittingWidget::~CQFittingWidget ( )

Definition at line 59 of file CQFittingWidget.cpp.

References destroy().

60 {
61  destroy();
62  // no need to delete child widgets, Qt does it all for us
63 }

Member Function Documentation

CCopasiMethod * CQFittingWidget::createMethod ( const CCopasiMethod::SubType type)
protectedvirtual

Implements TaskWidget.

Definition at line 289 of file CQFittingWidget.cpp.

References CFitMethod::createMethod().

290 {return CFitMethod::createMethod(type);}
static COptMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::EvolutionaryProgram)
Definition: CFitMethod.cpp:26
void CQFittingWidget::destroy ( )
private

Definition at line 384 of file CQFittingWidget.cpp.

References mpCrossValidationSet, mpExperimentSet, and pdelete.

Referenced by ~CQFittingWidget().

385 {
388 }
#define pdelete(p)
Definition: copasi.h:215
CExperimentSet * mpExperimentSet
CCrossValidationSet * mpCrossValidationSet
void CQFittingWidget::init ( )
private

Definition at line 348 of file CQFittingWidget.cpp.

References CQFittingItemWidget::FIT_CONSTRAINT, CQFittingItemWidget::FIT_ITEM, TaskWidget::mpBtnWidget, mpCrossValidationSet, mpCurrentList, mpExperimentSet, TaskWidget::mpHeaderWidget, TaskWidget::mpMethodWidget, CQTaskHeaderWidget::setTaskName(), CQTaskMethodWidget::setValidMethods(), CQTaskMethodWidget::showMethodParameters(), slotConstraintNumberChanged(), slotParameterNumberChanged(), and COptTask::ValidMethods.

Referenced by CQFittingWidget().

349 {
350  mpHeaderWidget->setTaskName("Parameter Estimation");
351 
352  verticalLayout->insertWidget(0, mpHeaderWidget);
353  // verticalLayout->insertSpacing(1, 14); // space between header and body
354 
357  verticalLayout->addWidget(mpMethodWidget);
358 
359  verticalLayout->addWidget(mpBtnWidget);
360 
361  mpParameters->setItemType(CQFittingItemWidget::FIT_ITEM);
362  connect(mpParameters, SIGNAL(numberChanged(int)), this, SLOT(slotParameterNumberChanged(int)));
363 
364  mpConstraints->setItemType(CQFittingItemWidget::FIT_CONSTRAINT);
365  connect(mpConstraints, SIGNAL(numberChanged(int)), this, SLOT(slotConstraintNumberChanged(int)));
366 
367  mpCurrentList = mpParameters;
368  mpExperimentSet = NULL;
369  mpCrossValidationSet = NULL;
370 }
CExperimentSet * mpExperimentSet
bool setTaskName(const std::string &name)
static const unsigned int ValidMethods[]
Definition: COptTask.h:50
void slotConstraintNumberChanged(int number)
void showMethodParameters(const bool &show)
CCrossValidationSet * mpCrossValidationSet
CQTaskMethodWidget * mpMethodWidget
Definition: TaskWidget.h:123
CQTaskBtnWidget * mpBtnWidget
Definition: TaskWidget.h:124
CQTaskHeaderWidget * mpHeaderWidget
Definition: TaskWidget.h:122
CQFittingItemWidget * mpCurrentList
void slotParameterNumberChanged(int number)
void setValidMethods(const unsigned int *validMethods)
bool CQFittingWidget::loadTask ( )
protectedvirtual

Implements TaskWidget.

Definition at line 224 of file CQFittingWidget.cpp.

References CQMessageBox::critical(), CCopasiMessage::ERROR, CCopasiMessage::getAllMessageText(), COptProblem::getCalculateStatistics(), CFitProblem::getCreateParameterSets(), CExperimentSet::getExperiment(), CExperimentSet::getExperimentCount(), CCopasiParameterGroup::getGroup(), CCopasiTask::getProblem(), COptProblem::getRandomizeStartValues(), CCopasiMessage::getType(), TaskWidget::loadCommon(), TaskWidget::loadMethod(), TaskWidget::mChanged, mCrossValidationKeyMap, mExperimentKeyMap, mpCrossValidationSet, CopasiWidget::mpDataModel, mpExperimentSet, TaskWidget::mpTask, pdelete, CCopasiMessage::peekLastMessage(), and pTask.

225 {
226  CFitTask * pTask =
227  dynamic_cast< CFitTask * >(mpTask);
228 
229  if (!pTask) return false;
230 
231  loadCommon();
232  loadMethod();
233 
234  CFitProblem * pProblem =
235  dynamic_cast<CFitProblem *>(mpTask->getProblem());
236 
237  if (!pProblem) return false;
238 
240  CExperimentSet * pExperimentSet =
241  dynamic_cast<CExperimentSet *>(pProblem->getGroup("Experiment Set"));
242  mpExperimentSet = new CExperimentSet(*pExperimentSet);
243 
244  mExperimentKeyMap.clear();
245  size_t i, imax = mpExperimentSet->getExperimentCount();
246 
247  for (i = 0; i < imax; i++)
248  mExperimentKeyMap[pExperimentSet->getExperiment(i)->CCopasiParameter::getKey()] =
249  mpExperimentSet->getExperiment(i)->CCopasiParameter::getKey();
250 
252  CCrossValidationSet * pCrossValidationSet =
253  dynamic_cast<CCrossValidationSet *>(pProblem->getGroup("Validation Set"));
254  mpCrossValidationSet = new CCrossValidationSet(*pCrossValidationSet);
255 
256  mCrossValidationKeyMap.clear();
257  imax = mpCrossValidationSet->getExperimentCount();
258 
259  for (i = 0; i < imax; i++)
260  mCrossValidationKeyMap[pCrossValidationSet->getExperiment(i)->CCopasiParameter::getKey()] =
261  mpCrossValidationSet->getExperiment(i)->CCopasiParameter::getKey();
262 
263  mpCheckRandomize->setChecked(pProblem->getRandomizeStartValues());
264  mpCreateParameterSets->setChecked(pProblem->getCreateParameterSets());
265  mpCheckStatistics->setChecked(pProblem->getCalculateStatistics());
266 
267  mpParameters->load(mpDataModel, pProblem->getGroup("OptimizationItemList"), &mExperimentKeyMap, &mCrossValidationKeyMap);
268 
269  if (CCopasiMessage::peekLastMessage().getType() == CCopasiMessage::ERROR)
270  {
271  CQMessageBox::critical(this, "Error loading Parameter estimation task",
273  QMessageBox::Ok | QMessageBox::Default,
274  QMessageBox::NoButton);
275  }
276 
277  mpParameters->setExperimentSet(const_cast<const CExperimentSet *&>(mpExperimentSet));
278  mpParameters->setCrossValidationSet(const_cast<const CCrossValidationSet *&>(mpCrossValidationSet));
279 
280  mpConstraints->load(mpDataModel, pProblem->getGroup("OptimizationConstraintList"), &mExperimentKeyMap, &mCrossValidationKeyMap);
281  mpConstraints->setExperimentSet(const_cast<const CExperimentSet *&>(mpExperimentSet));
282  mpConstraints->setCrossValidationSet(const_cast<const CCrossValidationSet *&>(mpCrossValidationSet));
283 
284  mChanged = false;
285 
286  return true;
287 }
std::map< std::string, std::string > mCrossValidationKeyMap
#define pdelete(p)
Definition: copasi.h:215
CCopasiProblem * getProblem()
bool loadCommon()
Definition: TaskWidget.cpp:247
static std::string getAllMessageText(const bool &chronological=true)
bool loadMethod()
Definition: TaskWidget.cpp:284
CExperimentSet * mpExperimentSet
bool mChanged
Definition: TaskWidget.h:133
CTSSATask * pTask
CCopasiTask * mpTask
Definition: TaskWidget.h:130
CCrossValidationSet * mpCrossValidationSet
CCopasiDataModel * mpDataModel
Definition: copasiWidget.h:65
static StandardButton critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
CCopasiParameterGroup * getGroup(const std::string &name)
if(!yymsg) yymsg
std::map< std::string, std::string > mExperimentKeyMap
bool CQFittingWidget::runTask ( )
virtual

Implements TaskWidget.

Definition at line 292 of file CQFittingWidget.cpp.

References TaskWidget::commonBeforeRunTask(), TaskWidget::commonRunTask(), CKeyFactory::get(), CCopasiRootContainer::getKeyFactory(), CCopasiDataModel::getModel(), CModel::getModelParameterSets(), CCopasiObject::getObjectDataModel(), CopasiWidget::mKey, mnParamterSetsBeforeRun, pTask, and CCopasiVector< T >::size().

Referenced by SliderDialog::runParameterEstimationTask().

293 {
294  CFitTask * pTask =
295  dynamic_cast< CFitTask * >(CCopasiRootContainer::getKeyFactory()->get(mKey));
296 
297  if (!pTask) return false;
298 
300 
301  if (!commonBeforeRunTask()) return false;
302 
303  bool success = commonRunTask();
304 
305  return success;
306 }
CCopasiDataModel * getObjectDataModel()
virtual size_t size() const
CCopasiObject * get(const std::string &key)
size_t mnParamterSetsBeforeRun
CTSSATask * pTask
const CCopasiVectorN< CModelParameterSet > & getModelParameterSets() const
Definition: CModel.cpp:1066
static CKeyFactory * getKeyFactory()
bool commonRunTask()
Definition: TaskWidget.cpp:395
bool commonBeforeRunTask()
Definition: TaskWidget.cpp:317
std::string mKey
Definition: copasiWidget.h:63
bool CQFittingWidget::saveTask ( )
protectedvirtual

Implements TaskWidget.

Definition at line 65 of file CQFittingWidget.cpp.

References CExperimentSet::addExperiment(), C_INVALID_INDEX, CKeyFactory::get(), COptProblem::getCalculateStatistics(), CFitProblem::getCreateParameterSets(), CCopasiRootContainer::getDatamodelList(), CExperimentSet::getExperiment(), CExperimentSet::getExperimentCount(), CCopasiParameterGroup::getGroup(), CCopasiRootContainer::getKeyFactory(), CCopasiObject::getObjectName(), CCopasiTask::getProblem(), COptProblem::getRandomizeStartValues(), CCrossValidationSet::getThreshold(), CCrossValidationSet::getWeight(), if(), TaskWidget::mChanged, mCrossValidationKeyMap, mExperimentKeyMap, mpCrossValidationSet, mpExperimentSet, TaskWidget::mpTask, pTask, CExperimentSet::removeExperiment(), TaskWidget::saveCommon(), TaskWidget::saveMethod(), COptProblem::setCalculateStatistics(), CFitProblem::setCreateParameterSets(), COptProblem::setRandomizeStartValues(), and CCrossValidationSet::setWeight().

66 {
67  CFitTask * pTask =
68  dynamic_cast< CFitTask * >(mpTask);
69 
70  if (!pTask) return false;
71 
72  saveCommon();
73  saveMethod();
74 
75  CFitProblem * pProblem =
76  dynamic_cast<CFitProblem *>(mpTask->getProblem());
77 
78  if (!pProblem) return false;
79 
80  std::map<std::string, std::string> ExperimentMap;
81  std::map<std::string, std::string> CrossValidationMap;
82 
83  // Save experiment set
84  CExperimentSet * pExperimentSet =
85  dynamic_cast<CExperimentSet *>(pProblem->getGroup("Experiment Set"));
86 
87  std::string Name;
88  CExperiment * pExperiment;
89  size_t i, imax;
90 
91  std::set<CExperiment *> DealtWith;
92 
93  for (i = pExperimentSet->getExperimentCount() - 1; i != C_INVALID_INDEX; i--)
94  {
95  pExperiment =
96  dynamic_cast<CExperiment *>(CCopasiRootContainer::getKeyFactory()->get(mExperimentKeyMap[pExperimentSet->getExperiment(i)->CCopasiParameter::getKey()]));
97 
98  if (pExperiment && pExperiment == mpExperimentSet->getExperiment(pExperiment->getObjectName()))
99  {
100  if (!(*pExperimentSet->getExperiment(i) == *pExperiment))
101  {
102  *pExperimentSet->getExperiment(i) = *pExperiment;
103  mChanged = true;
104  }
105 
106  DealtWith.insert(pExperiment);
107  }
108  else
109  {
110  mExperimentKeyMap.erase(pExperimentSet->getExperiment(i)->CCopasiParameter::getKey());
111  pExperimentSet->removeExperiment(i);
112  mChanged = true;
113  }
114  }
115 
116  for (i = 0, imax = mpExperimentSet->getExperimentCount(); i < imax; i++)
117  {
118  pExperiment = mpExperimentSet->getExperiment(i);
119 
120  if (DealtWith.count(pExperiment)) continue;
121 
122  pExperiment = pExperimentSet->addExperiment(*pExperiment);
123  mExperimentKeyMap[pExperiment->CCopasiParameter::getKey()] =
124  mpExperimentSet->getExperiment(i)->CCopasiParameter::getKey();
125  mChanged = true;
126  }
127 
128  // We need to invert the key map for saving!
129  std::map<std::string, std::string>::iterator it = mExperimentKeyMap.begin();
130  std::map<std::string, std::string>::iterator end = mExperimentKeyMap.end();
131 
132  for (; it != end; ++it)
133  ExperimentMap[it->second] = it->first;
134 
135  // Save cross validation experiment set
136  CCrossValidationSet * pCrossValidationSet =
137  dynamic_cast<CCrossValidationSet *>(pProblem->getGroup("Validation Set"));
138 
139  if (pCrossValidationSet->getWeight() != mpCrossValidationSet->getWeight())
140  {
141  pCrossValidationSet->setWeight(mpCrossValidationSet->getWeight());
142  mChanged = true;
143  }
144 
145  if (pCrossValidationSet->getThreshold() != mpCrossValidationSet->getThreshold())
146  {
147  pCrossValidationSet->setThreshold(mpCrossValidationSet->getThreshold());
148  mChanged = true;
149  }
150 
151  DealtWith.clear();
152 
153  for (i = pCrossValidationSet->getExperimentCount() - 1; i != C_INVALID_INDEX; i--)
154  {
155  pExperiment =
156  dynamic_cast<CExperiment *>(CCopasiRootContainer::getKeyFactory()->get(mCrossValidationKeyMap[pCrossValidationSet->getExperiment(i)->CCopasiParameter::getKey()]));
157 
158  if (pExperiment && pExperiment == mpCrossValidationSet->getExperiment(pExperiment->getObjectName()))
159  {
160  if (!(*pCrossValidationSet->getExperiment(i) == *pExperiment))
161  {
162  *pCrossValidationSet->getExperiment(i) = *pExperiment;
163  mChanged = true;
164  }
165 
166  DealtWith.insert(pExperiment);
167  }
168  else
169  {
170  mCrossValidationKeyMap.erase(pCrossValidationSet->getExperiment(i)->CCopasiParameter::getKey());
171  pCrossValidationSet->removeExperiment(i);
172  mChanged = true;
173  }
174  }
175 
176  for (i = 0, imax = mpCrossValidationSet->getExperimentCount(); i < imax; i++)
177  {
178  pExperiment = mpCrossValidationSet->getExperiment(i);
179 
180  if (DealtWith.count(pExperiment)) continue;
181 
182  pExperiment = pCrossValidationSet->addExperiment(*pExperiment);
183  mCrossValidationKeyMap[pExperiment->CCopasiParameter::getKey()] =
184  mpCrossValidationSet->getExperiment(i)->CCopasiParameter::getKey();
185  mChanged = true;
186  }
187 
188  // We need to invert the key map for saving!
189  it = mCrossValidationKeyMap.begin();
190  end = mCrossValidationKeyMap.end();
191 
192  for (; it != end; ++it)
193  CrossValidationMap[it->second] = it->first;
194 
195  if (mpCheckRandomize->isChecked() != pProblem->getRandomizeStartValues())
196  {
197  mChanged = true;
198  pProblem->setRandomizeStartValues(mpCheckRandomize->isChecked());
199  }
200 
201  if (mpCreateParameterSets->isChecked() != pProblem->getCreateParameterSets())
202  {
203  mChanged = true;
204  pProblem->setCreateParameterSets(mpCreateParameterSets->isChecked());
205  }
206 
207  if (mpCheckStatistics->isChecked() != pProblem->getCalculateStatistics())
208  {
209  mChanged = true;
210  pProblem->setCalculateStatistics(mpCheckStatistics->isChecked());
211  }
212 
213  mChanged |= mpParameters->save(&ExperimentMap, &CrossValidationMap);
214  mChanged |= mpConstraints->save(&ExperimentMap, &CrossValidationMap);
215 
216  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
217 
218  if (mChanged)(*CCopasiRootContainer::getDatamodelList())[0]->changed();
219 
220  mChanged = false;
221  return true;
222 }
std::map< std::string, std::string > mCrossValidationKeyMap
bool saveMethod()
Definition: TaskWidget.cpp:308
CCopasiProblem * getProblem()
const std::string & getObjectName() const
CCopasiObject * get(const std::string &key)
const bool & getCreateParameterSets() const
bool saveCommon()
Definition: TaskWidget.cpp:258
CExperimentSet * mpExperimentSet
#define C_INVALID_INDEX
Definition: copasi.h:222
const bool & getRandomizeStartValues() const
CExperiment * getExperiment(const size_t &index)
bool mChanged
Definition: TaskWidget.h:133
CTSSATask * pTask
const C_FLOAT64 & getWeight() const
CExperiment * addExperiment(const CExperiment &experiment)
void setWeight(const C_FLOAT64 &weight)
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
CCopasiTask * mpTask
Definition: TaskWidget.h:130
CCrossValidationSet * mpCrossValidationSet
void setRandomizeStartValues(const bool &randomize)
static CKeyFactory * getKeyFactory()
const unsigned C_INT32 & getThreshold() const
const bool & getCalculateStatistics() const
void setCreateParameterSets(const bool &create)
CCopasiParameterGroup * getGroup(const std::string &name)
if(!yymsg) yymsg
size_t getExperimentCount() const
void setCalculateStatistics(const bool &calculate)
void removeExperiment(const size_t &index)
std::map< std::string, std::string > mExperimentKeyMap
void CQFittingWidget::slotConstraintNumberChanged ( int  number)
slot

Definition at line 378 of file CQFittingWidget.cpp.

Referenced by init().

379 {
380  QString TabLabel = "Constraints (" + QString::number(number) + ")";
381  mpTabWidget->setTabText(mpTabWidget->indexOf(mpConstraints), TabLabel);
382 }
void CQFittingWidget::slotCrossValidationData ( )
protectedslot

Definition at line 390 of file CQFittingWidget.cpp.

References CQExperimentData::load(), mpCrossValidationSet, CopasiWidget::mpDataModel, and pdelete.

391 {
392  CQExperimentData * pDialog = new CQExperimentData(this);
394 
395  connect(pDialog, SIGNAL(experimentChanged()), mpParameters, SLOT(slotCrossValidationChanged()));
396  connect(pDialog, SIGNAL(experimentChanged()), mpConstraints, SLOT(slotCrossValidationChanged()));
397 
398  pDialog->exec();
399 
400  pdelete(pDialog);
401 }
#define pdelete(p)
Definition: copasi.h:215
CCrossValidationSet * mpCrossValidationSet
CCopasiDataModel * mpDataModel
Definition: copasiWidget.h:65
virtual bool load(CExperimentSet *pExperimentSet, CCopasiDataModel *pDataModel)
void CQFittingWidget::slotExperimentData ( )
protectedslot

Definition at line 327 of file CQFittingWidget.cpp.

References CQExperimentData::load(), CopasiWidget::mpDataModel, mpExperimentSet, and pdelete.

328 {
329  CQExperimentData * pDialog = new CQExperimentData(this);
330  pDialog->load(mpExperimentSet, mpDataModel);
331 
332  connect(pDialog, SIGNAL(experimentChanged()), mpParameters, SLOT(slotExperimentChanged()));
333  connect(pDialog, SIGNAL(experimentChanged()), mpConstraints, SLOT(slotExperimentChanged()));
334 
335  pDialog->exec();
336 
337  pdelete(pDialog);
338 }
#define pdelete(p)
Definition: copasi.h:215
CExperimentSet * mpExperimentSet
CCopasiDataModel * mpDataModel
Definition: copasiWidget.h:65
virtual bool load(CExperimentSet *pExperimentSet, CCopasiDataModel *pDataModel)
void CQFittingWidget::slotPageChange ( QWidget *  currentPage)
protectedslot

Definition at line 340 of file CQFittingWidget.cpp.

References mpCurrentList.

341 {
342  if (mpTabWidget->tabText(mpTabWidget->indexOf(currentPage)).contains("Parameters", Qt::CaseSensitive))
343  mpCurrentList = mpParameters;
344  else
345  mpCurrentList = mpConstraints;
346 }
CQFittingItemWidget * mpCurrentList
void CQFittingWidget::slotParameterNumberChanged ( int  number)
slot

Definition at line 372 of file CQFittingWidget.cpp.

Referenced by init().

373 {
374  QString TabLabel = "Parameters (" + QString::number(number) + ")";
375  mpTabWidget->setTabText(mpTabWidget->indexOf(mpParameters), TabLabel);
376 }
bool CQFittingWidget::taskFinishedEvent ( )
protectedvirtual

Reimplemented from TaskWidget.

Definition at line 308 of file CQFittingWidget.cpp.

References ListViews::ADD, CKeyFactory::get(), CCopasiObject::getKey(), CCopasiRootContainer::getKeyFactory(), CCopasiDataModel::getModel(), CModel::getModelParameterSets(), CCopasiObject::getObjectDataModel(), CopasiWidget::mKey, mnParamterSetsBeforeRun, ListViews::MODELPARAMETERSET, CopasiWidget::protectedNotify(), pTask, CCopasiVector< T >::size(), and TaskWidget::taskFinishedEvent().

309 {
310  bool result = TaskWidget::taskFinishedEvent();
311 
312  CFitTask * pTask =
313  dynamic_cast< CFitTask * >(CCopasiRootContainer::getKeyFactory()->get(mKey));
314 
315  if (!pTask) return false;
316 
317  size_t finalCount = pTask->getObjectDataModel()->getModel()->getModelParameterSets().size();
318 
319  for (size_t i = mnParamterSetsBeforeRun; i < finalCount; ++i)
320  {
322  }
323 
324  return true;
325 }
CCopasiDataModel * getObjectDataModel()
virtual size_t size() const
CCopasiObject * get(const std::string &key)
size_t mnParamterSetsBeforeRun
virtual bool taskFinishedEvent()
Definition: TaskWidget.cpp:508
virtual const std::string & getKey() const
CTSSATask * pTask
const CCopasiVectorN< CModelParameterSet > & getModelParameterSets() const
Definition: CModel.cpp:1066
virtual bool protectedNotify(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key="")
static CKeyFactory * getKeyFactory()
std::string mKey
Definition: copasiWidget.h:63

Member Data Documentation

std::map<std::string, std::string> CQFittingWidget::mCrossValidationKeyMap
protected

Definition at line 45 of file CQFittingWidget.h.

Referenced by loadTask(), and saveTask().

std::map<std::string, std::string> CQFittingWidget::mExperimentKeyMap
protected

Definition at line 43 of file CQFittingWidget.h.

Referenced by loadTask(), and saveTask().

size_t CQFittingWidget::mnParamterSetsBeforeRun
protected

Definition at line 46 of file CQFittingWidget.h.

Referenced by runTask(), and taskFinishedEvent().

CCrossValidationSet* CQFittingWidget::mpCrossValidationSet
protected

Definition at line 44 of file CQFittingWidget.h.

Referenced by destroy(), init(), loadTask(), saveTask(), and slotCrossValidationData().

CQFittingItemWidget* CQFittingWidget::mpCurrentList
protected

Definition at line 41 of file CQFittingWidget.h.

Referenced by init(), and slotPageChange().

CExperimentSet* CQFittingWidget::mpExperimentSet
protected

Definition at line 42 of file CQFittingWidget.h.

Referenced by destroy(), init(), loadTask(), saveTask(), and slotExperimentData().


The documentation for this class was generated from the following files: