COPASI API
4.40.278
|
#include <COptProblem.h>
Classes | |
struct | sCounter |
Public Member Functions | |
COptItem & | addOptConstraint (const CCommonName &objectCN) |
COptItem & | addOptItem (const CCommonName &objectCN) |
C_FLOAT64 | adjustForIntervals (C_FLOAT64 *pValue, const C_FLOAT64 &min, const C_FLOAT64 &max) |
bool | adjustStartValue (COptItem &optItem) |
bool | adjustStartValuesForIntervals () |
virtual bool | calculate () |
virtual bool | calculateStatistics (const C_FLOAT64 &factor=1.0e-003, const C_FLOAT64 &resolution=1.0e-009) |
virtual void | calculateValue () override |
virtual bool | checkFunctionalConstraints () |
bool | checkIntervals () |
virtual bool | checkParametricConstraints () |
COptProblem (const COptProblem &src, const CDataContainer *pParent) | |
COptProblem (const CTaskEnum::Task &type=CTaskEnum::Task::optimization, const CDataContainer *pParent=NO_PARENT) | |
virtual bool | elevateChildren () override |
C_FLOAT64 | evalMinimizeIntervals (const C_FLOAT64 &value) |
const unsigned C_INT32 & | geFailedConstraintCounter () const |
const bool & | getCalculateStatistics () const |
const C_FLOAT64 & | getCalculateValue () const |
const unsigned C_INT32 & | getConstraintEvaluations () const |
const std::vector< COptItem * > & | getConstraintList () const |
CVectorCore< C_FLOAT64 * > & | getContainerVariables (const bool &algorithmOrder=false) const |
const sCounter & | getCounters () const |
const C_FLOAT64 & | getExecutionTime () const |
const unsigned C_INT32 & | getFailedEvaluationsExc () const |
const unsigned C_INT32 & | getFailedEvaluationsNaN () const |
const unsigned C_INT32 & | getFunctionEvaluations () const |
const std::string | getObjectiveFunction () |
COptItem & | getOptConstraint (const size_t &index) |
size_t | getOptConstraintSize () const |
COptItem & | getOptItem (const size_t &index) |
const std::vector< COptItem * > & | getOptItemList (const bool &algorithmOrder=false) const |
size_t | getOptItemSize () const |
const bool & | getRandomizeStartValues () const |
const C_FLOAT64 & | getSolutionValue () const |
const CVector< C_FLOAT64 > & | getSolutionVariables (const bool &algorithmOrder=false) const |
virtual CCopasiTask * | getSubTask () const override |
CTaskEnum::Task | getSubtaskType () const |
virtual void * | getValuePointer () const override |
const CVector< C_FLOAT64 > & | getVariableGradients () const |
size_t | getVariableSize () const |
void | incrementCounters (const sCounter &increment) |
virtual bool | initialize () override |
virtual bool | initializeSubtaskBeforeOutput () |
const bool & | maximize () const |
virtual void | print (std::ostream *ostream) const override |
virtual void | printResult (std::ostream *ostream) const override |
void | randomizeStartValues () |
void | rememberStartValues () |
bool | removeOptConstraint (const size_t &index) |
bool | removeOptItem (const size_t &index) |
void | reset () |
void | resetCounters () |
virtual bool | restore (const bool &updateModel) override |
void | setCalculateStatistics (const bool &calculate) |
virtual bool | setCallBack (CProcessReportLevel callBack) override |
void | setMaximize (const bool &maximize) |
bool | setObjectiveFunction (const std::string &infix) |
void | setParameters (const CVectorCore< C_FLOAT64 > ¶meters) |
void | setRandomizeStartValues (const bool &randomize) |
virtual bool | setSolution (const C_FLOAT64 &value, const CVector< C_FLOAT64 > &variables, const bool &algorithmOrder=false) |
CCommonName | setSubtaskType (const CTaskEnum::Task &subtaskType) |
bool | swapOptItem (const size_t &iFrom, const size_t &iTo) |
virtual | ~COptProblem () |
Public Member Functions inherited from CCopasiProblem | |
CCopasiProblem (const CCopasiProblem &src, const CDataContainer *pParent) | |
virtual void | clearCallBack () |
CCopasiProblem * | copy () const |
const CProcessReportLevel & | getCallBack () const |
CMathContainer * | getMathContainer () const |
const CTaskEnum::Task & | getType () const |
void | setMathContainer (CMathContainer *pContainer) |
virtual bool | setModel (CModel *model) |
virtual | ~CCopasiProblem () |
Public Member Functions inherited from CCopasiParameterGroup | |
bool | addGroup (const std::string &name) |
void | addParameter (CCopasiParameter *pParameter) |
bool | addParameter (const CCopasiParameter ¶meter) |
bool | addParameter (const std::string &name, const CCopasiParameter::Type type, const CCopasiParameter::UserInterfaceFlag &flag=CCopasiParameter::UserInterfaceFlag::All) |
template<class CType > | |
bool | addParameter (const std::string &name, const CCopasiParameter::Type type, const CType &value, const CCopasiParameter::UserInterfaceFlag &flag=CCopasiParameter::UserInterfaceFlag::All) |
virtual bool | applyData (const CData &data, CUndoData::CChangeSet &changes) |
CCopasiParameterGroup * | assertGroup (const std::string &name, const CCopasiParameter::UserInterfaceFlag &flag=CCopasiParameter::UserInterfaceFlag::All) |
template<class CType > | |
CType * | assertParameter (const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue, const CCopasiParameter::UserInterfaceFlag &flag=CCopasiParameter::UserInterfaceFlag::All) |
index_iterator | beginIndex () const |
const_name_iterator | beginName () const |
CCopasiParameterGroup (const CCopasiParameterGroup &src, const CDataContainer *pParent=NULL) | |
CCopasiParameterGroup (const std::string &name, const CDataContainer *pParent=NO_PARENT, const std::string &objectType="ParameterGroup") | |
void | clear () |
virtual void | createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const |
index_iterator | endIndex () const |
const_name_iterator | endName () const |
CCopasiParameterGroup & | getElementTemplates () |
const CCopasiParameterGroup & | getElementTemplates () const |
CCopasiParameterGroup * | getGroup (const size_t &index) |
const CCopasiParameterGroup * | getGroup (const size_t &index) const |
CCopasiParameterGroup * | getGroup (const std::string &name) |
const CCopasiParameterGroup * | getGroup (const std::string &name) const |
virtual size_t | getIndex (const CDataObject *pObject) const |
size_t | getIndex (const std::string &name) const |
std::string | getKey (const size_t &index) const |
std::string | getKey (const std::string &name) const |
virtual const std::string & | getName (const size_t &index) const |
virtual const CObjectInterface * | getObject (const CCommonName &cn) const |
CCopasiParameter * | getParameter (const size_t &index) |
const CCopasiParameter * | getParameter (const size_t &index) const |
CCopasiParameter * | getParameter (std::string name) |
const CCopasiParameter * | getParameter (std::string name) const |
CCopasiParameter::Type | getType (const size_t &index) const |
CCopasiParameter::Type | getType (const std::string &name) const |
std::string | getUniqueParameterName (const CCopasiParameter *pParameter) const |
template<class CType > | |
CType & | getValue (const size_t &index) |
template<class CType > | |
const CType & | getValue (const size_t &index) const |
template<class CType > | |
CType & | getValue (const std::string &name) |
template<class CType > | |
const CType & | getValue (const std::string &name) const |
bool | haveTemplate () const |
virtual CUndoObjectInterface * | insert (const CData &data) |
CCopasiParameterGroup & | operator= (const CCopasiParameterGroup &rhs) |
virtual bool | remove (CDataObject *pObject) |
bool | removeParameter (CCopasiParameter *pParameter) |
bool | removeParameter (const size_t &index) |
bool | removeParameter (const std::string &name) |
virtual void | setUserInterfaceFlag (const UserInterfaceFlag &flag) |
template<class CType > | |
bool | setValue (const size_t &index, const CType &value) |
template<class CType > | |
bool | setValue (const std::string &name, const CType &value) |
size_t | size (const UserInterfaceFlag &require=UserInterfaceFlag::None, const UserInterfaceFlag &exclude=UserInterfaceFlag::None) const |
bool | swap (const size_t &iFrom, const size_t &iTo) |
bool | swap (index_iterator &from, index_iterator &to) |
virtual CData | toData () const |
virtual void | updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject) |
virtual | ~CCopasiParameterGroup () |
Public Member Functions inherited from CCopasiParameter | |
CCopasiParameter (const CCopasiParameter &src, const CDataContainer *pParent) | |
CCopasiParameter (const std::string &name, const Type &type, const void *pValue=NULL, const CDataContainer *pParent=NO_PARENT, const std::string &objectType="Parameter") | |
virtual CCommonName | getCN () const override |
template<class CType > | |
const CType & | getDefault () const |
virtual const std::string & | getKey () const override |
virtual std::string | getObjectDisplayName () const override |
const CCopasiParameter::Type & | getType () const |
const UserInterfaceFlag & | getUserInterfaceFlag () const |
template<class CType > | |
std::vector< std::pair< CType, CType > > & | getValidValues () |
template<class CType > | |
const std::vector< std::pair< CType, CType > > & | getValidValues () const |
void * | getValidValuesPointer () const |
template<class CType > | |
CType & | getValue () |
template<class CType > | |
const CType & | getValue () const |
CDataObject * | getValueReference () const |
bool | hasValidValues () const |
bool | isBasic () const |
bool | isDefault () const |
bool | isEditable () const |
bool | isUnsupported () const |
bool | isValidValue (const bool &value) const |
bool | isValidValue (const C_FLOAT64 &value) const |
bool | isValidValue (const C_INT32 &value) const |
bool | isValidValue (const CCommonName &value) const |
template<class CType > | |
bool | isValidValue (const CType &) const |
bool | isValidValue (const std::string &value) const |
bool | isValidValue (const std::vector< CCopasiParameter * > &value) const |
bool | isValidValue (const unsigned C_INT32 &value) const |
CCopasiParameter & | operator= (const CCopasiParameter &rhs) |
template<class CType > | |
bool | setDefault (const CType &defaultValue) |
bool | setDefault (const std::vector< CCopasiParameter * > &defaultValue) |
virtual bool | setObjectParent (const CDataContainer *pParent) override |
template<class CType , class Enum > | |
bool | setValidValues (const CEnumAnnotation< CType, Enum > &validValues) |
template<class CType > | |
bool | setValidValues (const std::vector< std::pair< CType, CType > > &validValues) |
template<class CType > | |
bool | setValue (const CType &value) |
bool | setValue (const std::vector< CCopasiParameter * > &value) |
virtual | ~CCopasiParameter () |
Public Member Functions inherited from CDataContainer | |
virtual bool | add (CDataObject *pObject, const bool &adopt=true) |
virtual bool | appendDeletedDependentData (CUndoData &undoData) const |
CDataContainer (const CDataContainer &src, const CDataContainer *pParent) | |
CDataContainer (const std::string &name, const CDataContainer *pParent=NO_PARENT, const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None) | |
virtual std::string | getChildObjectUnits (const CDataObject *pObject) const |
void | getDescendants (CDataObject::DataObjectSet &descendants, const bool &recursive=false) const |
virtual objectMap & | getObjects () |
virtual const objectMap & | getObjects () const |
virtual const std::string | getUnits () const override |
virtual const CDataObject * | getValueObject () const override |
void | objectRenamed (CDataObject *pObject, const std::string &oldName) |
virtual | ~CDataContainer () |
Public Member Functions inherited from CDataObject | |
void | addIssue (const CIssue &issue) |
void | addReference (const CDataContainer *pReference) |
CDataObject (const CDataObject &src, const CDataContainer *pParent=NULL) | |
virtual void | destruct () override |
virtual const CDataObject * | getDataObject () const override |
CDataContainer * | getObjectAncestor (const std::string &type) const |
CDataModel * | getObjectDataModel () const |
const CObjectInterface * | getObjectFromCN (const CCommonName &cn) const |
const std::string & | getObjectName () const |
CDataContainer * | getObjectParent () const |
const std::string & | getObjectType () const |
virtual const CObjectInterface::ObjectSet & | getPrerequisites () const override |
virtual const CValidity & | getValidity () const override |
bool | hasFlag (const Flag &flag) const |
virtual bool | isPrerequisiteForContext (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const override |
bool | prerequisitsContains (const DataObjectSet &objects) const |
void | removeIssue (const CIssue &issue) |
void | removeReference (const CDataContainer *pReference) |
bool | setObjectName (const std::string &name) |
void | validityChanged (const CValidity &changedValidity) override |
void | validityRemoved (const CValidity &changedValidity) |
virtual | ~CDataObject () |
Public Member Functions inherited from CObjectInterface | |
CObjectInterface () | |
CObjectInterface (const CObjectInterface &src) | |
virtual | ~CObjectInterface () |
Public Member Functions inherited from CUndoObjectInterface | |
CUndoObjectInterface () | |
CUndoObjectInterface (const CUndoObjectInterface &src) | |
bool | generateUuid () |
const xg::Guid & | getUuid () const |
bool | setUuid (const std::string &uuid) |
bool | setUuid (const xg::Guid &uuid) |
virtual | ~CUndoObjectInterface () |
Static Public Attributes | |
static const CTaskEnum::Task | ValidSubtasks [] |
Static Public Attributes inherited from CCopasiParameter | |
static const CEnumAnnotation< std::string, Type > | TypeName |
static const CEnumAnnotation< std::string, Type > | XMLType |
Static Public Attributes inherited from CDataContainer | |
static const CObjectInterface::ContainerList | EmptyList |
Protected Member Functions | |
virtual void | updateContainer (const bool &update) |
Protected Member Functions inherited from CCopasiProblem | |
CCopasiProblem (const CCopasiProblem &src) | |
CCopasiProblem (const CTaskEnum::Task &type, const CDataContainer *pParent) | |
virtual void | signalMathContainerChanged () |
Protected Member Functions inherited from CCopasiParameterGroup | |
CCopasiParameterGroup () | |
Protected Member Functions inherited from CCopasiParameter | |
CCopasiParameter (const CCopasiParameter &src) | |
Protected Member Functions inherited from CDataContainer | |
template<class CType > | |
CDataMatrixReference< CType > * | addMatrixReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
template<class CType > | |
CDataObjectReference< CType > * | addObjectReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
template<class CType > | |
CDataVectorReference< CType > * | addVectorReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
CDataContainer (const CDataContainer &src) | |
void | initObjects () |
Protected Member Functions inherited from CDataObject | |
CDataObject () | |
CDataObject (const std::string &name, const CDataContainer *pParent=static_cast< CDataContainer * >((void *) 0), const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None) | |
Private Member Functions | |
void | initializeParameter () |
void | initObjects () |
Static Private Attributes | |
static C_FLOAT64 | MissingValue |
Friends | |
std::ostream & | operator<< (std::ostream &os, const COptProblem &o) |
Additional Inherited Members | |
Public Types inherited from CCopasiParameterGroup | |
typedef CDataObjectMap::const_type_iterator< CCopasiParameter > | const_name_iterator |
typedef std::vector< CCopasiParameter * > | elements |
typedef elements::iterator | index_iterator |
typedef CDataObjectMap::type_iterator< CCopasiParameter > | name_iterator |
Public Types inherited from CCopasiParameter | |
enum class | eUserInterfaceFlag { editable , basic , unsupported , __SIZE } |
enum class | Type { DOUBLE = 0 , UDOUBLE , INT , UINT , BOOL , GROUP , STRING , CN , KEY , FILE , EXPRESSION , INVALID , __SIZE } |
typedef CFlags< eUserInterfaceFlag > | UserInterfaceFlag |
Public Types inherited from CDataContainer | |
typedef CDataObjectMap | objectMap |
Public Types inherited from CDataObject | |
typedef std::set< const CDataObject * > | DataObjectSet |
enum | Flag { Container , Vector , Matrix , NameVector , Reference , ValueBool , ValueInt , ValueInt64 , ValueDbl , NonUniqueName , StaticString , ValueString , Separator , DisplayName , ModelEntity , Array , DataModel , Root , Gui , __SIZE } |
Public Types inherited from CObjectInterface | |
typedef std::vector< const CDataContainer * > | ContainerList |
typedef std::set< const CObjectInterface * > | ObjectSet |
Static Public Member Functions inherited from CCopasiParameter | |
static void | allocateValidValues (const Type &type, void *&pValidValues) |
static void | allocateValue (const Type &type, void *&pValue) |
static void | assignValue (const Type &type, void *&pValue, const void *pNewValue) |
static void | deleteValidValues (const Type &type, void *&pValidValues) |
static void | deleteValue (const Type &type, void *&pValue) |
static CCopasiParameter * | fromData (const CData &data, CUndoObjectInterface *pParent) |
Static Public Member Functions inherited from CDataContainer | |
static CDataContainer * | fromData (const CData &data, CUndoObjectInterface *pParent) |
Static Public Member Functions inherited from CDataObject | |
static CDataObject * | fromData (const CData &data, CUndoObjectInterface *pParent) |
static void | sanitizeObjectName (std::string &name) |
Static Public Member Functions inherited from CObjectInterface | |
static const CDataObject * | DataObject (const CObjectInterface *pInterface) |
static CObjectInterface * | GetObjectFromCN (const ContainerList &listOfContainer, const CCommonName &objName) |
Static Public Member Functions inherited from CUndoObjectInterface | |
template<class CType > | |
static CType * | fromData (const CData &, CUndoObjectInterface *) |
COptProblem::COptProblem | ( | const CTaskEnum::Task & | type = CTaskEnum::Task::optimization , |
const CDataContainer * | pParent = NO_PARENT |
||
) |
Default constructor
const | CTaskEnum::Task & type (default: optimization) |
const | CDataContainer * pParent (default: NULL) |
References initializeParameter(), and initObjects().
COptProblem::COptProblem | ( | const COptProblem & | src, |
const CDataContainer * | pParent | ||
) |
Copy constructor.
const | COptProblem & src |
const | CDataContainer * pParent (default: NULL) |
References initializeParameter(), and initObjects().
COptItem & COptProblem::addOptConstraint | ( | const CCommonName & | objectCN | ) |
Add an optimization constraint to the problem.
const | CCommonName & objectCN |
References CCopasiParameterGroup::addParameter(), CDataObject::getObjectDataModel(), mpGrpConstraints, and COptItem::setObjectCN().
COptItem & COptProblem::addOptItem | ( | const CCommonName & | objectCN | ) |
Add an optimization item to the problem.
const | CCommonName & objectCN |
References CCopasiParameterGroup::addParameter(), CDataObject::getObjectDataModel(), mpGrpItems, and COptItem::setObjectCN().
C_FLOAT64 COptProblem::adjustForIntervals | ( | C_FLOAT64 * | pValue, |
const C_FLOAT64 & | min, | ||
const C_FLOAT64 & | max | ||
) |
Adjust the value so that all intervals are >= 0
C_FLOAT64 | * pValue |
const | C_FLOAT64 & min |
const | C_FLOAT64 & max |
References C_FLOAT64, evalMinimizeIntervals(), CBrent::findMinimum(), max, min, and mpAdjust.
Referenced by adjustStartValue().
bool COptProblem::adjustStartValue | ( | COptItem & | optItem | ) |
Adjust the start values so that we have valid intervals (>= 0) for all items
COptItem | & optItem |
References adjustForIntervals(), CMathContainer::applyUpdateSequence(), C_FLOAT64, COptItem::getDependentItems(), COptItem::getLowerBoundValue(), COptItem::getObject(), COptItem::getStartValue(), COptItem::getUpperBoundValue(), CObjectInterface::getValuePointer(), mAdjustedItems, CCopasiProblem::mpContainer, and COptItem::setStartValue().
Referenced by adjustStartValuesForIntervals().
bool COptProblem::adjustStartValuesForIntervals | ( | ) |
Adjust the start values so that we have valid intervals (>= 0) for all items
References adjustStartValue(), CVectorCore< CType >::begin(), C_FLOAT64, checkIntervals(), CMathContainer::getCompleteInitialState(), mContainerVariablesAlgorithm, mCountInfluencingIntervals, mOptItemAlgorithm, CCopasiProblem::mpContainer, and CMathContainer::setCompleteInitialState().
Referenced by initialize().
|
virtual |
Do the calculating based on CalculateVariables and fill CalculateResults with the results.
calculate() decides whether the problem is a steady state problem or a trajectory problem based on whether the pointer to that type of problem is null or not. It then calls the process() method for that type of problem. Currently process takes ofstream& as a parameter but it will change so that process() takes no parameters.
Reimplemented in CFitProblem, and CRealProblem.
References CMathContainer::applyUpdateSequence(), COptProblem::sCounter::Counter, COptProblem::sCounter::FailedCounterException, COptProblem::sCounter::FailedCounterNaN, CCopasiMessage::getLastMessage(), CCopasiTask::getProblem(), CCopasiTask::getType(), CCopasiTask::initialize(), mCalculateValue, mCounters, mhCounter, mInitialRefreshSequence, CCopasiProblem::mpContainer, mpMathObjectiveExpression, mpParmMaximize, CCopasiProblem::mProcessReport, mpSubTask, mStoreResults, mUpdateObjectiveFunction, CCopasiTask::NO_OUTPUT, CCopasiTask::ONLY_TIME_SERIES, pdelete, CCopasiTask::process(), CProcessReportLevel::progressItem(), CTaskEnum::timeCourse, and CMathExpression::value().
Referenced by calculateStatistics(), COptMethodPS::evaluate(), COptMethod::objectiveValue(), and setCalculateStatistics().
|
virtual |
Calculate the statistics for the problem
const | C_FLOAT64 & factor (Default: 1.0e-003) |
const | C_FLOAT64 & resolution (Default: 1.0e-009) |
Reimplemented in CFitProblem.
References CMathContainer::applyUpdateSequence(), CVectorCore< CType >::array(), C_FLOAT64, calculate(), CCopasiTimer::calculateValue(), mCalculateValue, mContainerVariables, mCPUTime, mGradient, mHaveStatistics, mInitialRefreshSequence, CCopasiProblem::mpContainer, mpParmCalculateStatistics, mpParmMaximize, mSolutionValue, mSolutionVariables, mStoreResults, mWorstValue, CVector< CType >::resize(), and CVectorCore< CType >::size().
Referenced by COptTask::process().
|
overridevirtual |
Calculate the objects value.
Reimplemented from CDataObject.
References C_FLOAT64, mMinInterval, and mpOptItems.
|
virtual |
Check whether all functional constraints are fulfilled.
Reimplemented in CFitProblem.
References CMathContainer::applyUpdateSequence(), COptProblem::sCounter::ConstraintCounter, COptProblem::sCounter::FailedConstraintCounter, mCounters, mpConstraintItems, CCopasiProblem::mpContainer, and mUpdateConstraints.
Referenced by COptMethodPS::evaluate(), and COptMethod::reflect().
bool COptProblem::checkIntervals | ( | ) |
Check whether all item intervals are valid.
References CMathContainer::applyUpdateSequence(), mMinInterval, CCopasiProblem::mpContainer, and mUpdateIntervals.
Referenced by adjustStartValuesForIntervals().
|
virtual |
Check whether all parameters are within their boundaries.
References mpOptItems.
Referenced by COptMethod::reflect().
|
overridevirtual |
This methods must be called to elevate subgroups to derived objects. The default implementation does nothing.
Reimplemented from CCopasiParameterGroup.
Reimplemented in CFitProblem.
References C_INVALID_INDEX, CRootContainer::getFunctionList(), CDataVectorN< CType >::getIndex(), CEvaluationTree::getInfix(), CCopasiParameterGroup::getParameter(), CCopasiParameter::getValue(), CFunctionDB::loadedFunctions(), mpConstraintItems, mpGrpConstraints, mpGrpItems, mpOptItems, mpParmObjectiveExpression, mpParmSubTaskCN, CCopasiParameterGroup::removeParameter(), setObjectiveFunction(), setSubtaskType(), CTaskEnum::steadyState, and CTaskEnum::timeCourse.
Referenced by CFitProblem::elevateChildren(), and initializeParameter().
Calculate the RMS of the interval size for items which have invalid intervals
const | C_FLOAT64 & value |
References CMathContainer::applyUpdateSequence(), C_FLOAT64, mAdjustedItems, mpAdjust, CCopasiProblem::mpContainer, and SQRT_EPSILON.
Referenced by adjustForIntervals().
const unsigned C_INT32 & COptProblem::geFailedConstraintCounter | ( | ) | const |
Retrieve the counter of failed Constraint Evaluations
References COptProblem::sCounter::FailedConstraintCounter, and mCounters.
const bool & COptProblem::getCalculateStatistics | ( | ) | const |
Retrieve whether we have to calculate statistics
References mpParmCalculateStatistics.
const C_FLOAT64 & COptProblem::getCalculateValue | ( | ) | const |
Retrieve the result of a calculation
References mCalculateValue.
Referenced by COptMethodPS::evaluate(), and COptMethod::objectiveValue().
const unsigned C_INT32 & COptProblem::getConstraintEvaluations | ( | ) | const |
Retrieve the constraint evaluation counter.
References COptProblem::sCounter::ConstraintCounter, and mCounters.
const std::vector< COptItem * > & COptProblem::getConstraintList | ( | ) | const |
Retrieve the list of constraints.
References mpConstraintItems.
CVectorCore< C_FLOAT64 * > & COptProblem::getContainerVariables | ( | const bool & | algorithmOrder = false | ) | const |
Retrieve the update methods for the variables for calculation.
const | bool & algorithmOrder (default: false) |
References mContainerVariables, and mContainerVariablesAlgorithm.
Referenced by COptMethodPS::create(), and COptMethodPS::move().
const COptProblem::sCounter & COptProblem::getCounters | ( | ) | const |
Retrieve the internal counter
References mCounters.
Referenced by COptMethodPS::evaluate(), and COptMethodSS::localmin().
const C_FLOAT64 & COptProblem::getExecutionTime | ( | ) | const |
Retrieve the objective function.
References CCopasiTimer::getElapsedTimeSeconds(), and mCPUTime.
const unsigned C_INT32 & COptProblem::getFailedEvaluationsExc | ( | ) | const |
Retrieve the counter of failed Evaluations (Exception)
References COptProblem::sCounter::FailedCounterException, and mCounters.
const unsigned C_INT32 & COptProblem::getFailedEvaluationsNaN | ( | ) | const |
Retrieve the counter of failed Evaluations (NaN)
References COptProblem::sCounter::FailedCounterNaN, and mCounters.
const unsigned C_INT32 & COptProblem::getFunctionEvaluations | ( | ) | const |
Retrieve the evaluation counter.
References COptProblem::sCounter::Counter, and mCounters.
const std::string COptProblem::getObjectiveFunction | ( | ) |
Retrieve the objective function.
References CEvaluationTree::getInfix(), mpObjectiveExpression, mpParmObjectiveExpression, and CExpression::updateInfix().
COptItem & COptProblem::getOptConstraint | ( | const size_t & | index | ) |
Retrieve the 'index' optimization constraint.
const | size_t & index |
size_t COptProblem::getOptConstraintSize | ( | ) | const |
Retrieve the number of optimization constraints.
References mpGrpConstraints, and CCopasiParameterGroup::size().
COptItem & COptProblem::getOptItem | ( | const size_t & | index | ) |
const std::vector< COptItem * > & COptProblem::getOptItemList | ( | const bool & | algorithmOrder = false | ) | const |
Retrieve the list of optimization parameters.
const | bool & algorithmOrder (default: false) |
References mOptItemAlgorithm, and mpOptItems.
Referenced by ResultData::appliesTo(), ResultData::applyToModelStateFromOptTask(), COptMethodPS::create(), COptMethodSS::localmin(), COptMethodPS::move(), ResultData::setOptItemStartValues(), and ResultData::updateFitItemsFromOptItems().
size_t COptProblem::getOptItemSize | ( | ) | const |
Retrieve the number of optimization items.
References mpGrpItems, and CCopasiParameterGroup::size().
Referenced by ResultData::appliesTo().
const bool & COptProblem::getRandomizeStartValues | ( | ) | const |
Retrieve whether we have to calculate statistics
References mpParmRandomizeStartValues.
const C_FLOAT64 & COptProblem::getSolutionValue | ( | ) | const |
Retrieve the result for the solution
References mSolutionValue.
Referenced by COptMethodSS::localmin().
const CVector< C_FLOAT64 > & COptProblem::getSolutionVariables | ( | const bool & | algorithmOrder = false | ) | const |
Retrieve the solution variables
const | bool & algorithmOrder (default: false) |
References mSolutionVariables, and mSolutionVariablesAlgorithm.
Referenced by COptMethodSS::localmin().
|
overridevirtual |
Retrieve the optional sub task
Reimplemented from CCopasiProblem.
References CDataObject::getObjectAncestor(), CObjectInterface::GetObjectFromCN(), and mpParmSubTaskCN.
Referenced by initializeSubtaskBeforeOutput().
CTaskEnum::Task COptProblem::getSubtaskType | ( | ) | const |
Retrieve the subtask type
References CCopasiTask::getType(), mpSubTask, and CTaskEnum::UnsetTask.
|
overridevirtual |
Retrieve a pointer to the value of the object
Reimplemented from CCopasiParameter.
References C_FLOAT64, and mMinInterval.
Retrieve the gradients for each solution variable.
References mGradient.
size_t COptProblem::getVariableSize | ( | ) | const |
Retrieve the size of the variable vectors.
void COptProblem::incrementCounters | ( | const sCounter & | increment | ) |
Adds increment to the internal counters
const | sCounter & increment |
References COptProblem::sCounter::ConstraintCounter, COptProblem::sCounter::Counter, COptProblem::sCounter::FailedConstraintCounter, COptProblem::sCounter::FailedCounterException, COptProblem::sCounter::FailedCounterNaN, mCounters, mhCounter, CCopasiProblem::mProcessReport, and CProcessReportLevel::progressItem().
|
overridevirtual |
Do all necessary initialization so that calls to calculate will be successful. This is called once from CCopasiTask::process()
Reimplemented from CCopasiProblem.
Reimplemented in CFitProblem.
References COptItem::addDependentItem(), CMathDependencyGraph::addObject(), adjustStartValuesForIntervals(), C_FLOAT64, CMathUpdateSequence::clear(), CCopasiParameterGroup::clear(), CExpression::compile(), CCore::Default, CCopasiMessage::ERROR, CEvaluationTree::getInfix(), CMathContainer::getInitialDependencies(), CMathContainer::getInitialStateObjects(), CCopasiTask::getMethod(), CDataObject::getObjectParent(), CObjectInterface::getPrerequisites(), CMathExpression::getPrerequisites(), CCopasiTask::getReport(), CMathContainer::getSimulationUpToDateObjects(), CMathContainer::getStateObjects(), CReport::getStream(), CCopasiMethod::getSubType(), CMathContainer::getTransientDependencies(), CMathDependencyGraph::getUpdateSequence(), CEvaluationTree::mapObjectNodes(), mContainerVariables, mContainerVariablesAlgorithm, MCOptimization, mCounters, mCountInfluencingIntervals, mCPUTime, mInitialRefreshSequence, MissingValue, mOptItem2Index, mOptItemAlgorithm, mOriginalVariables, mpConstraintItems, CCopasiProblem::mpContainer, mpMathObjectiveExpression, mpObjectiveExpression, mpOptItems, mpParmMaximize, CCopasiProblem::mpReport, CDataObject::mPrerequisits, mpSubTask, mpSubTaskSrc, mSolutionValue, mSolutionVariables, mSolutionVariablesAlgorithm, mUpdateConstraints, mUpdateIntervals, mUpdateObjectiveFunction, mWorstValue, pdelete, CVector< CType >::resize(), CCopasiTimer::start(), CTaskEnum::Statistics, CCore::UpdateMoieties, and CCopasiMessage::WARNING.
Referenced by COptMethodSS::initialize(), CFitProblem::initialize(), and COptTask::initialize().
|
private |
Allocates all group parameters and assures that they are properly initialized.
References CCopasiParameterGroup::assertGroup(), CCopasiParameterGroup::assertParameter(), CCopasiParameter::BOOL, CCopasiParameter::CN, elevateChildren(), CCopasiParameter::EXPRESSION, mpGrpConstraints, mpGrpItems, mpParmCalculateStatistics, mpParmMaximize, mpParmObjectiveExpression, mpParmRandomizeStartValues, and mpParmSubTaskCN.
Referenced by COptProblem().
|
virtual |
perform at least the initializations of the subtask that must be done before the output is initialized.
References CTaskFactory::copy(), getSubTask(), CCopasiTask::initialize(), CCopasiProblem::mpContainer, CCopasiProblem::mProcessReport, mpSubTask, mpSubTaskSrc, CCopasiTask::NO_OUTPUT, pdelete, CCopasiTask::setCallBack(), and CCopasiTask::setMathContainer().
Referenced by COptMethodSS::initialize(), and COptTask::initialize().
|
private |
const bool & COptProblem::maximize | ( | ) | const |
Check whether we have to maximize
References mpParmMaximize.
Referenced by setMaximize().
|
overridevirtual |
This is the output method for any object. The default implementation provided with CDataObject uses the ostream operator<< of the object to print the object.To override this default behavior one needs to reimplement the virtual print function.
std::ostream | * ostream |
Reimplemented from CCopasiProblem.
Reimplemented in CFitProblem.
|
overridevirtual |
This is the output method for any result of a problem. The default implementation provided with CCopasiProblem. Does only print "Not implemented." To override this default behavior one needs to reimplement the virtual printResult function.
std::ostream | * ostream |
Reimplemented from CCopasiProblem.
Reimplemented in CFitProblem.
References C_FLOAT64, COptProblem::sCounter::Counter, CCopasiTimer::getElapsedTime(), CCopasiTimeVariable::getMilliSeconds(), CCopasiTimeVariable::getSeconds(), CCopasiTimeVariable::LL2String(), mCounters, mCPUTime, mpOptItems, mSolutionValue, mSolutionVariables, and CVectorCore< CType >::size().
void COptProblem::randomizeStartValues | ( | ) |
Randomize the start values if requested
References CMathContainer::getRandomGenerator(), CCopasiProblem::mpContainer, mpOptItems, and mpParmRandomizeStartValues.
Referenced by COptTask::process(), and CFitTask::process().
void COptProblem::rememberStartValues | ( | ) |
Remember the start values;
References mpOptItems.
Referenced by COptTask::process(), and CFitTask::process().
bool COptProblem::removeOptConstraint | ( | const size_t & | index | ) |
Remove an optimization constraint.
const | size_t & index |
References mpGrpConstraints, and CCopasiParameterGroup::removeParameter().
bool COptProblem::removeOptItem | ( | const size_t & | index | ) |
Remove an optimization items.
const | size_t & index |
References mpGrpItems, and CCopasiParameterGroup::removeParameter().
void COptProblem::reset | ( | ) |
Reset counters and objective value.
References mCounters, mpParmMaximize, and mSolutionValue.
Referenced by COptMethodSS::localmin(), and setCallBack().
void COptProblem::resetCounters | ( | ) |
Resets the internal counter
References mCounters.
Referenced by COptMethodPS::evaluate(), COptMethodSS::localmin(), and COptTask::process().
|
overridevirtual |
Do all necessary restore procedures so that the model is in the same state as before
const | bool & updateModel |
Reimplemented from CCopasiProblem.
Reimplemented in CFitProblem.
References CMathContainer::applyUpdateSequence(), CVectorCore< CType >::array(), C_FLOAT64, COptProblem::sCounter::ConstraintCounter, COptProblem::sCounter::Counter, COptProblem::sCounter::FailedConstraintCounter, COptProblem::sCounter::FailedCounterException, COptProblem::sCounter::FailedCounterNaN, MCOptimization, mCounters, mInitialRefreshSequence, CCopasiProblem::mpContainer, mpOptItems, mpSubTask, mSolutionValue, mSolutionVariables, mWorstValue, CMathContainer::pushInitialState(), CCopasiTask::restore(), updateContainer(), and CCopasiMessage::WARNING.
Referenced by CScanTask::processCallback(), and CFitProblem::restore().
void COptProblem::setCalculateStatistics | ( | const bool & | calculate | ) |
Set whether we have to calculate statistics
const | bool & calculate |
References calculate(), and mpParmCalculateStatistics.
Referenced by COptMethodSS::initialize().
|
overridevirtual |
Set the call back of the problem
CProcessReport | * pCallBack |
Reimplemented from CCopasiProblem.
Reimplemented in CFitProblem.
References CProcessReportLevel::addItem(), C_INVALID_INDEX, COptProblem::sCounter::Counter, mCounters, mhCounter, mhSolutionValue, CCopasiProblem::mProcessReport, mpSubTask, mSolutionValue, reset(), CCopasiProblem::setCallBack(), and CCopasiTask::setCallBack().
Referenced by COptMethodSS::initialize(), and CFitProblem::setCallBack().
void COptProblem::setMaximize | ( | const bool & | maximize | ) |
Set whether we have to maximize the objective function
const | bool & maximize |
References maximize(), and mpParmMaximize.
bool COptProblem::setObjectiveFunction | ( | const std::string & | infix | ) |
Set optimization function
const | std::string & infix |
References mpObjectiveExpression, mpParmObjectiveExpression, and CExpression::setInfix().
Referenced by elevateChildren().
void COptProblem::setParameters | ( | const CVectorCore< C_FLOAT64 > & | parameters | ) |
Set parameters for which calculations and checks will be performed
const | CVectorCore< C_FLOAT64 > & parameters |
References CVectorCore< CType >::begin(), C_FLOAT64, CVectorCore< CType >::end(), mContainerVariables, and CVectorCore< CType >::size().
Referenced by COptMethod::objectiveValue().
void COptProblem::setRandomizeStartValues | ( | const bool & | randomize | ) |
Set whether we have to randomize start values
const | bool & randomize |
References mpParmRandomizeStartValues.
Referenced by COptMethodSS::initialize().
|
virtual |
Set the solution.
const | C_FLOAT64 & value |
const | CVector< C_FLOAT64 > & variables |
const | bool & algorithmOrder (default: false) |
Reimplemented in CFitProblem.
References CVectorCore< CType >::begin(), C_FLOAT64, mhSolutionValue, mOptItem2Index, mOptItemAlgorithm, mpParmMaximize, CCopasiProblem::mProcessReport, mSolutionValue, mSolutionVariables, mSolutionVariablesAlgorithm, CProcessReportLevel::progressItem(), and CVectorCore< CType >::size().
Referenced by CFitProblem::setSolution().
CCommonName COptProblem::setSubtaskType | ( | const CTaskEnum::Task & | subtaskType | ) |
Set subtask type
const | CTaskEnum::Task & subtaskType |
References CDataVector< CType >::begin(), CDataVector< CType >::end(), CDataObject::getCN(), CDataObject::getObjectAncestor(), CDataObject::getObjectDataModel(), and mpParmSubTaskCN.
Referenced by elevateChildren(), and CFitProblem::initialize().
bool COptProblem::swapOptItem | ( | const size_t & | iFrom, |
const size_t & | iTo | ||
) |
Swap two optimization items.
const | size_t & iFrom |
const | size_t & iTo |
References mpGrpItems, and CCopasiParameterGroup::swap().
|
protectedvirtual |
Do all necessary restore procedures for the container is in the same state as before or the new state if update is true.
const | bool & update |
Reimplemented in CFitProblem.
References CVectorCore< CType >::array(), C_FLOAT64, mContainerVariables, mOriginalVariables, mSolutionValue, mSolutionVariables, mWorstValue, and CVectorCore< CType >::size().
Referenced by CFitProblem::createParameterSets(), restore(), and CFitProblem::updateContainer().
|
friend |
|
protected |
The set of COptItems which intervals are adjusted
Referenced by adjustStartValue(), and evalMinimizeIntervals().
|
protected |
A vector of results for calculate
Referenced by calculate(), CFitProblem::calculate(), calculateStatistics(), CFitProblem::calculateStatistics(), and getCalculateValue().
A vector of pointer to the container variables
Referenced by calculateStatistics(), CFitProblem::calculateStatistics(), getContainerVariables(), initialize(), CFitProblem::initialize(), setParameters(), CFitProblem::setSolution(), and updateContainer().
Referenced by adjustStartValuesForIntervals(), getContainerVariables(), initialize(), and CFitProblem::initialize().
|
protected |
Referenced by calculate(), CFitProblem::calculate(), CFitProblem::calculateCrossValidation(), checkFunctionalConstraints(), CFitProblem::checkFunctionalConstraints(), geFailedConstraintCounter(), getConstraintEvaluations(), getCounters(), getFailedEvaluationsExc(), getFailedEvaluationsNaN(), getFunctionEvaluations(), incrementCounters(), initialize(), initObjects(), printResult(), CFitProblem::printResult(), reset(), resetCounters(), restore(), and setCallBack().
|
protected |
Number of items influencing intervals
Referenced by adjustStartValuesForIntervals(), and initialize().
|
protected |
A CPU Timer
Referenced by calculateStatistics(), CFitProblem::calculateStatistics(), getExecutionTime(), initialize(), printResult(), and CFitProblem::printResult().
The gradient vector for the parameters
Referenced by calculateStatistics(), CFitProblem::calculateStatistics(), getVariableGradients(), and CFitProblem::printResult().
|
protected |
Indicates whether the statistics have been calculated for the current result
Referenced by calculateStatistics(), CFitProblem::calculateStatistics(), CFitProblem::initialize(), and CFitProblem::printResult().
|
protected |
Handle of "Function Evaluations" process report item
Referenced by calculate(), CFitProblem::calculate(), CFitProblem::calculateCrossValidation(), incrementCounters(), and setCallBack().
|
protected |
Handle of "Best Value" process report item
Referenced by setCallBack(), and setSolution().
|
protected |
A vector of refresh methods which need to be called update all initial values which depend on the optimization items.
Referenced by calculate(), calculateStatistics(), CFitProblem::createParameterSets(), initialize(), and restore().
|
staticprivate |
Referenced by initialize().
|
protected |
The value of the smallest interval
Referenced by calculateValue(), checkIntervals(), and getValuePointer().
|
protected |
Referenced by initialize(), and setSolution().
|
protected |
Referenced by adjustStartValuesForIntervals(), getOptItemList(), initialize(), CFitProblem::initialize(), and setSolution().
A vector of solution variables
Referenced by initialize(), and updateContainer().
|
protected |
A pointer to the value to be adjusted to create valid intervals
Referenced by adjustForIntervals(), and evalMinimizeIntervals().
|
protected |
A pointer to the vector of optimization constraints
Referenced by CFitProblem::calculate(), CFitProblem::calculateCrossValidation(), checkFunctionalConstraints(), CFitProblem::checkFunctionalConstraints(), elevateChildren(), CFitProblem::elevateChildren(), getConstraintList(), initialize(), and CFitProblem::initialize().
|
protected |
A pointer to the value of the CCopasiParameter holding the OptimizationConstraints
Referenced by CFitProblem::addFitConstraint(), addOptConstraint(), elevateChildren(), getOptConstraintSize(), initializeParameter(), and removeOptConstraint().
|
protected |
A pointer to the value of the CCopasiParameterGroup holding the OptimizationItems
Referenced by CFitProblem::addFitItem(), addOptItem(), elevateChildren(), getOptItemSize(), initializeParameter(), removeOptItem(), and swapOptItem().
|
protected |
The objective function which should be minimized or maximized.
Referenced by calculate(), and initialize().
|
protected |
The objective function which should be minimized or maximized.
Referenced by getObjectiveFunction(), initialize(), and setObjectiveFunction().
|
protected |
A pointer to the vector of optimization items
Referenced by CFitProblem::calculate(), calculateValue(), checkParametricConstraints(), CFitProblem::createParameterSets(), elevateChildren(), CFitProblem::elevateChildren(), getOptItemList(), initialize(), CFitProblem::initialize(), printResult(), CFitProblem::printResult(), randomizeStartValues(), rememberStartValues(), restore(), CFitProblem::restore(), and CFitProblem::updateContainer().
|
protected |
A pointer to the value of the CCopasiParameter holding Calculate Statistics
Referenced by calculateStatistics(), CFitProblem::calculateStatistics(), getCalculateStatistics(), initializeParameter(), CFitProblem::printResult(), and setCalculateStatistics().
|
protected |
A pointer to the value of the CCopasiParameter holding Maximize
Referenced by calculate(), calculateStatistics(), initialize(), initializeParameter(), CFitProblem::initializeParameter(), maximize(), reset(), setMaximize(), and setSolution().
|
protected |
A pointer to the value of the CCopasiParameter holding the infix expression of the objective function
Referenced by elevateChildren(), getObjectiveFunction(), initializeParameter(), CFitProblem::initializeParameter(), and setObjectiveFunction().
|
protected |
A pointer to the value of the CCopasiParameter holding Randomize Start Values
Referenced by getRandomizeStartValues(), initializeParameter(), randomizeStartValues(), and setRandomizeStartValues().
|
protected |
A pointer to the value of the CCopasiParameter holding the CN for the subtask
Referenced by elevateChildren(), getSubTask(), initializeParameter(), CFitProblem::initializeParameter(), and setSubtaskType().
|
mutableprotected |
Pointer to the subtask to be used in the optimization
Referenced by calculate(), getSubtaskType(), initialize(), initializeSubtaskBeforeOutput(), restore(), setCallBack(), and ~COptProblem().
|
protected |
Pointer to the source of the subtask to be used in the optimization
Referenced by initialize(), and initializeSubtaskBeforeOutput().
|
protected |
A vector of solution results
Referenced by CFitProblem::calculateCrossValidation(), calculateStatistics(), CFitProblem::calculateStatistics(), getSolutionValue(), initialize(), initObjects(), printResult(), CFitProblem::printResult(), reset(), restore(), CFitProblem::restore(), setCallBack(), setSolution(), and updateContainer().
A vector of solution variables
Referenced by CFitProblem::calculateCrossValidation(), calculateStatistics(), CFitProblem::calculateStatistics(), getSolutionVariables(), initialize(), CFitProblem::initialize(), initObjects(), printResult(), CFitProblem::printResult(), restore(), setSolution(), CFitProblem::setSolution(), and updateContainer().
Referenced by getSolutionVariables(), initialize(), and setSolution().
|
protected |
Indicates whether the results shall be stored. The default is false.
Referenced by calculate(), CFitProblem::calculate(), CFitProblem::calculateCrossValidation(), calculateStatistics(), CFitProblem::calculateStatistics(), and CFitProblem::initialize().
|
protected |
A vector of refresh methods which need to be called retrieve the values of constraints.
Referenced by checkFunctionalConstraints(), and initialize().
|
protected |
A vector of refresh methods which need to be called retrieve the values of constraints.
Referenced by checkIntervals(), and initialize().
|
protected |
A vector of refresh methods which need to be called retrieve the value of the objective function.
Referenced by calculate(), and initialize().
|
protected |
A static value containing Infinity.
Referenced by CFitProblem::calcCov(), CFitProblem::calculate(), CFitProblem::calculateCrossValidation(), calculateStatistics(), CFitProblem::calculateStatistics(), initialize(), CFitProblem::initialize(), restore(), CFitProblem::restore(), and updateContainer().
|
static |
The methods which can be selected for performing this task.
File name: COptProblem.cpp
Programmer: Yongqun He Contact email: yohe@ Purpose: This is the source file of the vt.e duCOptProblem class. It specifies the optimization problem with its own members and functions. It's used by COptAlgorithm class and COptimization class