copasi API  0.1
Classes | Public Member Functions | Static Public Member Functions
CUnitInterfaceSBML Class Reference

#include <CUnitInterfaceSBML.h>

List of all members.

Classes

class  CEnvironmentInformation
class  CExpressionInformation
class  EvaluationResult
class  Statistics

Public Member Functions

 CUnitInterfaceSBML (Model *model, bool unitsFromModel)
 ~CUnitInterfaceSBML ()
void debugOutput () const
void calculateStatistics ()
Model * getModel ()
const Model * getModel () const
void setAssumeDimensionlessOne (bool f)
void determineUnits ()
void writeBackToModel ()
const StatisticsgetStatistics () const
std::vector< std::string > getListOfObjectsWithGivenUnitStatus (int status) const
std::vector< std::pair
< std::string, std::string > > 
getListOfLocalParametersWithGivenUnitStatus (int status) const
std::string getMessageAboutUnknownUnits () const
const std::set< const ASTNode * > & getListOfConflictingNodes () const
const std::vector
< CExpressionInformation > & 
getExpressions () const
CUnitInformationgetMappedUnitFromIdentifier (const std::string &node, const CEnvironmentInformation &ei)
CUnitInformationgetMappedUnitFromNumberNode (const ASTNode *node)

Static Public Member Functions

static void outputStatistics (const Statistics &stat, bool flag)

Detailed Description

This class contains a copy of the unit information of an sbml model in the data structures the unit conversion algorithm can deal with. It contains lists of all objects/numbers that potentially can have units, and a list of all mathematical expressions in the sbml model that impose constraints on the units.


Constructor & Destructor Documentation

CUnitInterfaceSBML::CUnitInterfaceSBML ( Model *  model,
bool  unitsFromModel 
)

initialize the unit interface from an sbml model, extracting all the unit information from the model

CUnitInterfaceSBML::~CUnitInterfaceSBML ( )

Destructor.


Member Function Documentation

void CUnitInterfaceSBML::calculateStatistics ( )
void CUnitInterfaceSBML::debugOutput ( ) const

initialize the unit interface from an sbml model, without using any unit information from the model

void CUnitInterfaceSBML::determineUnits ( )

Tries to determine unknown units by considering the known units and all the contrains imposed by the mathmatical expressions.

const std::vector<CExpressionInformation>& CUnitInterfaceSBML::getExpressions ( ) const [inline]

return the list of all mathematical expressions including additional information

const std::set< const ASTNode * > & CUnitInterfaceSBML::getListOfConflictingNodes ( ) const

after determineUnits() was called this contains a set of terminal ASTNodes in which a conflict was detected. Note that is not necessarily where one would intuitively locate the conflict, i's just where it was detected.

std::vector< std::pair< std::string, std::string > > CUnitInterfaceSBML::getListOfLocalParametersWithGivenUnitStatus ( int  status) const

returns a list of pairs of sbml IDs corresponding to all local parameters that match the given unit status (as explained above)

std::vector< std::string > CUnitInterfaceSBML::getListOfObjectsWithGivenUnitStatus ( int  status) const

returns a list of sbml id corresponding to all global sbml objects that match the given unit status (as explained above)

CUnitInformation * CUnitInterfaceSBML::getMappedUnitFromIdentifier ( const std::string &  node,
const CEnvironmentInformation ei 
)

provided with an identifier from an object node, this method tries to find the mapped unit information. According to the provided environment, this could be a local parameter or a global object.

CUnitInformation * CUnitInterfaceSBML::getMappedUnitFromNumberNode ( const ASTNode *  node)

find the unit information corresponding to a number node

std::string CUnitInterfaceSBML::getMessageAboutUnknownUnits ( ) const

generates a message containing a list of the objects with unknown units. The message should be suitable for presentation in a user interface.

Model* CUnitInterfaceSBML::getModel ( ) [inline]

retrieve the SBML model

const Model* CUnitInterfaceSBML::getModel ( ) const [inline]
const Statistics& CUnitInterfaceSBML::getStatistics ( ) const [inline]

get statistics of the units of the model. In each of the vectors: 0: unknown 1: default 2: model wide provided units 3: provided units 4: derived units 5: conflict

void CUnitInterfaceSBML::outputStatistics ( const Statistics stat,
bool  flag 
) [static]
void CUnitInterfaceSBML::setAssumeDimensionlessOne ( bool  f) [inline]
void CUnitInterfaceSBML::writeBackToModel ( )

Writes the units information back to an sbml model (without any unit conversions). The most common use case for this will be to annotate the model with units of objects that did not have explicit units before, e.g. parameters.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines