Exemple #1
0
bool CQTSSAWidget::loadTask()
{
  CTSSATask * pTask =
    dynamic_cast< CTSSATask * >(mpTask);

  if (!pTask) return false;

  loadCommon();
  loadMethod();

  CTSSAProblem* tssaproblem =
    dynamic_cast<CTSSAProblem *>(pTask->getProblem());
  assert(tssaproblem);

  pdelete(mpTSSAProblem);
  mpTSSAProblem = new CTSSAProblem(*tssaproblem);

  //numbers
  mpEditIntervalSize->setText(QString::number(tssaproblem->getStepSize()));
  mpEditIntervals->setText(QString::number(tssaproblem->getStepNumber()));
  mpEditDuration->setText(QString::number(tssaproblem->getDuration()));

  //store time series checkbox
  mpCheckSave->setChecked(tssaproblem->timeSeriesRequested());
  checkTimeSeries();

  mpValidatorDuration->saved();
  mpValidatorIntervalSize->saved();

  return true;
}
Exemple #2
0
bool CQTSSAWidget::loadTask()
{
  CTSSATask * pTask =
    dynamic_cast< CTSSATask * >(mpTask);

  if (!pTask) return false;

  loadCommon();
  loadMethod();

  CTSSAProblem * tssaproblem = dynamic_cast<CTSSAProblem *>(pTask->getProblem());
  assert(tssaproblem);

  pdelete(mpTSSAProblem);
  mpTSSAProblem = new CTSSAProblem(*tssaproblem, NO_PARENT);

  //numbers
  mpEditIntervalSize->setText(QString::number(tssaproblem->getStepSize()));
  mpEditIntervals->setText(QString::number(tssaproblem->getStepNumber()));
  mpEditDuration->setText(QString::number(tssaproblem->getDuration()));

  mpValidatorDuration->saved();
  mpValidatorIntervalSize->saved();

  return true;
}
Exemple #3
0
bool CQTSSAWidget::saveTask()
{
  CTSSATask * pTask =
    dynamic_cast< CTSSATask * >(mpTask);

  if (!pTask) return false;

  saveCommon();
  saveMethod();

  CTSSAProblem* tssaproblem =
    dynamic_cast<CTSSAProblem *>(pTask->getProblem());
  assert(tssaproblem);

  //numbers
  if (tssaproblem->getStepSize() != mpEditIntervalSize->text().toDouble())
    {
      tssaproblem->setStepSize(mpEditIntervalSize->text().toDouble());
      mChanged = true;
    }
  else if (tssaproblem->getStepNumber() != mpEditIntervals->text().toULong())
    {
      tssaproblem->setStepNumber(mpEditIntervals->text().toLong());
      mChanged = true;
    }

  if (tssaproblem->getDuration() != mpEditDuration->text().toDouble())
    {
      tssaproblem->setDuration(mpEditDuration->text().toDouble());
      mChanged = true;
    }

  if (tssaproblem->timeSeriesRequested() != mpCheckSave->isChecked())
    {
      tssaproblem->setTimeSeriesRequested(mpCheckSave->isChecked());
      mChanged = true;
    }

  mpValidatorDuration->saved();
  mpValidatorIntervalSize->saved();

  return true;
}
Exemple #4
0
void CILDMMethod::printResult(std::ostream * ostream) const // temporary tabs are not included in Report !!!
{
  std::ostream & os = *ostream;
  double timeScale;
  C_INT i, j, istep = 0;

  C_INT32 stepNumber;

  this->print(&os);

  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
  CTSSATask* pTask =
    dynamic_cast<CTSSATask *>((*(*CCopasiRootContainer::getDatamodelList())[0]->getTaskList())["Time Scale Separation Analysis"]);

  CTSSAProblem* pProblem = dynamic_cast<CTSSAProblem*>(pTask->getProblem());

  stepNumber = pProblem->getStepNumber();

  for (istep = 0; istep < stepNumber; istep++)
    {

      os << std::endl;
      os << "****************  Time step " << istep + 1 << " **************************  " << std::endl;

      os << std::endl;

      os << "Contribution of species to modes" << std::endl;

      os << "Rows : contribution to  mode (TS - corresponding timescale)" << std::endl;
      os << "Columns: species  ";

      for (j = 0; j < mData.dim; j++)
        {
          os << mpModel->getMetabolitesX()[j]->getObjectName() << "   ";
        }

      os << std::endl;

      for (i = 0; i < mData.dim; i++)
        {
          timeScale = mVec_TimeScale[istep][i];

          if (i < mVec_SlowModes[istep])
            os << "Slow (";
          else
            os << "Fast (";

          os << timeScale << "): ";

          for (j = 0; j < mData.dim; j++)
            os << mVec_mVslow[istep][i][j] << " ";

          os << std::endl;
        }

      os << std::endl;

      os << "Modes distribution for species" << std::endl;

      os << "Rows : Mode distribution for each species" << std::endl;
      os << "Columns: Modes (TS - corresponding  timescale) ";
      os << std::endl;

      for (i = 0; i < mData.dim; i++)
        {
          timeScale = mVec_TimeScale[istep][i];

          if (i < mVec_SlowModes[istep])
            os << "Slow (";
          else
            os << "Fast (";

          os << timeScale << ")  ";
        }

      os << std::endl;

      for (j = 0; j < mData.dim; j++)
        {
          os << mpModel->getMetabolitesX()[j]->getObjectName() << "  ";

          for (i = 0; i < mData.dim; i++)
            os << mVec_mVslowMetab[istep][j][i] << "  ";

          os << std::endl;
        }

      os << std::endl;

      os << "Slow space" << std::endl;

      os << "Rows : Species" << std::endl;
      os << "Column: Contribution to slow space ";
      os << std::endl;

      os << mVec_SlowModes[istep];
      os << " slow; ";

      os << mData.dim - mVec_SlowModes[istep];
      os << " fast";
      os << std::endl;

      for (j = 0; j < mData.dim; j++)
        {
          os << mpModel->getMetabolitesX()[j]->getObjectName() << "  ";
          os << mVec_mVslowSpace[istep][j] << "  ";

          os << std::endl;
        }

      os << std::endl;
      os << "Fast space" << std::endl;

      os << "Rows : Species" << std::endl;
      os << "Column: Contribution to fast space ";
      os << std::endl;

      os << mVec_SlowModes[istep];
      os << " slow; ";

      os << mData.dim - mVec_SlowModes[istep];
      os << " fast";
      os << std::endl;

      for (j = 0; j < mData.dim; j++)
        {
          os << mpModel->getMetabolitesX()[j]->getObjectName() << "  ";
          os << mVec_mVfastSpace[istep][j] << "  ";

          os << std::endl;
        }

      os << std::endl;
      os << "Reactions slow space" << std::endl;

      os << "Rows : Reactions" << std::endl;
      os << "Column: Contribution to slow space ";
      os << std::endl;

      for (j = 0; j < (C_INT32) mpModel->getReactions().size(); j++)
        {
          os << mpModel->getReactions()[j]->getObjectName() << "  ";
          os << mVec_mReacSlowSpace[istep][j] << "  ";

          os << std::endl;
        }

      os << std::endl;
    }

  return;
}