copasi/sedml/CSEDMLExporter.cpp
/**
 * Creates the simulations for SEDML.
 */
Creates the simulations for SEDML.
Creates the simulations for SEDML .
std::string CSEDMLExporter::createTimeCourseTask(CDataModel& dataModel, const std::string & modelId)
{
  mpTimecourse = this->mpSEDMLDocument->createUniformTimeCourse();
  mpTimecourse->setId(SEDMLUtils::getNextId("sim", mpSEDMLDocument->getNumSimulations()));
  CCopasiTask* pTask = &dataModel.getTaskList()->operator[]("Time-Course");
  CTrajectoryProblem* tProblem = static_cast<CTrajectoryProblem*>(pTask->getProblem());
  mpTimecourse->setInitialTime(0.0);
  double outputStartTime = tProblem->getOutputStartTime();
  double stepSize = tProblem->getStepSize();
  int stepNumber = (int)tProblem->getStepNumber();
  mpTimecourse->setOutputStartTime(outputStartTime);
  mpTimecourse->setOutputEndTime(stepNumber * stepSize);
  if (outputStartTime > 0)
    {
      int initialSteps = (int)floor(outputStartTime / stepSize);
      mpTimecourse->setNumberOfPoints(stepNumber - initialSteps);
    }
  else
    {
      mpTimecourse->setNumberOfPoints(stepNumber);
    }
  SedAlgorithm* alg = mpTimecourse->createAlgorithm();
  if (pTask->getMethod()->getObjectName().find("Stochastic") != std::string::npos)
    alg->setKisaoID("KISAO:0000241");
  else
    alg->setKisaoID("KISAO:0000019");
  mpTimecourseTask = this->mpSEDMLDocument->createTask();
  std::string taskId = SEDMLUtils::getNextId("task", mpSEDMLDocument->getNumTasks());
  mpTimecourseTask->setId(taskId);
  mpTimecourseTask->setSimulationReference(mpTimecourse->getId());
  mpTimecourseTask->setModelReference(modelId);
  return taskId;
}
std :: string CSEDMLExporter :: createTimeCourseTask ( CDataModel & dataModel , const std :: string & modelId ) { mpTimecourse = this -> mpSEDMLDocument -> createUniformTimeCourse ( ) ; mpTimecourse -> setId ( SEDMLUtils :: getNextId ( " " , mpSEDMLDocument -> getNumSimulations ( ) ) ) ; CCopasiTask * pTask = & dataModel . getTaskList ( ) -> operator [ ] ( " " ) ; CTrajectoryProblem * tProblem = static_cast < CTrajectoryProblem * > ( pTask -> getProblem ( ) ) ; mpTimecourse -> setInitialTime ( 0.0 ) ; double outputStartTime = tProblem -> getOutputStartTime ( ) ; double stepSize = tProblem -> getStepSize ( ) ; int stepNumber = ( int ) tProblem -> getStepNumber ( ) ; mpTimecourse -> setOutputStartTime ( outputStartTime ) ; mpTimecourse -> setOutputEndTime ( stepNumber * stepSize ) ; if ( outputStartTime > 0 ) { int initialSteps = ( int ) floor ( outputStartTime / stepSize ) ; mpTimecourse -> setNumberOfPoints ( stepNumber - initialSteps ) ; } else { mpTimecourse -> setNumberOfPoints ( stepNumber ) ; } SedAlgorithm * alg = mpTimecourse -> createAlgorithm ( ) ; if ( pTask -> getMethod ( ) -> getObjectName ( ) . find ( " " ) != std :: string :: npos ) alg -> setKisaoID ( " " ) ; else alg -> setKisaoID ( " " ) ; mpTimecourseTask = this -> mpSEDMLDocument -> createTask ( ) ; std :: string taskId = SEDMLUtils :: getNextId ( " " , mpSEDMLDocument -> getNumTasks ( ) ) ; mpTimecourseTask -> setId ( taskId ) ; mpTimecourseTask -> setSimulationReference ( mpTimecourse -> getId ( ) ) ; mpTimecourseTask -> setModelReference ( modelId ) ; return taskId ; }
Creates the simulations for SEDML.
Creates the simulations for SEDML .
//presently SEDML only supports time course // adjust number of points, as the definition in COPASI includes the // interval (0, timeEnd), while in SED-ML it is (timeStart, timeEnd) // set the correct KISAO Term