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< bool >()); removeParameter("TAULEAP.UseRandomSeed"); } if ((pParm = getParameter("TAULEAP.RandomSeed")) != NULL) { setValue("Random Seed", pParm->getValue< unsigned C_INT32 >()); removeParameter("TAULEAP.RandomSeed"); } } }
void CCrossValidationSet::initializeParameter() { mpWeight = assertParameter("Weight", CCopasiParameter::Type::UDOUBLE, (C_FLOAT64) 1.0); mpThreshold = assertParameter("Threshold", CCopasiParameter::Type::UINT, (unsigned C_INT32) 5); elevateChildren(); }
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< bool >()) { // The default NewValue = 1.e-12; } else { NewValue = getValue< C_FLOAT64 >("Absolute Tolerance"); } setValue("Absolute Tolerance", NewValue); removeParameter("Use Default Absolute Tolerance"); } // These parameters are no longer supported. removeParameter("Adams Max Order"); removeParameter("BDF Max Order"); }
void CTrajectoryMethodDsaLsodar::initializeParameter() { mpMaxSteps = assertParameter("Max Internal Steps", CCopasiParameter::Type::UINT, (unsigned C_INT32) 1000000); mpLowerLimit = assertParameter("Lower Limit", CCopasiParameter::Type::UDOUBLE, (C_FLOAT64) 800.0); mpUpperLimit = assertParameter("Upper Limit", CCopasiParameter::Type::UDOUBLE, (C_FLOAT64) 1000.0); mpPartitioningInterval = assertParameter("Partitioning Interval", CCopasiParameter::Type::UINT, (unsigned C_INT32) 1); mpPartitioningSteps = assertParameter("Partitioning Stepsize", CCopasiParameter::Type::UDOUBLE, (C_FLOAT64) 0.001); }
void CTSSAProblem::initializeParameter() { mpStepNumber = assertParameter("StepNumber", CCopasiParameter::Type::UINT, (unsigned C_INT32) 100); mpStepSize = assertParameter("StepSize", CCopasiParameter::Type::DOUBLE, (C_FLOAT64) 0.01); mpDuration = assertParameter("Duration", CCopasiParameter::Type::DOUBLE, (C_FLOAT64) 1.0); mpTimeSeriesRequested = assertParameter("TimeSeriesRequested", CCopasiParameter::Type::BOOL, (bool) true); mpOutputStartTime = assertParameter("OutputStartTime", CCopasiParameter::Type::DOUBLE, (C_FLOAT64) 0.0); }
void CStochDirectMethod::initializeParameter() { assertParameter("Max Internal Steps", CCopasiParameter::INT, (C_INT32) 1000000); assertParameter("Use Random Seed", CCopasiParameter::BOOL, false); assertParameter("Random Seed", CCopasiParameter::UINT, (unsigned C_INT32) 1); mpRootValueCalculator = new CBrent::EvalTemplate< CStochDirectMethod >(this, &CStochDirectMethod::rootValue); }
void CLyapProblem::initializeParameter() { mpExponentNumber = assertParameter("ExponentNumber", CCopasiParameter::UINT, (unsigned C_INT32) 3)->getValue().pUINT; mpDivergenceRequested = assertParameter("DivergenceRequested", CCopasiParameter::BOOL, (bool) true)->getValue().pBOOL; mpTransientTime = assertParameter("TransientTime", CCopasiParameter::DOUBLE, (C_FLOAT64) 0.0)->getValue().pDOUBLE; elevateChildren(); }
COptMethodNelderMead::COptMethodNelderMead(const CDataContainer * pParent, const CTaskEnum::Method & methodType, const CTaskEnum::Task & taskType): COptMethod(pParent, methodType, taskType) { assertParameter("Iteration Limit", CCopasiParameter::Type::UINT, (unsigned C_INT32) 200); assertParameter("Tolerance", CCopasiParameter::Type::UDOUBLE, (C_FLOAT64) 1.e-005); assertParameter("Scale", CCopasiParameter::Type::UDOUBLE, (C_FLOAT64) 10.0); initObjects(); }
void CConfigurationFile::initializeParameter() { assertGroup("Recent Files"); assertGroup("Recent SBML Files"); mpApplicationFont = assertParameter("Application Font", CCopasiParameter::STRING, std::string(""))->getValue().pSTRING; mpWebBrowser = assertParameter("Application for opening URLs", CCopasiParameter::STRING, std::string(""))->getValue().pSTRING; assertGroup("MIRIAM Resources"); elevateChildren(); }
bool CExperimentObjectMap::CDataColumn::setScale(const C_FLOAT64 & weight) { if (isnan(weight)) { if (mpScale != NULL) { removeParameter("Weight"); mpScale = NULL; } return true; } C_FLOAT64 DefaultWeight = getDefaultScale(); if (weight != DefaultWeight || isnan(DefaultWeight)) { if (mpScale != NULL) *mpScale = weight; else mpScale = assertParameter("Weight", CCopasiParameter::UDOUBLE, weight); return true; } if (mpScale != NULL) { removeParameter("Weight"); mpScale = NULL; } return true; }
/** * Default constructor. * @param "CModel *" pModel */ CLNAProblem::CLNAProblem(const CDataContainer * pParent): CCopasiProblem(CTaskEnum::Task::lna, pParent) { assertParameter("Steady-State", CCopasiParameter::Type::KEY, std::string("")); setSteadyStateRequested(true); CONSTRUCTOR_TRACE; }
void CSensProblem::initializeParameter() { mpSubTaskType = (CSensProblem::SubTaskType *) assertParameter("SubtaskType", CCopasiParameter::Type::UINT, (unsigned C_INT32) SteadyState); mpTargetFunctions = assertGroup("TargetFunctions"); mpVariablesGroup = assertGroup("ListOfVariables"); createParametersInGroup(mpTargetFunctions); }
void CConfigurationFile::initializeParameter() { assertGroup("Recent Files"); assertGroup("Recent SBML Files"); assertGroup("Recent SEDML Files"); mpApplicationFont = assertParameter("Application Font", CCopasiParameter::STRING, std::string(""))->getValue().pSTRING; assertGroup("MIRIAM Resources"); mpValidateUnits = assertParameter("Validate Units", CCopasiParameter::BOOL, false)->getValue().pBOOL; mpUseOpenGL = assertParameter("Use OpenGL", CCopasiParameter::BOOL, false)->getValue().pBOOL; mpUseAdvancedEditing = assertParameter("Use Advanced Editing", CCopasiParameter::BOOL, false)->getValue().pBOOL; mpWorkingDirectory = assertParameter("Working Directory", CCopasiParameter::STRING, std::string(""))->getValue().pSTRING; elevateChildren(); }
void CFitProblem::initializeParameter() { removeParameter("Subtask"); mpParmSubtaskCN = NULL; removeParameter("ObjectiveExpression"); mpParmObjectiveExpression = NULL; *mpParmMaximize = false; mpParmSteadyStateCN = assertParameter("Steady-State", CCopasiParameter::CN, CCopasiObjectName(""))->getValue().pCN; mpParmTimeCourseCN = assertParameter("Time-Course", CCopasiParameter::CN, CCopasiObjectName(""))->getValue().pCN; assertGroup("Experiment Set"); elevateChildren(); }
void CTrajectoryProblem::initializeParameter() { mpAutomaticStepSize = assertParameter("AutomaticStepSize", CCopasiParameter::BOOL, (bool) false); mpStepNumber = assertParameter("StepNumber", CCopasiParameter::UINT, (unsigned C_INT32) 100); mpStepSize = assertParameter("StepSize", CCopasiParameter::DOUBLE, (C_FLOAT64) 0.01); mpDuration = assertParameter("Duration", CCopasiParameter::DOUBLE, (C_FLOAT64) 1.0); mpTimeSeriesRequested = assertParameter("TimeSeriesRequested", CCopasiParameter::BOOL, (bool) true); mpOutputStartTime = assertParameter("OutputStartTime", CCopasiParameter::DOUBLE, (C_FLOAT64) 0.0); mpOutputEvent = assertParameter("Output Event", CCopasiParameter::BOOL, (bool) false); mpStartInSteadyState = assertParameter("Start in Steady State", CCopasiParameter::BOOL, false); }
COptMethodPraxis::COptMethodPraxis(const CDataContainer * pParent, const CTaskEnum::Method & methodType, const CTaskEnum::Task & taskType): COptMethod(pParent, methodType, taskType), mpPraxis(new FPraxisTemplate<COptMethodPraxis>(this, &COptMethodPraxis::evaluateFunction)), mpCPraxis(new CPraxis()) { assertParameter("Tolerance", CCopasiParameter::Type::DOUBLE, (C_FLOAT64) 1.e-005); initObjects(); }
void CILDMMethod::initializeParameter() { addObjectReference("Number of slow variables", mSlow, CCopasiObject::ValueInt); addMatrixReference("Contribution of Species to Slow Space", mVslow, CCopasiObject::ValueDbl); initializeIntegrationsParameter(); assertParameter("Deuflhard Tolerance", CCopasiParameter::UDOUBLE, (C_FLOAT64) 1.0e-6); createAnnotationsM(); emptyVectors(); }
void CSteadyStateMethod::initializeParameter() { CCopasiParameter *pParm; mpSSResolution = assertParameter("Resolution", CCopasiParameter::UDOUBLE, (C_FLOAT64) 1.0e-009); mpDerivationResolution = mpSSResolution; mpDerivationFactor = assertParameter("Derivation Factor", CCopasiParameter::UDOUBLE, (C_FLOAT64) 1.0e-003); // Check whether we have a method with the old parameter names if ((pParm = getParameter("Newton.DerivationFactor")) != NULL) { setValue("Derivation Factor", pParm->getValue< C_FLOAT64 >()); removeParameter("Newton.DerivationFactor"); } if ((pParm = getParameter("Newton.Resolution")) != NULL) { setValue("Resolution", pParm->getValue< C_FLOAT64 >()); removeParameter("Newton.Resolution"); } }
void CExperimentObjectMap::CDataColumn::initializeParameter() { mpRole = (CExperiment::Type *) assertParameter("Role", CCopasiParameter::UINT, (unsigned C_INT32) CExperiment::ignore); CCopasiParameter * pParm = getParameter("Object CN"); if (pParm != NULL) mpObjectCN = &pParm->getValue< CRegisteredObjectName >(); pParm = getParameter("Weight"); if (pParm != NULL) mpScale = &pParm->getValue< C_FLOAT64 >(); elevateChildren(); }
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(); }
void CTrajectoryProblem::initializeParameter() { mpStepNumber = assertParameter("StepNumber", CCopasiParameter::UINT, (unsigned C_INT32) 100)->getValue().pUINT; mpStepSize = assertParameter("StepSize", CCopasiParameter::DOUBLE, (C_FLOAT64) 0.01)->getValue().pDOUBLE;; mpDuration = assertParameter("Duration", CCopasiParameter::DOUBLE, (C_FLOAT64) 1.0)->getValue().pDOUBLE;; mpTimeSeriesRequested = assertParameter("TimeSeriesRequested", CCopasiParameter::BOOL, (bool) true)->getValue().pBOOL; mpOutputStartTime = assertParameter("OutputStartTime", CCopasiParameter::DOUBLE, (C_FLOAT64) 0.0)->getValue().pDOUBLE; mpOutputEvent = assertParameter("Output Event", CCopasiParameter::BOOL, (bool) false)->getValue().pBOOL; mpContinueSimultaneousEvents = assertParameter("Continue on Simultaneous Events", CCopasiParameter::BOOL, (bool) false)->getValue().pBOOL; }
bool CExperimentObjectMap::CDataColumn::setObjectCN(const std::string & objectCN) { if (objectCN == "") { if (mpObjectCN != NULL) { removeParameter("Object CN"); mpObjectCN = NULL; } } else { if (mpObjectCN != NULL) *mpObjectCN = objectCN; else mpObjectCN = assertParameter("Object CN", CCopasiParameter::CN, (CCopasiObjectName) objectCN); } return true; }
void CHybridMethod::initializeParameter() { CCopasiParameter *pParm; assertParameter("Max Internal Steps", CCopasiParameter::INT, (C_INT32) MAX_STEPS); assertParameter("Lower Limit", CCopasiParameter::DOUBLE, (C_FLOAT64) LOWER_STOCH_LIMIT); assertParameter("Upper Limit", CCopasiParameter::DOUBLE, (C_FLOAT64) UPPER_STOCH_LIMIT); assertParameter("Partitioning Interval", CCopasiParameter::UINT, (unsigned C_INT32) PARTITIONING_INTERVAL); assertParameter("Use Random Seed", CCopasiParameter::BOOL, (bool) USE_RANDOM_SEED); assertParameter("Random Seed", CCopasiParameter::UINT, (unsigned C_INT32) RANDOM_SEED); // Check whether we have a method with the old parameter names if ((pParm = getParameter("HYBRID.MaxSteps")) != NULL) { setValue("Max Internal Steps", pParm->getValue< C_INT32 >()); removeParameter("HYBRID.MaxSteps"); if ((pParm = getParameter("HYBRID.LowerStochLimit")) != NULL) { setValue("Lower Limit", pParm->getValue< C_FLOAT64 >()); removeParameter("HYBRID.LowerStochLimit"); } if ((pParm = getParameter("HYBRID.UpperStochLimit")) != NULL) { setValue("Upper Limit", pParm->getValue< C_FLOAT64 >()); removeParameter("HYBRID.UpperStochLimit"); } if ((pParm = getParameter("HYBRID.PartitioningInterval")) != NULL) { setValue("Partitioning Interval", pParm->getValue< unsigned C_INT32 >()); removeParameter("HYBRID.PartitioningInterval"); } if ((pParm = getParameter("UseRandomSeed")) != NULL) { setValue("Use Random Seed", pParm->getValue< bool >()); removeParameter("UseRandomSeed"); } if ((pParm = getParameter("")) != NULL) { setValue("Random Seed", pParm->getValue< unsigned C_INT32 >()); removeParameter(""); } } }
COptMethodSRES::COptMethodSRES(const CDataContainer * pParent, const CTaskEnum::Method & methodType, const CTaskEnum::Task & taskType): COptPopulationMethod(pParent, methodType, taskType), mStopAfterStalledGenerations(0), mEvaluationValue(std::numeric_limits< C_FLOAT64 >::max()), mBestValue(std::numeric_limits< C_FLOAT64 >::max()) { assertParameter("Number of Generations", CCopasiParameter::Type::UINT, (unsigned C_INT32) 200); assertParameter("Population Size", CCopasiParameter::Type::UINT, (unsigned C_INT32) 20); assertParameter("Random Number Generator", CCopasiParameter::Type::UINT, (unsigned C_INT32) CRandom::mt19937, eUserInterfaceFlag::editable); assertParameter("Seed", CCopasiParameter::Type::UINT, (unsigned C_INT32) 0, eUserInterfaceFlag::editable); assertParameter("Pf", CCopasiParameter::Type::DOUBLE, (C_FLOAT64) 0.475); //*****ADDED for SR assertParameter("Stop after # Stalled Generations", CCopasiParameter::Type::UINT, (unsigned C_INT32) 0, eUserInterfaceFlag::editable); initObjects(); }
void CRecentFiles::initializeParameter() { mpMaxFiles = assertParameter("MaxFiles", CCopasiParameter::UINT, (unsigned C_INT32) 5); mpRecentFiles = assertGroup("Recent Files"); }
void CAnalyticsProblem::initializeParameter() { mpFlagLimitCrossings = assertParameter("LimitCrossings", CCopasiParameter::BOOL, false); mpCrossingsLimit = assertParameter("NumCrossingsLimit", CCopasiParameter::UINT, (unsigned C_INT32)0); mpFlagLimitOutTime = assertParameter("LimitOutTime", CCopasiParameter::BOOL, false); mpFlagLimitOutCrossings = assertParameter("LimitOutCrossings", CCopasiParameter::BOOL, false); mpFlagPositiveDirection = assertParameter("PositiveDirection", CCopasiParameter::BOOL, true); mpOutCrossingsLimit = assertParameter("NumOutCrossingsLimit", CCopasiParameter::UINT, (unsigned C_INT32)0); mpFlagLimitConvergence = assertParameter("LimitUntilConvergence", CCopasiParameter::BOOL, false); mpConvergenceTolerance = assertParameter("ConvergenceTolerance", CCopasiParameter::DOUBLE, (C_FLOAT64)1E-6); mpThreshold = assertParameter("Threshold", CCopasiParameter::DOUBLE, (C_FLOAT64)0); mpFlagLimitOutConvergence = assertParameter("DelayOutputUntilConvergence", CCopasiParameter::BOOL, false); mpConvergenceOutTolerance = assertParameter("OutputConvergenceTolerance", CCopasiParameter::DOUBLE, (C_FLOAT64)1E-6); mpTriggerExpression = assertParameter("TriggerExpression", CCopasiParameter::EXPRESSION, std::string("")); mpSingleObjectCN = assertParameter("SingleVariable", CCopasiParameter::CN, CCopasiObjectName("")); setOutputEvent(false); }
void CConfigurationFile::initializeParameter() { assertGroup("Recent Files"); assertGroup("Recent SBML Files"); assertGroup("Recent SEDML Files"); mpApplicationFont = assertParameter("Application Font", CCopasiParameter::STRING, std::string("")); assertGroup("MIRIAM Resources"); mpValidateUnits = assertParameter("Validate Units", CCopasiParameter::BOOL, false); mpUseOpenGL = assertParameter("Use OpenGL", CCopasiParameter::BOOL, false); mpUseAdvancedSliders = assertParameter("Use Advanced Sliders", CCopasiParameter::BOOL, true); mpUseAdvancedEditing = assertParameter("Use Advanced Editing", CCopasiParameter::BOOL, false); mpNormalizePerExperiment = assertParameter("Normalize Weights per Experiment", CCopasiParameter::BOOL, true); mpWorkingDirectory = assertParameter("Working Directory", CCopasiParameter::STRING, std::string("")); mpProxyServer = assertParameter("Proxy Server", CCopasiParameter::STRING, std::string("")); mpProxyPort = assertParameter("Proxy Port", CCopasiParameter::INT, 0); mpProxyUser = assertParameter("Proxy User", CCopasiParameter::STRING, std::string("")); mpProxyPass = assertParameter("Proxy Password", CCopasiParameter::STRING, std::string("")); mpCurrentAuthorGivenName = assertParameter("Given Name", CCopasiParameter::STRING, std::string("Anonymous")); mpCurrentAuthorFamilyName = assertParameter("Famliy Name", CCopasiParameter::STRING, std::string("Anonymous")); mpCurrentAuthorOrganization = assertParameter("Organization", CCopasiParameter::STRING, std::string("")); mpCurrentAuthorEmail = assertParameter("Email", CCopasiParameter::STRING, std::string("*****@*****.**")); elevateChildren(); }
bool CFitProblem::elevateChildren() { // This call is necessary since CFitProblem is derived from COptProblem. if (!COptProblem::elevateChildren()) return false; // Due to a naming conflict the following parameters may have been overwritten during // the load of a CopasiML file we replace them with default values if that was the case. mpParmSteadyStateCN = assertParameter("Steady-State", CCopasiParameter::CN, CCopasiObjectName(""))->getValue().pCN; mpParmTimeCourseCN = assertParameter("Time-Course", CCopasiParameter::CN, CCopasiObjectName(""))->getValue().pCN; CCopasiVectorN< CCopasiTask > * pTasks = NULL; CCopasiDataModel* pDataModel = getObjectDataModel(); if (pDataModel) pTasks = pDataModel->getTaskList(); if (pTasks == NULL) pTasks = dynamic_cast<CCopasiVectorN< CCopasiTask > *>(getObjectAncestor("Vector")); if (pTasks) { unsigned C_INT32 i, imax = pTasks->size(); if (!mpParmSteadyStateCN->compare(0, 5 , "Task_") || *mpParmSteadyStateCN == "") for (i = 0; i < imax; i++) if ((*pTasks)[i]->getType() == CCopasiTask::steadyState) { *mpParmSteadyStateCN = (*pTasks)[i]->getCN(); break; } if (!mpParmTimeCourseCN->compare(0, 5 , "Task_") || *mpParmTimeCourseCN == "") for (i = 0; i < imax; i++) if ((*pTasks)[i]->getType() == CCopasiTask::timeCourse) { *mpParmTimeCourseCN = (*pTasks)[i]->getCN(); break; } } std::map<std::string, std::string> ExperimentMap; CCopasiParameterGroup * pGroup; CExperiment * pExperiment; std::vector<CCopasiParameter *> * pExperiments = getGroup("Experiment Set")->CCopasiParameter::getValue().pGROUP; std::vector<CCopasiParameter *>::iterator itExp; std::vector<CCopasiParameter *>::iterator endExp; for (itExp = pExperiments->begin(), endExp = pExperiments->end(); itExp != endExp; ++itExp) if ((pGroup = dynamic_cast< CCopasiParameterGroup * >(*itExp)) != NULL && pGroup->getParameter("Key") != NULL) ExperimentMap[*pGroup->getValue("Key").pKEY] = (*itExp)->getObjectName(); mpExperimentSet = elevate<CExperimentSet, CCopasiParameterGroup>(getGroup("Experiment Set")); if (!mpExperimentSet) return false; std::map<std::string, std::string>::iterator itMap; std::map<std::string, std::string>::iterator endMap; for (itMap = ExperimentMap.begin(), endMap = ExperimentMap.end(); itMap != endMap; ++itMap) { pExperiment = mpExperimentSet->getExperiment(itMap->second); itMap->second = pExperiment->CCopasiParameter::getKey(); pExperiment->setValue("Key", itMap->second); } std::vector<COptItem * >::iterator it = mpOptItems->begin(); std::vector<COptItem * >::iterator end = mpOptItems->end(); for (; it != end; ++it) { if (!((*it) = elevate<CFitItem, COptItem>(*it))) return false; pExperiments = (*it)->getParameter("Affected Experiments")->getValue().pGROUP; for (itExp = pExperiments->begin(), endExp = pExperiments->end(); itExp != endExp; ++itExp) (*itExp)->setValue(ExperimentMap[*(*itExp)->getValue().pKEY]); } it = mpConstraintItems->begin(); end = mpConstraintItems->end(); for (; it != end; ++it) { if (!((*it) = elevate<CFitConstraint, COptItem>(*it))) return false; pExperiments = (*it)->getParameter("Affected Experiments")->getValue().pGROUP; for (itExp = pExperiments->begin(), endExp = pExperiments->end(); itExp != endExp; ++itExp) (*itExp)->setValue(ExperimentMap[*(*itExp)->getValue().pKEY]); } return true; }
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"); }
void CStochDirectMethod::initializeParameter() { assertParameter("Max Internal Steps", CCopasiParameter::INT, (C_INT32) 1000000); assertParameter("Use Random Seed", CCopasiParameter::BOOL, false); assertParameter("Random Seed", CCopasiParameter::UINT, (unsigned C_INT32) 1); }