00001 // AlgebraicChemical.h: interface for the CAlgebraicChemical class. 00002 // These chemicals are not dynamical variables, they are 00003 // bookkeeping chemicals (algebraic functions of other chemicals 00004 // in the network). Hence the Set functions for amount and 00005 // such are basically just dummies; they call the ComputeAmount() 00006 // function which is overloaded in derived classes with the correct 00007 // algebraic expression. Set has the same format so that 00008 // compatibility is maintained with the base class. This class 00009 // can also accommodate "chemicals" which are a function of rate 00010 // constants and other chemicals. 00012 00013 #if !defined(AFX_ALGEBRAICCHEMICAL_H__1E46E4E9_5F3B_4123_8B9C_131B88820DE3__INCLUDED_) 00014 #define AFX_ALGEBRAICCHEMICAL_H__1E46E4E9_5F3B_4123_8B9C_131B88820DE3__INCLUDED_ 00015 00016 #if _MSC_VER > 1000 00017 #pragma once 00018 #endif // _MSC_VER > 1000 00019 00020 #include "Chemical.h" 00021 00022 00023 class CAlgebraicChemical : public Chemical 00024 { 00025 public: 00026 CAlgebraicChemical(int chemicalNumber, std::string name, std::vector<Chemical *> chemRefVector); 00027 CAlgebraicChemical(int chemicalNumber, std::string name, std::vector<Chemical *> chemRefVector, std::vector<RateConstant *> rateRefVector); 00028 virtual ~CAlgebraicChemical(); 00029 virtual void SetAmount(double amount); 00030 virtual void SetInitialAmount(double initialAmount); 00031 virtual void SetErrorInInitialAmount(double errorInInitialAmount); 00032 virtual void IncrementAmount(double change); 00033 virtual void Reset(); 00034 void SetAll(); 00035 protected: 00036 // must be overloaded in derived classes - depend on the arithmetic expression 00037 virtual void ComputeAmount() = 0; 00038 virtual void ComputeInitialAmount() = 0; 00039 virtual void ComputeErrorInInitialAmount() = 0; 00040 // chemicals which the AlgebraicChemical uses to compute its own 00041 // amount 00042 std::vector<Chemical *> m_vpChemRefVector; 00043 // ditto for rates 00044 std::vector<RateConstant *> m_vpRateRefVector; 00045 }; 00046 00047 #endif // !defined(AFX_ALGEBRAICCHEMICAL_H__1E46E4E9_5F3B_4123_8B9C_131B88820DE3__INCLUDED_)