COPASI API  4.40.278
CModelExpansion Class Reference

#include <CModelExpansion.h>

Classes

class  ElementsMap
 
class  SetOfModelElements
 

Public Member Functions

 CModelExpansion (CModel *pModel)
 
std::set< const CDataObject * > copyCompleteModel (const CModel *pSourceModel)
 
void createDiffusionReaction (const std::string &name, const CDataObject *pSubstrate, const CDataObject *pProduct, const CDataObject *pParameter)
 
void createLinearArray (const SetOfModelElements &source, size_t n, const std::set< const CDataObject * > &setOfMetabolites)
 
void createRectangularArray (const SetOfModelElements &source, size_t nx, size_t ny, const std::set< const CDataObject * > &setOfMetabolites)
 
CUndoData duplicate (const SetOfModelElements &source, const std::string &index, ElementsMap &emap)
 
void duplicateCompartment (const CCompartment *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap, CUndoData &undoData)
 
void duplicateEvent (CEvent *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap, CUndoData &undoData)
 
void duplicateGlobalQuantity (const CModelValue *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap, CUndoData &undoData)
 
void duplicateMetab (const CMetab *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap, CUndoData &undoData)
 
void duplicateReaction (const CReaction *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap, CUndoData &undoData)
 
bool existDependentEntities (const CDataObject *pObj)
 
bool expressionContainsObject (const CExpression *exp, const SetOfModelElements &sourceSet)
 
void replaceInCompartment (CCompartment *pX, const ElementsMap &emap)
 
void replaceInEvent (CEvent *pX, const ElementsMap &emap)
 
void replaceInExpression (CExpression *exp, const ElementsMap &emap)
 
void replaceInMetab (CMetab *pX, const ElementsMap &emap)
 
void replaceInModel (const ElementsMap &emap, bool remove)
 
void replaceInModelEntity (CModelEntity *pX, const ElementsMap &emap)
 
void replaceInReaction (CReaction *pX, const ElementsMap &emap)
 
void setModel (CModel *pModel)
 
void simpleCall (const CCompartment *source, std::vector< const CDataObject * > listOfMetabolites, int mult, bool diff)
 
void updateExpression (CExpression *exp, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap, CUndoData &undoData)
 

Protected Attributes

CModelmpModel
 
const CModelmpSourceModel
 

Constructor & Destructor Documentation

◆ CModelExpansion()

CModelExpansion::CModelExpansion ( CModel pModel)

Member Function Documentation

◆ copyCompleteModel()

std::set< const CDataObject * > CModelExpansion::copyCompleteModel ( const CModel pSourceModel)

adds the contents of the source model to the current model. A list of created model elements is returned

References CModelExpansion::ElementsMap::add(), CModel::compileIfNecessary(), duplicate(), CModelExpansion::SetOfModelElements::fillComplete(), CModelExpansion::ElementsMap::getMap(), mpModel, and mpSourceModel.

Referenced by CDataModel::addModel().

◆ createDiffusionReaction()

void CModelExpansion::createDiffusionReaction ( const std::string &  name,
const CDataObject pSubstrate,
const CDataObject pProduct,
const CDataObject pParameter 
)

Create a first order reversible mass action reaction. This is intended for diffusion between copies of model parts. The method takes a reaction name, and keys of two metabolites and a global quantity that is used as a rate constant.

References CReaction::addProduct(), CReaction::addSubstrate(), CModel::createReaction(), CDataObject::getKey(), mpModel, CReaction::setFunction(), CReaction::setParameterObjects(), and CReaction::setReversible().

Referenced by createLinearArray(), createRectangularArray(), and simpleCall().

◆ createLinearArray()

void CModelExpansion::createLinearArray ( const SetOfModelElements source,
size_t  n,
const std::set< const CDataObject * > &  setOfMetabolites 
)

creates n copies of the objects in souce. Diffusion reactions are created for each of the metabs in listOfMetabolites, so that a linear chain is formed.

References CModel::compileIfNecessary(), createDiffusionReaction(), CModel::createModelValue(), duplicate(), CMetab::getCompartment(), CDataObject::getObjectName(), and mpModel.

◆ createRectangularArray()

void CModelExpansion::createRectangularArray ( const SetOfModelElements source,
size_t  nx,
size_t  ny,
const std::set< const CDataObject * > &  setOfMetabolites 
)

creates nx*ny copies of the objects in souce. Diffusion reactions are created for each of the metabs in listOfMetabolites, so that a rectangular array is formed.

References CModel::compileIfNecessary(), createDiffusionReaction(), CModel::createModelValue(), duplicate(), CMetab::getCompartment(), CDataObject::getObjectName(), and mpModel.

◆ duplicate()

◆ duplicateCompartment()

◆ duplicateEvent()

void CModelExpansion::duplicateEvent ( CEvent source,
const std::string &  index,
const SetOfModelElements sourceSet,
ElementsMap emap,
CUndoData undoData 
)

