COPASI API
4.40.278
|
#include <CODEExporter.h>
Public Types | |
enum | Object { INITIAL = 0 , FIXED , ASSIGNMENT , HEADERS , FUNCTIONS , ODEs } |
Public Member Functions | |
void | assembleSubTreeForMassAction (CEvaluationNode *newNode, CEvaluationNode *child1, CEvaluationNode *child2) |
CODEExporter () | |
virtual bool | exportClosingData (const CModel *copasiModel, std::ostream &os) |
virtual std::string | exportClosingString (const size_t tmp) |
bool | exportCompartments (const CModel *copasiModel) |
std::string | exportExpression (const CExpression *pExpression, const CDataModel *pDataModel) |
virtual bool | exportKineticFunction (const CReaction *reac) |
virtual bool | exportKineticFunctionGroup (const CModel *copasiModel) |
virtual bool | exportMetabolites (const CModel *copasiModel) |
virtual bool | exportMetabolitesConcentrations (const CModel *copasiModel) |
bool | exportModelEntityExpression (const CDataObject *obj, const CDataModel *pDataModel) |
bool | exportModelValues (const CModel *copasiModel) |
bool | exportModelValuesExpressions (const CModel *copasiModel) |
virtual std::string | exportNumber (double number) |
void | exportObjectNodesFromModel (const CDataModel *pDataModel) |
bool | exportODEs (const CModel *copasiModel) |
bool | exportReacParamsAndFuncs (const CModel *copasiModel) |
void | exportSimulatedObject (const CDataObject *obj, const CDataModel *pDataModel) |
virtual bool | exportSingleCompartment (const CCompartment *comp, std::string &expression, std::string &comments) |
bool | exportSingleFunction (CEvaluationNode *pNode, const CReaction *reac, size_t &index) |
bool | exportSingleFunction (CEvaluationNode *pNode, const std::string &key, size_t &index) |
bool | exportSingleFunction (const CFunction *func) |
virtual bool | exportSingleFunction (const CFunction *func, std::set< std::string > &isExported) |
virtual bool | exportSingleMetabolite (const CMetab *metab, std::string &expression, std::string &comments) |
virtual bool | exportSingleModelEntity (const CModelEntity *tmp, std::string &expression, std::string &comments) |
virtual bool | exportSingleModVal (const CModelValue *modval, std::string &expression, std::string &comments) |
virtual bool | exportSingleObject (std::ostringstream &which, const std::string &name, const std::string &expression, const std::string &comments) |
virtual bool | exportSingleODE (const CModelEntity *mentity, std::string &equation, std::string &comments) |
virtual bool | exportSingleParameter (const CCopasiParameter *param, std::string &expression, std::string &comments) |
virtual bool | exportTitleData (const CModel *copasiModel, std::ostream &os) |
virtual std::string | exportTitleString (const size_t tmp) |
bool | exportToStream (const CDataModel *pDataModel, std::ostream &os) |
void | findFunctionsCalls (const CEvaluationNode *pNode) |
virtual std::string | getDisplayExpressionString (CExpression *tmp) |
virtual std::string | getDisplayFunctionString (CFunction *func) |
virtual std::string | getSingleLineComment () |
virtual bool | isEmptyString (std::string &str) |
std::string | isModelEntityExpressionODEExporterCompatible (const CModelEntity *tmp, const CExpression *pExpression, const CDataModel *pDataModel) |
virtual std::string | KineticFunction2ODEmember (const CReaction *reac) |
void | modifyTreeForMassAction (CFunction *tmpfunc) |
virtual bool | preprocess (const CModel *copasiModel) |
virtual std::string | setConcentrationName (const std::string &objName) |
virtual std::string | setODEName (const std::string &objName) |
virtual void | setReservedNames () |
virtual std::string | translateObjectName (const std::string &realName) |
virtual std::string | translateTimeVariableName () |
virtual | ~CODEExporter () |
Public Attributes | |
std::ostringstream | assignment |
std::map< std::string, std::string > | equations |
std::ostringstream | fixed |
std::ostringstream | functions |
std::ostringstream | headers |
std::ostringstream | initial |
std::map< std::string, std::string > | NameMap |
std::ostringstream | ode |
std::string | timeKey |
Protected Attributes | |
std::set< std::string > | mExportedFunctions |
enum CODEExporter::Object |
CODEExporter::CODEExporter | ( | ) |
Constructor for the exporter.
|
virtual |
Destructor for the exporter.
void CODEExporter::assembleSubTreeForMassAction | ( | CEvaluationNode * | newNode, |
CEvaluationNode * | child1, | ||
CEvaluationNode * | child2 | ||
) |
This method assembles an expression sub tree for some internal call of Mass Action. The sub tree has to be included in the tree of corresponding root kinetic function in order to export this function whithout the user defined internall Mass Action calls
References CCopasiNode< _Data >::addChild(), CEvaluationNode::copyBranch(), CEvaluationNode::create(), CEvaluationNode::mainType(), CEvaluationNode::MULTIPLY, CEvaluationNode::OPERATOR, CEvaluationNode::VARIABLE, and CEvaluationNode::VECTOR.
Referenced by modifyTreeForMassAction().
|
virtual |
Reimplemented in CODEExporterXPPAUT.
Referenced by exportToStream().
|
virtual |
Reimplemented in CODEExporterC.
Referenced by exportToStream().
bool CODEExporter::exportCompartments | ( | const CModel * | copasiModel | ) |
References CModelEntity::ASSIGNMENT, exportNumber(), exportSingleCompartment(), CModelEntity::FIXED, CModel::getCompartments(), CModelEntity::getInitialValue(), CDataObject::getObjectName(), CModelEntity::getStatus(), CModelEntity::ODE, CDataVector< CType >::size(), and CModelEntity::StatusName.
Referenced by exportToStream().
std::string CODEExporter::exportExpression | ( | const CExpression * | pExpression, |
const CDataModel * | pDataModel | ||
) |
References C_INVALID_INDEX, CEvaluationNode::CALL, CObjectInterface::DataObject(), equations, exportNumber(), CEvaluationNodeCall::getCalledTree(), getDisplayExpressionString(), CMetab::getInitialConcentration(), CModelEntity::getInitialValue(), CDataObject::getKey(), CFunction::getKey(), CModelEntity::getKey(), CModel::getMetabolitesX(), CDataModel::getModel(), CEvaluationTree::getNodeList(), CModel::getNumIndependentReactionMetabs(), CModel::getNumODEMetabs(), CEvaluationNodeObject::getObjectCN(), CDataObject::getObjectFromCN(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CDataObject::getObjectType(), CTrajectoryProblem::getOutputStartTime(), CCopasiTask::getProblem(), CModel::getQuantity2NumberFactor(), getQuantityParameterOrValue(), getReactionIndex(), CModel::getReactions(), CModel::getRedStoi(), CModelEntity::getStatus(), CDataObject::hasFlag(), CMetab::isDependent(), isEmptyString(), NameMap, CEvaluationNode::OBJECT, CModelEntity::ODE, CModelEntity::REACTIONS, CDataObject::Reference, and timeKey.
Referenced by exportModelEntityExpression().
|
virtual |
Reimplemented in CODEExporterC.
References exportSingleFunction(), exportSingleObject(), functions, CReaction::getChemEq(), getDisplayFunctionString(), CReaction::getFunction(), CDataObject::getKey(), CReaction::getKey(), CModelEntity::getKey(), CCopasiParameter::getKey(), CChemEqElement::getMetaboliteKey(), CChemEqElement::getMultiplicity(), CDataObject::getObjectName(), CReaction::getParameterObjects(), CChemEq::getProducts(), CEvaluationTree::getRoot(), CChemEq::getSubstrates(), CEvaluationTree::getType(), CFunction::getVariableIndex(), CFunction::getVariables(), CReaction::isLocalParameter(), CFunction::isReversible(), CEvaluationTree::MassAction, CFunctionParameter::MODIFIER, modifyTreeForMassAction(), NameMap, NO_PARENT, CFunctionParameter::PARAMETER, CFunctionParameter::PRODUCT, CDataVector< CType >::size(), CFunctionParameter::SUBSTRATE, CFunctionParameter::TIME, timeKey, translateObjectName(), TriTrue, CEvaluationNode::VARIABLE, and CFunctionParameter::VOLUME.
Referenced by exportReacParamsAndFuncs().
|
virtual |
Reimplemented in CODEExporterC.
Referenced by exportToStream().
|
virtual |
References CModelEntity::ASSIGNMENT, C_FLOAT64, exportNumber(), exportSingleMetabolite(), exportSingleObject(), CModelEntity::FIXED, fixed, CMetab::getCompartment(), CMetabNameInterface::getDisplayName(), CMetab::getInitialConcentration(), CModelEntity::getInitialValue(), CDataObject::getKey(), CModel::getL(), CModel::getMetabolitesX(), CModel::getNumIndependentReactionMetabs(), CModel::getNumODEMetabs(), CDataObject::getObjectName(), CModelEntity::getStatus(), CMetab::isDependent(), NameMap, CModelEntity::ODE, CModelEntity::REACTIONS, CDataVector< CType >::size(), and CModelEntity::StatusName.
Referenced by exportToStream().
|
virtual |
bool CODEExporter::exportModelEntityExpression | ( | const CDataObject * | obj, |
const CDataModel * | pDataModel | ||
) |
References CModelEntity::ASSIGNMENT, equations, exportExpression(), exportSingleModelEntity(), exportSingleODE(), findFunctionsCalls(), CModelEntity::FIXED, CMetab::getCompartment(), CModelEntity::getExpressionPtr(), CModelEntity::getKey(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CDataObject::getObjectType(), CEvaluationTree::getRoot(), CModelEntity::getStatus(), CDataObject::hasFlag(), isEmptyString(), isModelEntityExpressionODEExporterCompatible(), NameMap, CModelEntity::ODE, CDataObject::Reference, and CModelEntity::StatusName.
Referenced by exportModelValuesExpressions(), and exportSimulatedObject().
bool CODEExporter::exportModelValues | ( | const CModel * | copasiModel | ) |
References CModelEntity::ASSIGNMENT, exportNumber(), exportSingleModVal(), CModelEntity::FIXED, CModelEntity::getInitialValue(), CModel::getModelValues(), CDataObject::getObjectName(), CModelEntity::getStatus(), CModelEntity::ODE, CDataVector< CType >::size(), and CModelEntity::StatusName.
Referenced by exportToStream().
bool CODEExporter::exportModelValuesExpressions | ( | const CModel * | copasiModel | ) |
References CModelEntity::ASSIGNMENT, exportModelEntityExpression(), findFunctionsCalls(), CModel::getCompartments(), CModelEntity::getExpressionPtr(), CModel::getMetabolites(), CModel::getModelValues(), CModel::getNumMetabs(), CModel::getNumModelValues(), CDataObject::getObjectDataModel(), CEvaluationTree::getRoot(), CModelEntity::getStatus(), and CDataVector< CType >::size().
Referenced by exportToStream().
|
virtual |
Reimplemented in CODEExporterC.
Referenced by exportCompartments(), exportExpression(), exportMetabolites(), and exportModelValues().
void CODEExporter::exportObjectNodesFromModel | ( | const CDataModel * | pDataModel | ) |
bool CODEExporter::exportODEs | ( | const CModel * | copasiModel | ) |
References equations, exportSingleODE(), CModelEntity::getKey(), CModel::getMetabolitesX(), CModel::getNumIndependentReactionMetabs(), CModel::getNumODEMetabs(), CModelEntity::getStatus(), CMetab::isDependent(), CModelEntity::REACTIONS, and CDataVector< CType >::size().
Referenced by exportToStream().
bool CODEExporter::exportReacParamsAndFuncs | ( | const CModel * | copasiModel | ) |
References C_FLOAT64, CReaction::ConcentrationPerTime, equations, exportKineticFunction(), exportSingleParameter(), CReaction::getEffectiveKineticLawUnitType(), CDataObject::getKey(), CModel::getMetabolitesX(), CModel::getNumIndependentReactionMetabs(), CModel::getNumODEMetabs(), CDataObject::getObjectName(), CCopasiParameterGroup::getParameter(), CReaction::getParameters(), CModel::getReactions(), CModel::getRedStoi(), CCopasiParameter::getValue(), isEmptyString(), CReaction::isLocalParameter(), KineticFunction2ODEmember(), NameMap, CDataVector< CType >::size(), and CCopasiParameterGroup::size().
Referenced by exportToStream().
void CODEExporter::exportSimulatedObject | ( | const CDataObject * | obj, |
const CDataModel * | pDataModel | ||
) |
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by exportCompartments().
bool CODEExporter::exportSingleFunction | ( | CEvaluationNode * | pNode, |
const CReaction * | reac, | ||
size_t & | index | ||
) |
References exportSingleFunction(), and CReaction::getKey().
bool CODEExporter::exportSingleFunction | ( | CEvaluationNode * | pNode, |
const std::string & | key, | ||
size_t & | index | ||
) |
References CCopasiNode< _Data >::addChild(), CEvaluationNode::CALL, CEvaluationNode::copyBranch(), exportSingleFunction(), exportSingleObject(), CFunctionDB::findFunction(), functions, getDisplayFunctionString(), CRootContainer::getFunctionList(), CDataObject::getObjectName(), CEvaluationTree::getRoot(), CFunction::getVariableIndex(), modifyTreeForMassAction(), NameMap, NO_PARENT, CCopasiNode< _Data >::removeChild(), translateObjectName(), and CEvaluationNode::VARIABLE.
bool CODEExporter::exportSingleFunction | ( | const CFunction * | func | ) |
References mExportedFunctions.
Referenced by exportKineticFunction(), CODEExporterC::exportKineticFunctionGroup(), exportSingleFunction(), and findFunctionsCalls().
|
virtual |
Reimplemented in CODEExporterC.
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by exportMetabolites().
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by exportModelEntityExpression().
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by exportModelValues().
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by exportKineticFunction(), exportMetabolites(), exportMetabolitesConcentrations(), and exportSingleFunction().
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by exportModelEntityExpression(), and exportODEs().
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by exportReacParamsAndFuncs().
|
virtual |
Reimplemented in CODEExporterC.
Referenced by exportToStream().
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by exportToStream().
bool CODEExporter::exportToStream | ( | const CDataModel * | pDataModel, |
std::ostream & | os | ||
) |
References assignment, ASSIGNMENT, exportClosingData(), exportClosingString(), exportCompartments(), exportKineticFunctionGroup(), exportMetabolites(), exportMetabolitesConcentrations(), exportModelValues(), exportModelValuesExpressions(), exportObjectNodesFromModel(), exportODEs(), exportReacParamsAndFuncs(), exportTitleData(), exportTitleString(), fixed, FIXED, functions, FUNCTIONS, CDataModel::getModel(), headers, HEADERS, initial, INITIAL, mExportedFunctions, ode, ODEs, and preprocess().
Referenced by CDataModel::exportMathModel(), and CDataModel::exportMathModelToString().
void CODEExporter::findFunctionsCalls | ( | const CEvaluationNode * | pNode | ) |
References CEvaluationNode::CALL, exportSingleFunction(), CFunctionDB::findFunction(), CRootContainer::getFunctionList(), CEvaluationTree::getRoot(), CEvaluationTree::getType(), and CEvaluationTree::MassAction.
Referenced by CODEExporterC::exportKineticFunctionGroup(), exportModelEntityExpression(), and exportModelValuesExpressions().
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by exportExpression().
|
virtual |
Reimplemented in CODEExporterXPPAUT, and CODEExporterBM.
Referenced by exportKineticFunction(), and exportSingleFunction().
|
virtual |
Reimplemented in CODEExporterC.
Referenced by isModelEntityExpressionODEExporterCompatible().
|
virtual |
This method tests if a string consists only of whitespace characters
Referenced by exportExpression(), exportModelEntityExpression(), exportReacParamsAndFuncs(), and CODEExporterXPPAUT::exportSingleODE().
std::string CODEExporter::isModelEntityExpressionODEExporterCompatible | ( | const CModelEntity * | tmp, |
const CExpression * | pExpression, | ||
const CDataModel * | pDataModel | ||
) |
References CObjectInterface::DataObject(), CEvaluationTree::getNodeList(), CEvaluationNodeObject::getObjectCN(), CObjectInterface::GetObjectFromCN(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CDataObject::getObjectType(), getSingleLineComment(), CModelEntity::getStatus(), CDataObject::hasFlag(), CMetab::isDependent(), CEvaluationNode::OBJECT, CModelEntity::REACTIONS, and CDataObject::Reference.
Referenced by exportModelEntityExpression().
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by exportReacParamsAndFuncs().
void CODEExporter::modifyTreeForMassAction | ( | CFunction * | tmpfunc | ) |
This method modifies the export tree of the function for internal calls of Mass Action
References CCopasiNode< _Data >::addChild(), assembleSubTreeForMassAction(), CEvaluationNode::CALL, CEvaluationNode::create(), CFunctionDB::findFunction(), CRootContainer::getFunctionList(), CDataObject::getObjectName(), CEvaluationTree::getRoot(), CEvaluationTree::getType(), CEvaluationTree::MassAction, CEvaluationNode::MINUS, CEvaluationNode::MULTIPLY, CEvaluationNode::OPERATOR, and CCopasiNode< _Data >::removeChild().
Referenced by exportKineticFunction(), exportSingleFunction(), and CODEExporterC::exportSingleFunction().
|
virtual |
Reimplemented in CODEExporterC.
References CModel::getCompartments(), CModelEntity::getKey(), CCopasiParameter::getKey(), CModel::getMetabolitesX(), CModel::getModelValues(), CDataObject::getObjectName(), CModel::getReactions(), CModelEntity::getStatus(), CMetab::isDependent(), NameMap, CModelEntity::ODE, CModelEntity::REACTIONS, setConcentrationName(), setODEName(), setReservedNames(), CDataVector< CType >::size(), timeKey, translateObjectName(), and translateTimeVariableName().
Referenced by exportToStream().
|
virtual |
Reimplemented in CODEExporterXPPAUT, and CODEExporterBM.
Referenced by preprocess().
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by preprocess().
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by preprocess().
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by exportKineticFunction(), exportSingleFunction(), and preprocess().
|
virtual |
Reimplemented in CODEExporterXPPAUT, CODEExporterC, and CODEExporterBM.
Referenced by preprocess().
std::ostringstream CODEExporter::assignment |
Referenced by exportMetabolitesConcentrations(), CODEExporterBM::exportSingleCompartment(), CODEExporterC::exportSingleCompartment(), CODEExporterXPPAUT::exportSingleCompartment(), CODEExporterBM::exportSingleMetabolite(), CODEExporterC::exportSingleMetabolite(), CODEExporterXPPAUT::exportSingleMetabolite(), CODEExporterBM::exportSingleModelEntity(), CODEExporterC::exportSingleModelEntity(), CODEExporterXPPAUT::exportSingleModelEntity(), CODEExporterBM::exportSingleModVal(), CODEExporterC::exportSingleModVal(), CODEExporterXPPAUT::exportSingleModVal(), and exportToStream().
std::map< std::string, std::string > CODEExporter::equations |
Referenced by exportExpression(), exportModelEntityExpression(), exportODEs(), and exportReacParamsAndFuncs().
std::ostringstream CODEExporter::fixed |
Referenced by exportMetabolites(), CODEExporterBM::exportSingleCompartment(), CODEExporterC::exportSingleCompartment(), CODEExporterXPPAUT::exportSingleCompartment(), CODEExporterBM::exportSingleMetabolite(), CODEExporterC::exportSingleMetabolite(), CODEExporterXPPAUT::exportSingleMetabolite(), CODEExporterBM::exportSingleModelEntity(), CODEExporterC::exportSingleModelEntity(), CODEExporterXPPAUT::exportSingleModelEntity(), CODEExporterBM::exportSingleModVal(), CODEExporterC::exportSingleModVal(), CODEExporterXPPAUT::exportSingleModVal(), CODEExporterBM::exportSingleParameter(), CODEExporterC::exportSingleParameter(), CODEExporterXPPAUT::exportSingleParameter(), and exportToStream().
std::ostringstream CODEExporter::functions |
Referenced by exportKineticFunction(), exportSingleFunction(), CODEExporterC::exportSingleFunction(), and exportToStream().
std::ostringstream CODEExporter::headers |
Referenced by CODEExporterC::exportSingleFunction(), and exportToStream().
std::ostringstream CODEExporter::initial |
Referenced by CODEExporterBM::exportSingleCompartment(), CODEExporterC::exportSingleCompartment(), CODEExporterXPPAUT::exportSingleCompartment(), CODEExporterBM::exportSingleMetabolite(), CODEExporterC::exportSingleMetabolite(), CODEExporterXPPAUT::exportSingleMetabolite(), CODEExporterBM::exportSingleModelEntity(), CODEExporterC::exportSingleModelEntity(), CODEExporterXPPAUT::exportSingleModelEntity(), CODEExporterBM::exportSingleModVal(), CODEExporterC::exportSingleModVal(), CODEExporterXPPAUT::exportSingleModVal(), and exportToStream().
|
protected |
Referenced by exportSingleFunction(), and exportToStream().
std::map< std::string, std::string > CODEExporter::NameMap |
Referenced by exportExpression(), exportKineticFunction(), exportMetabolites(), exportMetabolitesConcentrations(), exportModelEntityExpression(), exportReacParamsAndFuncs(), CODEExporterBM::exportSingleCompartment(), CODEExporterC::exportSingleCompartment(), CODEExporterXPPAUT::exportSingleCompartment(), exportSingleFunction(), CODEExporterC::exportSingleFunction(), CODEExporterBM::exportSingleMetabolite(), CODEExporterC::exportSingleMetabolite(), CODEExporterXPPAUT::exportSingleMetabolite(), CODEExporterBM::exportSingleModelEntity(), CODEExporterC::exportSingleModelEntity(), CODEExporterXPPAUT::exportSingleModelEntity(), CODEExporterBM::exportSingleModVal(), CODEExporterC::exportSingleModVal(), CODEExporterXPPAUT::exportSingleModVal(), CODEExporterBM::exportSingleODE(), CODEExporterC::exportSingleODE(), CODEExporterXPPAUT::exportSingleODE(), CODEExporterBM::exportSingleParameter(), CODEExporterC::exportSingleParameter(), CODEExporterXPPAUT::exportSingleParameter(), CODEExporterC::exportTitleData(), CODEExporterBM::KineticFunction2ODEmember(), CODEExporterC::KineticFunction2ODEmember(), CODEExporterXPPAUT::KineticFunction2ODEmember(), preprocess(), CODEExporterC::preprocess(), and CODEExporterC::setExportNameOfFunction().
std::ostringstream CODEExporter::ode |
std::string CODEExporter::timeKey |
Referenced by exportExpression(), exportKineticFunction(), preprocess(), and CODEExporterC::preprocess().