本文整理汇总了C++中CCopasiParameter::getValue方法的典型用法代码示例。如果您正苦于以下问题:C++ CCopasiParameter::getValue方法的具体用法?C++ CCopasiParameter::getValue怎么用?C++ CCopasiParameter::getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCopasiParameter
的用法示例。
在下文中一共展示了CCopasiParameter::getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initializeParameter
void CTauLeapMethod::initializeParameter()
{
CCopasiParameter *pParm;
assertParameter("Epsilon", CCopasiParameter::DOUBLE, (C_FLOAT64) 0.001);
assertParameter("Max Internal Steps", CCopasiParameter::UINT, (unsigned C_INT32) 10000);
assertParameter("Use Random Seed", CCopasiParameter::BOOL, false);
assertParameter("Random Seed", CCopasiParameter::UINT, (unsigned C_INT32) 1);
// Check whether we have a method with the old parameter names
if ((pParm = getParameter("TAULEAP.Tau")) != NULL)
{
removeParameter("TAULEAP.Tau");
if ((pParm = getParameter("TAULEAP.UseRandomSeed")) != NULL)
{
setValue("Use Random Seed", *pParm->getValue().pBOOL);
removeParameter("TAULEAP.UseRandomSeed");
}
if ((pParm = getParameter("TAULEAP.RandomSeed")) != NULL)
{
setValue("Random Seed", *pParm->getValue().pUINT);
removeParameter("TAULEAP.RandomSeed");
}
}
}
示例2: CTSSAProblem
CTSSATask::CTSSATask(const CTSSATask & src,
const CCopasiContainer * pParent):
CCopasiTask(src, pParent),
mTimeSeriesRequested(src.mTimeSeriesRequested),
mTimeSeries(),
mpTSSAProblem(NULL),
mpTSSAMethod(NULL),
mpCurrentState(NULL),
mpCurrentTime(NULL)
{
mpProblem =
new CTSSAProblem(*static_cast< CTSSAProblem * >(src.mpProblem), this);
mpMethod = createMethod(src.mpMethod->getSubType());
* mpMethod = * src.mpMethod;
mpMethod->elevateChildren();
this->add(mpMethod, true);
CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model");
if (pParameter != NULL)
mUpdateMoieties = *pParameter->getValue().pBOOL;
else
mUpdateMoieties = false;
}
示例3: CCopasiTask
CTrajectoryTask::CTrajectoryTask(const CCopasiContainer * pParent):
CCopasiTask(CCopasiTask::timeCourse, pParent),
mTimeSeriesRequested(true),
mTimeSeries(),
mpTrajectoryProblem(NULL),
mpSteadyState(NULL),
mpTrajectoryMethod(NULL),
mUpdateMoieties(false),
mpCurrentState(NULL),
mpCurrentTime(NULL),
mOutputStartTime(0.0),
mpLessOrEqual(&fle),
mpLess(&fl)
{
mpProblem = new CTrajectoryProblem(this);
mpMethod = createMethod(CCopasiMethod::deterministic);
this->add(mpMethod, true);
CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model");
if (pParameter != NULL)
mUpdateMoieties = *pParameter->getValue().pBOOL;
else
mUpdateMoieties = false;
}
示例4: initializeParameter
void CLyapWolfMethod::initializeParameter()
{
assertParameter("Orthonormalization Interval", CCopasiParameter::UDOUBLE, (C_FLOAT64) 1.0);
assertParameter("Overall time", CCopasiParameter::UDOUBLE, (C_FLOAT64) 1000.0);
assertParameter("Relative Tolerance", CCopasiParameter::UDOUBLE, (C_FLOAT64) 1.0e-6);
assertParameter("Absolute Tolerance", CCopasiParameter::UDOUBLE, (C_FLOAT64) 1.0e-12);
assertParameter("Max Internal Steps", CCopasiParameter::UINT, (unsigned C_INT32) 10000);
// Check whether we have an (obsolete) parameter "Use Default Absolute Tolerance"
CCopasiParameter *pParm;
if ((pParm = getParameter("Use Default Absolute Tolerance")) != NULL)
{
C_FLOAT64 NewValue;
if (*pParm->getValue().pBOOL)
{
// The default
NewValue = 1.e-12;
}
else
{
NewValue = *getValue("Absolute Tolerance").pUDOUBLE;
}
setValue("Absolute Tolerance", NewValue);
removeParameter("Use Default Absolute Tolerance");
}
// These parameters are no longer supported.
removeParameter("Adams Max Order");
removeParameter("BDF Max Order");
}
示例5: elevateChildren
bool CFitItem::elevateChildren()
{
// The functionality of SavedValue is no handled more transparently
// through the StartValue. Therefore, in case we encounter an old file
// we need to copy its value.
CCopasiParameter *pSavedValue = getParameter("SavedValue");
if (pSavedValue)
{
setStartValue(*pSavedValue->getValue().pDOUBLE);
removeParameter("SavedValue");
}
mpGrpAffectedExperiments =
elevate<CCopasiParameterGroup, CCopasiParameterGroup>(mpGrpAffectedExperiments);
if (!mpGrpAffectedExperiments) return false;
mpGrpAffectedCrossValidations =
elevate<CCopasiParameterGroup, CCopasiParameterGroup>(mpGrpAffectedCrossValidations);
if (!mpGrpAffectedCrossValidations) return false;
return true;
}
示例6: assertParameter
void CExperimentObjectMap::CDataColumn::initializeParameter()
{
mpRole = (CExperiment::Type *)
assertParameter("Role", CCopasiParameter::UINT, (unsigned C_INT32) CExperiment::ignore)->getValue().pUINT;
CCopasiParameter * pParm = getParameter("Object CN");
if (pParm != NULL)
mpObjectCN = pParm->getValue().pCN;
pParm = getParameter("Weight");
if (pParm != NULL)
mpScale = pParm->getValue().pUDOUBLE;
elevateChildren();
}
示例7: initialize
bool CTSSATask::initialize(const OutputFlag & of,
COutputHandler * pOutputHandler,
std::ostream * pOstream)
{
assert(mpProblem && mpMethod);
mpTSSAProblem = dynamic_cast<CTSSAProblem *>(mpProblem);
assert(mpTSSAProblem);
mpTSSAMethod = dynamic_cast<CTSSAMethod *>(mpMethod);
assert(mpTSSAMethod);
mpTSSAMethod->setProblem(mpTSSAProblem);
bool success = mpMethod->isValidProblem(mpProblem);
CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model");
if (pParameter != NULL)
mUpdateMoieties = *pParameter->getValue().pBOOL;
else
mUpdateMoieties = false;
pdelete(mpCurrentState);
mpCurrentState = new CState(mpTSSAProblem->getModel()->getState());
mpCurrentTime = &mpCurrentState->getTime();
// Handle the time series as a regular output.
mTimeSeriesRequested = mpTSSAProblem->timeSeriesRequested();
if (pOutputHandler != NULL)
{
if (mTimeSeriesRequested)
{
mTimeSeries.allocate(mpTSSAProblem->getStepNumber());
pOutputHandler->addInterface(&mTimeSeries);
}
else
{
mTimeSeries.clear();
}
}
//NEW
mpTSSAMethod->setModel(mpTSSAProblem->getModel());
mpTSSAMethod->predifineAnnotation();
//
if (!CCopasiTask::initialize(of, pOutputHandler, pOstream)) success = false;
return success;
}
示例8: initialize
bool CCrossSectionTask::initialize(const OutputFlag & of,
COutputHandler * pOutputHandler,
std::ostream * pOstream)
{
assert(mpProblem && mpMethod);
mpCrossSectionProblem = dynamic_cast<CCrossSectionProblem *>(mpProblem);
assert(mpCrossSectionProblem);
mpTrajectoryMethod = dynamic_cast<CTrajectoryMethod *>(mpMethod);
assert(mpTrajectoryMethod);
mpTrajectoryMethod->setProblem(mpCrossSectionProblem);
bool success = mpMethod->isValidProblem(mpProblem);
CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model");
if (pParameter != NULL)
mUpdateMoieties = *pParameter->getValue().pBOOL;
else
mUpdateMoieties = false;
pdelete(mpCurrentState);
mpCurrentState = new CState(mpCrossSectionProblem->getModel()->getState());
mpCurrentTime = &mpCurrentState->getTime();
//init the ring buffer for the states
mStatesRing.resize(RING_SIZE);
mStatesRingCounter = 0;
// Handle the time series as a regular output.
mTimeSeriesRequested = true;//mpCrossSectionProblem->timeSeriesRequested();
if ((pOutputHandler != NULL) &&
mTimeSeriesRequested &&
(of & CCopasiTask::TIME_SERIES))
{
mTimeSeries.allocate(20);
pOutputHandler->addInterface(&mTimeSeries);
}
else
{
mTimeSeries.clear();
}
createEvent();
if (!CCopasiTask::initialize(of, pOutputHandler, pOstream)) success = false;
return success;
}
示例9: initializeParameter
void CSteadyStateMethod::initializeParameter()
{
CCopasiParameter *pParm;
assertParameter("Resolution", CCopasiParameter::UDOUBLE, (C_FLOAT64) 1.0e-009);
mpSSResolution = (C_FLOAT64*)getValue("Resolution").pUDOUBLE;
mpDerivationResolution = (C_FLOAT64*)getValue("Resolution").pUDOUBLE;
assertParameter("Derivation Factor", CCopasiParameter::UDOUBLE, (C_FLOAT64) 1.0e-003);
mpDerivationFactor = (C_FLOAT64*)getValue("Derivation Factor").pUDOUBLE;
// Check whether we have a method with the old parameter names
if ((pParm = getParameter("Newton.DerivationFactor")) != NULL)
{
setValue("Derivation Factor", *pParm->getValue().pUDOUBLE);
removeParameter("Newton.DerivationFactor");
}
if ((pParm = getParameter("Newton.Resolution")) != NULL)
{
setValue("Resolution", *pParm->getValue().pUDOUBLE);
removeParameter("Newton.Resolution");
}
}
示例10: load
void CTrajectoryTask::load(CReadConfig & configBuffer)
{
configBuffer.getVariable("Dynamics", "bool", &mScheduled,
CReadConfig::LOOP);
pdelete(mpProblem);
mpProblem = new CTrajectoryProblem(this);
((CTrajectoryProblem *) mpProblem)->load(configBuffer);
pdelete(mpMethod);
mpMethod = CTrajectoryMethod::createMethod();
this->add(mpMethod, true);
CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model");
if (pParameter != NULL)
mUpdateMoieties = *pParameter->getValue().pBOOL;
((CTrajectoryMethod *)mpMethod)->setProblem((CTrajectoryProblem *) mpProblem);
}
示例11: CCopasiTask
CTSSATask::CTSSATask(const CCopasiContainer * pParent):
CCopasiTask(CCopasiTask::tssAnalysis, pParent),
mTimeSeriesRequested(true),
mTimeSeries(),
mpTSSAProblem(NULL),
mpTSSAMethod(NULL),
mpCurrentState(NULL),
mpCurrentTime(NULL)
{
mpProblem = new CTSSAProblem(this);
mpMethod = createMethod(CCopasiMethod::tssILDM);
this->add(mpMethod, true);
CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model");
if (pParameter != NULL)
mUpdateMoieties = *pParameter->getValue().pBOOL;
else
mUpdateMoieties = false;
}
示例12: setMethodType
bool CCrossSectionTask::setMethodType(const int & type)
{
CCopasiMethod::SubType Type = (CCopasiMethod::SubType) type;
if (!isValidMethod(Type, ValidMethods)) return false;
if (mpMethod->getSubType() == Type) return true;
pdelete(mpMethod);
mpMethod = createMethod(Type);
this->add(mpMethod, true);
CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model");
if (pParameter != NULL)
mUpdateMoieties = *pParameter->getValue().pBOOL;
else
mUpdateMoieties = false;
return true;
}
示例13: initialize
bool CTrajectoryTask::initialize(const OutputFlag & of,
COutputHandler * pOutputHandler,
std::ostream * pOstream)
{
assert(mpProblem && mpMethod);
mpTrajectoryProblem = dynamic_cast<CTrajectoryProblem *>(mpProblem);
assert(mpTrajectoryProblem);
mpTrajectoryMethod = dynamic_cast<CTrajectoryMethod *>(mpMethod);
assert(mpTrajectoryMethod);
mpTrajectoryMethod->setProblem(mpTrajectoryProblem);
bool success = mpMethod->isValidProblem(mpProblem);
CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model");
if (pParameter != NULL)
mUpdateMoieties = *pParameter->getValue().pBOOL;
else
mUpdateMoieties = false;
pdelete(mpCurrentState);
mpCurrentState = new CState(mpTrajectoryProblem->getModel()->getState());
mpCurrentTime = &mpCurrentState->getTime();
//mpOutputStartTime = & mpTrajectoryProblem->getOutputStartTime();
// Handle the time series as a regular output.
mTimeSeriesRequested = mpTrajectoryProblem->timeSeriesRequested();
if ((pOutputHandler != NULL) &&
mTimeSeriesRequested &&
(of & CCopasiTask::TIME_SERIES))
{
mTimeSeries.allocate(mpTrajectoryProblem->getStepNumber());
pOutputHandler->addInterface(&mTimeSeries);
}
else
{
mTimeSeries.clear();
}
mpTrajectoryProblem->getModel()->getMathModel()->getProcessQueue().setContinueSimultaneousEvents(mpTrajectoryProblem->getContinueSimultaneousEvents());
if (mpTrajectoryProblem->getStartInSteadyState())
{
mpSteadyState =
dynamic_cast<CSteadyStateTask *>((*mpTrajectoryProblem->getObjectDataModel()->getTaskList())["Steady-State"]);
if (mpSteadyState == NULL) fatalError();
mpSteadyState->initialize(CCopasiTask::NO_OUTPUT, NULL, NULL);
}
else
{
mpSteadyState = NULL;
}
if (!CCopasiTask::initialize(of, pOutputHandler, pOstream)) success = false;
return success;
}
示例14: slotBtnOk
void CQPreferenceDialog::slotBtnOk()
{
// We need to commit the changes
unsigned C_INT32 newMaxFiles = 0;
CConfigurationFile * configFile = CCopasiRootContainer::getConfiguration();
QList< QTreeWidgetItem *> Items = mpTreeWidget->findItems("Max Last Visited Files", 0, 0);
CCopasiParameter * pParameter = configFile->getRecentFiles().getParameter("MaxFiles");
if (Items.size() > 0 &&
pParameter != NULL)
{
newMaxFiles = Items[0]->text(COL_VALUE).toUInt();
unsigned C_INT32 maxFiles = *pParameter->getValue().pUINT;
if (newMaxFiles > 0 && newMaxFiles <= 20)
pParameter->setValue(newMaxFiles);
else
{
CQMessageBox::critical(this, "Incorrect Setting",
"Max Last Visited Files should be a number between 1 and 20.",
QMessageBox::Ok, QMessageBox::Ok);
Items[0]->setText(COL_VALUE, QString::number(maxFiles));
return;
}
}
Items = mpTreeWidget->findItems("Max Last Visited SBML Files", 0, 0);
pParameter = configFile->getRecentSBMLFiles().getParameter("MaxFiles");
if (Items.size() > 0 &&
pParameter != NULL)
{
newMaxFiles = Items[0]->text(COL_VALUE).toUInt();
unsigned C_INT32 maxFiles = *pParameter->getValue().pUINT;
if (newMaxFiles > 0 && newMaxFiles <= 20)
pParameter->setValue(newMaxFiles);
else
{
CQMessageBox::critical(this, "Incorrect Setting", "Max Last Visited SBML Files should be a number between 1 and 20.",
QMessageBox::Ok, QMessageBox::Ok);
Items[0]->setText(COL_VALUE, QString::number(maxFiles));
return;
}
}
Items = mpTreeWidget->findItems("Application for opening URLs", 0, 0);
pParameter = configFile->getParameter("Application for opening URLs");
if (Items.size() > 0 &&
pParameter != NULL)
{
if (Items[0]->text(COL_VALUE) != FROM_UTF8(*pParameter->getValue().pSTRING))
pParameter->setValue(std::string(TO_UTF8(Items[0]->text(COL_VALUE))));
}
Items = mpTreeWidget->findItems("Validate Units", 0, 0);
pParameter = configFile->getParameter("Validate Units");
if (Items.size() > 0 &&
pParameter != NULL)
{
pParameter->setValue(Items[0]->text(COL_VALUE).toUpper() == "YES");
}
Items = mpTreeWidget->findItems("Use OpenGL", 0, 0);
pParameter = configFile->getParameter("Use OpenGL");
if (Items.size() > 0 &&
pParameter != NULL)
{
pParameter->setValue(Items[0]->text(COL_VALUE).toUpper() == "YES");
}
Items = mpTreeWidget->findItems("Use Advanced Editing", 0, 0);
pParameter = configFile->getParameter("Use Advanced Editing");
if (Items.size() > 0 &&
pParameter != NULL)
{
pParameter->setValue(Items[0]->text(COL_VALUE).toUpper() == "YES");
}
done(1);
}
示例15: initializeParameter
void CLsodaMethod::initializeParameter()
{
CCopasiParameter *pParm;
mpReducedModel =
assertParameter("Integrate Reduced Model", CCopasiParameter::BOOL, (bool) false)->getValue().pBOOL;
mpRelativeTolerance =
assertParameter("Relative Tolerance", CCopasiParameter::UDOUBLE, (C_FLOAT64) 1.0e-6)->getValue().pUDOUBLE;
mpAbsoluteTolerance =
assertParameter("Absolute Tolerance", CCopasiParameter::UDOUBLE, (C_FLOAT64) 1.0e-12)->getValue().pUDOUBLE;
mpMaxInternalSteps =
assertParameter("Max Internal Steps", CCopasiParameter::UINT, (unsigned C_INT32) 10000)->getValue().pUINT;
// Check whether we have a method with the old parameter names
if ((pParm = getParameter("LSODA.RelativeTolerance")) != NULL)
{
*mpRelativeTolerance = *pParm->getValue().pUDOUBLE;
removeParameter("LSODA.RelativeTolerance");
if ((pParm = getParameter("LSODA.AbsoluteTolerance")) != NULL)
{
*mpAbsoluteTolerance = *pParm->getValue().pUDOUBLE;
removeParameter("LSODA.AbsoluteTolerance");
}
if ((pParm = getParameter("LSODA.AdamsMaxOrder")) != NULL)
{
removeParameter("LSODA.AdamsMaxOrder");
}
if ((pParm = getParameter("LSODA.BDFMaxOrder")) != NULL)
{
removeParameter("LSODA.BDFMaxOrder");
}
if ((pParm = getParameter("LSODA.MaxStepsInternal")) != NULL)
{
*mpMaxInternalSteps = *pParm->getValue().pUINT;
removeParameter("LSODA.MaxStepsInternal");
}
}
// Check whether we have a method with "Use Default Absolute Tolerance"
if ((pParm = getParameter("Use Default Absolute Tolerance")) != NULL)
{
C_FLOAT64 NewValue;
if (*pParm->getValue().pBOOL)
{
// The default
NewValue = 1.e-12;
}
else
{
C_FLOAT64 OldValue = *mpAbsoluteTolerance;
CCopasiDataModel* pDataModel = getObjectDataModel();
assert(pDataModel != NULL);
CModel * pModel = pDataModel->getModel();
if (pModel == NULL)
// The default
NewValue = 1.e-12;
else
{
const CCopasiVectorNS< CCompartment > & Compartment = pModel->getCompartments();
unsigned C_INT32 i, imax;
C_FLOAT64 Volume = DBL_MAX;
for (i = 0, imax = Compartment.size(); i < imax; i++)
if (Compartment[i]->getValue() < Volume)
Volume = Compartment[i]->getValue();
if (Volume == DBL_MAX)
// The default
NewValue = 1.e-12;
else
// Invert the scaling as best as we can
NewValue = OldValue / (Volume * pModel->getQuantity2NumberFactor());
}
}
*mpAbsoluteTolerance = NewValue;
removeParameter("Use Default Absolute Tolerance");
}
// These parameters are no longer supported.
removeParameter("Adams Max Order");
removeParameter("BDF Max Order");
}