References CModelExpansion::ElementsMap::add(), CDataVectorN< CType >::add(), CUndoData::addPostProcessData(), CUndoData::CHANGE, CExpression::compile(), CModelExpansion::SetOfModelElements::contains(), CModel::createEvent(), CEvent::createUndoData(), CObjectInterface::DataObject(), CUndoData::empty(), CModelExpansion::ElementsMap::exists(), expressionContainsObject(), CEvent::getAssignments(), CDataObject::getCN(), CEvent::getDelayAssignment(), CEvent::getDelayExpression(), CEvent::getDelayExpressionPtr(), CModelExpansion::ElementsMap::getDuplicateFromObject(), CEventAssignment::getExpression(), CEventAssignment::getExpressionPtr(), CEvent::getFireAtInitialTime(), CDataObject::getKey(), CEvent::getKey(), CModelEntity::getKey(), CAnnotation::getMiriamAnnotation(), CAnnotation::getNotes(), CDataContainer::getObject(), CDataObject::getObjectAncestor(), CDataObject::getObjectDataModel(), CDataObject::getObjectName(), CEvent::getPersistentTrigger(), CEvent::getPriorityExpression(), CEvent::getPriorityExpressionPtr(), CEventAssignment::getTargetCN(), CEvent::getTriggerExpression(), CEvent::getTriggerExpressionPtr(), CUndoData::INSERT, mpModel, CEvent::setDelayAssignment(), CEvent::setDelayExpression(), CEventAssignment::setExpression(), CEvent::setFireAtInitialTime(), CAnnotation::setMiriamAnnotation(), CAnnotation::setNotes(), CEvent::setPersistentTrigger(), CEvent::setPriorityExpression(), CEvent::setTriggerExpression(), CEvent::toData(), and updateExpression().

Referenced by duplicate().

◆ duplicateGlobalQuantity()

◆ duplicateMetab()

◆ duplicateReaction()

void CModelExpansion::duplicateReaction ( const CReaction source,
const std::string &  index,
const SetOfModelElements sourceSet,
ElementsMap emap,
CUndoData undoData 
)

References CModelExpansion::ElementsMap::add(), CReaction::addModifier(), CUndoData::addPostProcessData(), CReaction::addProduct(), CReaction::addSubstrate(), CModelExpansion::SetOfModelElements::contains(), CModel::createReaction(), duplicateCompartment(), duplicateGlobalQuantity(), duplicateMetab(), CUndoData::empty(), CModelExpansion::ElementsMap::exists(), CReaction::getChemEq(), CModelExpansion::ElementsMap::getDuplicateFromObject(), CReaction::getFunction(), CReaction::getFunctionParameters(), CReaction::getKey(), CModelEntity::getKey(), CReaction::getKineticLawUnitType(), CChemEqElement::getMetabolite(), CAnnotation::getMiriamAnnotation(), CChemEq::getModifiers(), CChemEqElement::getMultiplicity(), CReaction::getNoiseExpression(), CReaction::getNoiseExpressionPtr(), CAnnotation::getNotes(), CDataObject::getObjectName(), CCopasiParameterGroup::getParameter(), CReaction::getParameterObjects(), CReaction::getParameters(), CReaction::getParameterValue(), CChemEq::getProducts(), CReaction::getScalingCompartment(), CChemEq::getSubstrates(), CReaction::hasNoise(), CUndoData::INSERT, CReaction::isFast(), CReaction::isLocalParameter(), CReaction::isReversible(), CFunctionParameter::MODIFIER, mpModel, CFunctionParameter::PARAMETER, CFunctionParameter::PRODUCT, CReaction::setFast(), CReaction::setFunction(), CReaction::setHasNoise(), CReaction::setKineticLawUnitType(), CAnnotation::setMiriamAnnotation(), CReaction::setNoiseExpression(), CAnnotation::setNotes(), CReaction::setParameterObjects(), CReaction::setParameterValue(), CReaction::setReversible(), CReaction::setScalingCompartment(), CDataVector< CType >::size(), CFunctionParameters::size(), CFunctionParameter::SUBSTRATE, CFunctionParameter::TIME, updateExpression(), and CFunctionParameter::VOLUME.

Referenced by duplicate(), and updateExpression().

◆ existDependentEntities()

◆ expressionContainsObject()

bool CModelExpansion::expressionContainsObject ( const CExpression exp,
const SetOfModelElements sourceSet 
)

Check if a given expression contains any of the objects in the sourceSet

References CModelExpansion::SetOfModelElements::contains(), CEvaluationTree::getNodeList(), CEvaluationNodeObject::getObjectInterfacePtr(), and CDataObject::getObjectParent().

Referenced by duplicateEvent().

◆ replaceInCompartment()

void CModelExpansion::replaceInCompartment ( CCompartment pX,
const ElementsMap emap 
)

References replaceInModelEntity().

Referenced by replaceInModel().

◆ replaceInEvent()

◆ replaceInExpression()

◆ replaceInMetab()

◆ replaceInModel()

◆ replaceInModelEntity()

◆ replaceInReaction()

◆ setModel()

void CModelExpansion::setModel ( CModel pModel)

◆ simpleCall()

◆ updateExpression()

Member Data Documentation

◆ mpModel

◆ mpSourceModel

const CModel* CModelExpansion::mpSourceModel
protected

The documentation for this class was generated from the following files: