/home/msneddon/eclipse/galileoSR1_cpp/workspace/NFsim/src/NFreactions/reactions/reaction.hh

Go to the documentation of this file.
00001 #ifndef BASICREACTIONS_HH_
00002 #define BASICREACTIONS_HH_
00003 
00004 
00005 #include "../NFreactions.hh"
00006 
00007 
00008 
00009 
00010 using namespace std;
00011 
00012 namespace NFcore
00013 {
00014 
00015         class BasicRxnClass : public ReactionClass {
00016                 public:
00017                         BasicRxnClass(string name, double baseRate, string baseRateName, TransformationSet *transformationSet, System *s);
00018                         virtual ~BasicRxnClass();
00019 
00020                         virtual void init();
00021                         virtual void prepareForSimulation();
00022                         virtual bool tryToAdd(Molecule *m, unsigned int reactantPos);
00023                         virtual void remove(Molecule *m, unsigned int reactantPos);
00024                         virtual double update_a() {
00025 
00026                                 // Use the total rate law convention (macroscopic rate)
00027                                 if(this->totalRateFlag) {
00028                                         a=baseRate;
00029                                         for(unsigned int i=0; i<n_reactants; i++)
00030                                                 if(reactantLists[i]->size()==0) a=0;
00031 
00032                                 // Use the standard microscopic rate
00033                                 } else {
00034                                         a = 1;
00035                                         for(unsigned int i=0; i<n_reactants; i++)
00036                                                 a*=reactantLists[i]->size();
00037                                         a*=baseRate;
00038                                 }
00039                                 return a;
00040                         }
00041 
00042 
00043 
00044                         virtual void notifyRateFactorChange(Molecule * m, int reactantIndex, int rxnListIndex);
00045                         virtual unsigned int getReactantCount(unsigned int reactantIndex) const;
00046 
00047                         virtual void printFullDetails() const;
00048 
00049                 protected:
00050                         virtual void pickMappingSets(double randNumber) const;
00051 
00052                         ReactantList **reactantLists;
00053 
00054                         ReactantList *rl;
00055                         MappingSet *ms;
00056         };
00057 
00058 
00059 
00060 
00061 
00062         class FunctionalRxnClass : public BasicRxnClass {
00063 
00064                 public:
00065                         FunctionalRxnClass(string name, GlobalFunction *gf, TransformationSet *transformationSet, System *s);
00066                         FunctionalRxnClass(string name, CompositeFunction *cf, TransformationSet *transformationSet, System *s);
00067 
00068                         virtual ~FunctionalRxnClass();
00069 
00070                         virtual double update_a();
00071                         virtual void printDetails() const;
00072 
00073                 protected:
00074                         GlobalFunction *gf;
00075                         CompositeFunction *cf;
00076         };
00077 
00078         class MMRxnClass : public BasicRxnClass {
00079 
00080                 public:
00081                         MMRxnClass(string name, double kcat, double Km, TransformationSet *transformationSet, System *s);
00082                         virtual ~MMRxnClass();
00083 
00084                         virtual double update_a();
00085                         virtual void printDetails() const;
00086 
00087                 protected:
00088                         double Km;
00089                         double kcat;
00090                         double sFree;
00091         };
00092 
00093 
00094 
00095 
00096         class DORRxnClass : public ReactionClass {
00097                 public:
00098                         DORRxnClass(
00099                                         string name,
00100                                         double baseRate,
00101                                         string baseRateName,
00102                                         TransformationSet *transformationSet,
00103                                         CompositeFunction *function,
00104                                         vector <string> &lfArgumentPointerNameList,
00105                                         System *s);
00106                         virtual ~DORRxnClass();
00107 
00108                         virtual void init();
00109                         virtual void prepareForSimulation() {};
00110                         virtual bool tryToAdd(Molecule *m, unsigned int reactantPos);
00111                         virtual void remove(Molecule *m, unsigned int reactantPos);
00112                         virtual double update_a();
00113 
00114 
00115                         virtual int getDORreactantPosition() const { return DORreactantIndex; };
00116 
00117 
00118 
00119                         virtual void notifyRateFactorChange(Molecule * m, int reactantIndex, int rxnListIndex);
00120                         virtual unsigned int getReactantCount(unsigned int reactantIndex) const;
00121 
00122                         virtual void printDetails() const;
00123                         virtual void printFullDetails() const {};
00124 
00125 
00126                         void directAddForDebugging(Molecule *m);
00127                         void printTreeForDebugging();
00128 
00129                         static void test1(System *s);
00130 
00131                 protected:
00132 
00133                         virtual double evaluateLocalFunctions(MappingSet *ms);
00134 
00135                         virtual void pickMappingSets(double randNumber) const;
00136 
00137                         ReactantList **reactantLists;
00138                         ReactantTree *reactantTree;
00139 
00140                         MappingSet *ms;
00141 
00142 
00143                         CompositeFunction *cf;
00144 
00145                         //Parameters to keep track of local functions
00146                         int DORreactantIndex;
00147 
00148                         int n_argMolecules;
00149                         int * argIndexIntoMappingSet;
00150                         Molecule ** argMappedMolecule;
00151                         int * argScope;
00152 
00153 
00154                         //vector <int> argIndexIntoMappingSet;
00155 
00156 
00157 
00158                         //vector <LocalFunction *> lfList;
00159                         //vector <int> indexIntoMappingSet;
00160                         //vector <double> localFunctionValue;
00161 
00162         };
00163 
00164 
00165 
00166 
00167 
00168 }
00169 
00170 
00171 
00172 
00173 
00174 
00175 
00176 #endif /*BASICREACTIONS_HH_*/

Generated on Thu Dec 9 11:02:48 2010 for NFsim by  doxygen 1.5.4