当前位置: 首页>>代码示例>>C++>>正文


C++ CCopasiDataModel::ObjectFromName方法代码示例

本文整理汇总了C++中CCopasiDataModel::ObjectFromName方法的典型用法代码示例。如果您正苦于以下问题:C++ CCopasiDataModel::ObjectFromName方法的具体用法?C++ CCopasiDataModel::ObjectFromName怎么用?C++ CCopasiDataModel::ObjectFromName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCopasiDataModel的用法示例。


在下文中一共展示了CCopasiDataModel::ObjectFromName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: preCompileTable

bool CReportDefinition::preCompileTable(const std::vector< CCopasiContainer * > & listOfContainer)
{
  bool success = true;

  mHeaderVector.clear();
  mBodyVector.clear();
  mFooterVector.clear();

  std::vector<CRegisteredObjectName>::const_iterator it = mTableVector.begin();
  std::vector<CRegisteredObjectName>::const_iterator end = mTableVector.end();

  CCopasiDataModel* pDataModel = getObjectDataModel();
  CCopasiObject * pObject;

  for (; it != end; ++it)
    {
      pObject = pDataModel->ObjectFromName(listOfContainer, *it);

      if (pObject != NULL)
        {
          addTableElement(pObject);
        }
      else
        {
          CCopasiMessage(CCopasiMessage::WARNING, MCCopasiTask + 6, it->c_str());
        }
    }

  return success;
}
开发者ID:ShuoLearner,项目名称:COPASI,代码行数:30,代码来源:CReportDefinition.cpp

示例2: initialize

bool CFitProblem::initialize()
{
  mHaveStatistics = false;

  if (!COptProblem::initialize())
    {
      while (CCopasiMessage::peekLastMessage().getNumber() == MCOptimization + 5 ||
             CCopasiMessage::peekLastMessage().getNumber() == MCOptimization + 7)
        CCopasiMessage::getLastMessage();

      if (CCopasiMessage::getHighestSeverity() > CCopasiMessage::WARNING &&
          CCopasiMessage::peekLastMessage().getNumber() != MCCopasiMessage + 1)
        return false;
    }

  std::vector< CCopasiContainer * > ContainerList;
  ContainerList.push_back(getObjectAncestor("Vector"));
  CCopasiDataModel* pDataModel = getObjectDataModel();
  assert(pDataModel != NULL);
  mpSteadyState =
    dynamic_cast< CSteadyStateTask * >(pDataModel->ObjectFromName(ContainerList, *mpParmSteadyStateCN));

  if (mpSteadyState == NULL)
    mpSteadyState =
      static_cast<CSteadyStateTask *>((*pDataModel->getTaskList())["Steady-State"]);

  // We only need to initialize the steady-state task if steady-state data is present.
  if (mpExperimentSet->hasDataForTaskType(CCopasiTask::steadyState))
    {
      mpSteadyState->initialize(CCopasiTask::NO_OUTPUT, NULL, NULL);
    }

  mpTrajectory =
    dynamic_cast< CTrajectoryTask * >(pDataModel->ObjectFromName(ContainerList, *mpParmTimeCourseCN));

  if (mpTrajectory == NULL)
    mpTrajectory =
      static_cast<CTrajectoryTask *>((*pDataModel->getTaskList())["Time-Course"]);

  // We only need to initialize the trajectory task if time course data is present.
  if (mpExperimentSet->hasDataForTaskType(CCopasiTask::timeCourse))
    {
      mpTrajectory->initialize(CCopasiTask::NO_OUTPUT, NULL, NULL);
    }

  ContainerList.clear();

  ContainerList.push_back(mpModel);

  CFitTask * pTask = dynamic_cast<CFitTask *>(getObjectParent());

  if (pTask)
    {
      ContainerList.push_back(pTask);
      ContainerList.push_back(mpSteadyState);
      ContainerList.push_back(mpTrajectory);
    }

  if (!mpExperimentSet->compile(ContainerList)) return false;

  // Build a matrix of experiment and experiment local items.
  mExperimentUpdateMethods.resize(mpExperimentSet->getExperimentCount(),
                                  mpOptItems->size());
  mExperimentUpdateMethods = NULL;
  mExperimentInitialRefreshes.resize(mpExperimentSet->getExperimentCount());

  std::vector< std::set< const CCopasiObject * > > ObjectSet;
  ObjectSet.resize(mpExperimentSet->getExperimentCount());

  std::vector<COptItem * >::iterator it = mpOptItems->begin();
  std::vector<COptItem * >::iterator end = mpOptItems->end();

  std::vector<COptItem * >::iterator itTmp;

  CFitItem * pItem;
  unsigned C_INT32 i, imax;
  unsigned C_INT32 j;
  unsigned C_INT32 Index;

  imax = mSolutionVariables.size();

  mFisher.resize(imax, imax);
  mpFisherMatrix->resize();
  mCorrelation.resize(imax, imax);
  mpCorrelationMatrix->resize();

  for (j = 0; it != end; ++it, j++)
    {
      pItem = static_cast<CFitItem *>(*it);
      pItem->updateBounds(mpOptItems->begin());

      std::string Annotation = pItem->getObjectDisplayName();

      imax = pItem->getExperimentCount();

      if (imax == 0)
        {
          for (i = 0, imax = mpExperimentSet->getExperimentCount(); i < imax; i++)
            {
              mExperimentUpdateMethods(i, j) = pItem->COptItem::getUpdateMethod();
//.........这里部分代码省略.........
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:101,代码来源:CFitProblem.cpp


注:本文中的CCopasiDataModel::ObjectFromName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。