00001
00004 #ifndef NFCORE_HH_
00005 #define NFCORE_HH_
00006
00007
00008 #include <iostream>
00009 #include <fstream>
00010 #include <string>
00011
00012
00013 #include <vector>
00014 #include <list>
00015 #include <queue>
00016 #include <map>
00017
00018
00019 #include "../NFscheduler/NFstream.h"
00020 #include "../NFutil/NFutil.hh"
00021 #include "../NFreactions/NFreactions.hh"
00022 #include "moleculeLists/moleculeList.hh"
00023 #include "../NFfunction/NFfunction.hh"
00024 #include "../NFoutput/NFoutput.hh"
00025 #include "reactionSelector/reactionSelector.hh"
00026
00027
00028 #include "templateMolecule.hh"
00029 #include "observable.hh"
00030
00031 #define DEBUG 0 // Set to 1 to display all debug messages
00032 #define BASIC_MESSAGE 0 // Set to 1 to display basic messages (eg runtime)
00033
00034
00035 using namespace std;
00036
00038
00048 namespace NFcore
00049 {
00050
00051
00052 class MapGenerator;
00053 class MappingSet;
00054 class ReactantList;
00055 class TransformationSet;
00056 class MoleculeList;
00057
00058 class GlobalFunction;
00059 class CompositeFunction;
00060
00061 class LocalFunction;
00062
00063 class Outputter;
00064 class DumpMoleculeType;
00065 class DumpSystem;
00066
00067 class TemplateMolecule;
00068 class Observable;
00069 class MoleculesObservable;
00070 class SpeciesObservable;
00071
00072
00073
00074
00075
00076
00077
00078 class System;
00079
00080
00081 class MoleculeType;
00082 class Molecule;
00083
00084
00085
00086 class ReactionClass;
00087
00088 class Observable;
00089
00090 class Complex;
00091
00092
00093 class ComplexList;
00094
00095 class ReactantList;
00096
00097 class ReactionSelector;
00098
00099
00100
00102
00105 class ComplexList
00106 {
00107 public:
00108
00109 ComplexList();
00110 ~ComplexList();
00111
00112
00113 bool isUsingComplex ( ) const { return useComplex; }
00114 void setUseComplex ( bool _useComplex ) { useComplex = _useComplex; }
00115 void setSystem ( System * _sys ) { sys = _sys; }
00116
00117
00118 int createComplex(Molecule * m);
00119 Complex * getComplex(int ID_complex) const { return allComplexes.at(ID_complex); };
00120 Complex * getNextAvailableComplex();
00121 void notifyThatComplexIsAvailable(int ID_complex);
00122
00123
00124 void printAllComplexes();
00125 void purgeAndPrintAvailableComplexList();
00126 void outputComplexSizes(double cSampleTime);
00127 void outputMoleculeTypeCountPerComplex(MoleculeType *m);
00128 double outputMeanCount(MoleculeType *m);
00129 double calculateMeanCount(MoleculeType *m);
00130
00131
00132
00133 void resetComplexIter() { complexIter_public = allComplexes.begin(); };
00134
00135
00136 Complex * nextComplex() { return (complexIter_public < allComplexes.end() ? *complexIter_public++ : 0); };
00137
00138
00139 protected:
00140 vector <Complex * > allComplexes;
00141 queue <int> nextAvailableComplex;
00143 System * sys;
00144 bool useComplex;
00145
00146 private:
00147 vector <Complex *>::iterator complexIter;
00148 vector <Complex *>::iterator complexIter_public;
00149 };
00150
00151
00152
00154
00166 class System
00167 {
00168
00169
00170
00171
00172 friend class Netgen;
00173
00174 public:
00175
00180 System(string name);
00181
00186 System(string name, bool useComplex);
00187
00192 System(string name, bool useComplex, int globalMoleculeLimit);
00193
00197 ~System();
00198
00199
00200 string getName() const { return name; };
00201 bool isUsingComplex() { return useComplex; };
00202 bool isOutputtingBinary() { return useBinaryOutput; };
00203 double getCurrentTime() const { return current_time; };
00204 int getGlobalMoleculeLimit() const { return globalMoleculeLimit; };
00205
00206 int getMolObsCount(int moleculeTypeIndex, int observableIndex) const;
00207 Observable * getObservableByName(string obsName);
00208 double getAverageGroupValue(string groupName, int valIndex);
00209
00210 ReactionClass *getReaction(int rIndex) { return allReactions.at(rIndex); };
00211
00212 MoleculeType * getMoleculeType(int mtIndex) { return allMoleculeTypes.at(mtIndex); };
00213 MoleculeType * getMoleculeTypeByName(string name);
00214 int getNumOfMoleculeTypes() { return allMoleculeTypes.size(); };
00215 Molecule * getMoleculeByUid(int uid);
00216 int getNumOfMolecules();
00217
00218
00219
00220
00221
00222 int addMoleculeType(MoleculeType *moleculeType);
00223 void addReaction(ReactionClass *reaction);
00224 void addNecessaryUpdateReaction(ReactionClass *reaction);
00225
00226
00227
00228 bool addGlobalFunction(GlobalFunction *gf);
00229 GlobalFunction * getGlobalFunctionByName(string fName);
00230 bool addCompositeFunction(CompositeFunction *cf);
00231 CompositeFunction * getCompositeFunctionByName(string fName);
00232 void finalizeCompositeFunctions();
00233
00234 void printAllFunctions();
00235
00236
00237 LocalFunction * getLocalFunctionByName(string fName);
00238
00239
00240
00241 void prepareForSimulation();
00242
00243
00244 void setUniversalTraversalLimit(int utl);
00245
00246
00247
00248
00249 void setOutputToBinary();
00250 void registerOutputFileLocation(string filename);
00251
00252
00253 void setDumpOutputter(DumpSystem *ds);
00254 void tryToDump();
00255
00256 void turnOnGlobalFuncOut() { this->outputGlobalFunctionValues=true; };
00257 void turnOffGlobalFuncOut() { this->outputGlobalFunctionValues=false; };
00258
00259
00260 void tagReaction(int rID);
00261
00262
00263
00264 void addLocalFunction(LocalFunction *lf);
00265 void getLocalFunction(string funcName) const { cout<<"getLocalFunction not yet implemented."<<endl;exit(1);};
00266
00267
00268
00269 void outputAllObservableNames();
00270 void outputAllObservableCounts();
00271 void outputAllObservableCounts(double cSampleTime);
00272 void outputAllObservableCounts(double cSampleTime,int eventCounter);
00273 int getNumOfSpeciesObs() const;
00274 Observable * getSpeciesObs(int index) const;
00275
00276
00277
00278
00279 void printAllReactions();
00280 void printIndexAndNames();
00281 void printAllMoleculeTypes();
00282
00283 void printAllObservableCounts();
00284 void printAllObservableCounts(double cSampleTime);
00285 void printAllObservableCounts(double cSampleTime,int eventCounter);
00286
00287
00288
00289
00290
00291
00292
00293
00294 void update_A_tot(ReactionClass *r, double old_a, double new_a);
00295
00296
00297
00298
00299 void evaluateAllLocalFunctions();
00300
00301
00302 void addObservableForOutput(Observable *o);
00303
00304 void addOutputter(Outputter *op);
00305 void dumpOutputters();
00306
00307
00308
00309
00310
00311
00312
00313
00314 double sim(double time, long int sampleTimes);
00315
00316
00317
00318
00319 double sim(double time, long int sampleTimes, bool verbose);
00320
00321
00322
00323
00324 double stepTo(double stoppingTime);
00325
00326 void singleStep();
00327
00328
00329
00330 void equilibrate(double duration);
00331 void equilibrate(double duration, int statusReports);
00332
00333
00334
00335
00336 void registerRxnIndex(int rxnId, int rxnPos, int rxnIndex) {rxnIndexMap[rxnId][rxnPos]=rxnIndex;};
00337 int getRxnIndex(int rxnId, int rxnPos) const { return rxnIndexMap[rxnId][rxnPos]; };
00338
00339 void turnOff_OnTheFlyObs();
00340 void turnOnOutputEventCounter() { outputEventCounter=true; };
00341
00342 void addParameter(string name,double value);
00343 double getParameter(string name);
00344 void setParameter(string name, double value);
00345 void updateSystemWithNewParameters();
00346 void printAllParameters();
00347
00348 NFstream& getOutputFileStream();
00349
00350
00351 ComplexList & getAllComplexes( ) { return allComplexes; };
00352
00356 static int NULL_EVENT_COUNTER;
00357
00362 void turnOnCSVformat() { this->csvFormat = true; };
00363
00364 protected:
00365
00367
00368
00369 string name;
00370
00371 bool useComplex;
00372 bool useBinaryOutput;
00373 int universalTraversalLimit;
00374 bool onTheFlyObservables;
00375 bool outputGlobalFunctionValues;
00376 int globalMoleculeLimit;
00377 bool outputEventCounter;
00378
00379 int globalEventCounter;
00380
00382
00383 vector <MoleculeType *> allMoleculeTypes;
00384 vector <ReactionClass *> allReactions;
00385
00386
00387
00388 vector <Outputter *> allOutputters;
00390 ComplexList allComplexes;
00392 vector <Observable *> obsToOutput;
00393 vector <Observable *> speciesObservables;
00394
00395 DumpSystem *ds;
00396
00397
00399
00400
00401 vector <GlobalFunction *> globalFunctions;
00402 vector <LocalFunction *> localFunctions;
00403 vector <ReactionClass *> necessaryUpdateRxns;
00405 vector <CompositeFunction *> compositeFunctions;
00406
00407
00409
00410 double a_tot;
00411 double current_time;
00412 ReactionClass * nextReaction;
00413
00415
00416 double get_A_tot() const { return a_tot; };
00417 double recompute_A_tot();
00418 double getNextRxn();
00419
00420
00422
00423
00424 NFstream outputFileStream;
00425 void outputGroupDataHeader();
00426
00427
00428 void outputAllPropensities(double time, int rxnFired);
00429 ofstream propensityDumpStream;
00430
00431 bool csvFormat;
00432
00433
00435
00436 int **rxnIndexMap;
00440 map <string,double> paramMap;
00441
00442
00443
00444
00445 ReactionSelector * selector;
00446
00447
00448 private:
00449 list <Molecule *> molList;
00450 list <Molecule *>::iterator molListIter;
00451
00453
00454
00455 vector<Observable *>::iterator obsIter;
00456 vector<MoleculeType *>::iterator molTypeIter;
00457 vector <ReactionClass *>::iterator rxnIter;
00458
00459
00460 vector <GlobalFunction *>::iterator functionIter;
00461 };
00462
00463
00464
00466
00477 class MoleculeType
00478 {
00479 public:
00480
00481 MoleculeType(
00482 string name,
00483 vector <string> &compName,
00484 System *s);
00485
00486 MoleculeType(
00487 string name,
00488 vector <string> &compName,
00489 vector <string> &defaultCompState,
00490 System *s);
00491
00492 MoleculeType(
00493 string name,
00494 vector <string> &compName,
00495 vector <string> &defaultCompState,
00496 vector < vector<string> > &possibleCompStates,
00497 System *system);
00498
00499 MoleculeType(
00500 string name,
00501 vector <string> &compName,
00502 vector <string> &defaultCompState,
00503 vector < vector<string> > &possibleCompStates,
00504 vector <bool> isIntegerComponent,
00505 System *system);
00506
00507
00508 ~MoleculeType();
00509
00510 string getName() const { return name; };
00511 int getTypeID() const { return type_id; };
00512 System * getSystem() const { return system; };
00513
00514
00515 int getNumOfComponents() const { return numOfComponents; };
00516 string getComponentName(int cIndex) const;
00517 void getPossibleComponentStates(int cIndex, list <string> &nameList);
00518 int getDefaultComponentState(int cIndex) const { return defaultCompState[cIndex]; };
00519
00520 int getCompIndexFromName(string cName) const;
00521 string getComponentStateName(int cIndex, int cValue);
00522 int getStateValueFromName(int cIndex, string stateName) const;
00523
00524
00525
00526 int getNumOfEquivalencyClasses() const { return this->n_eqComp; };
00527 string *getEquivalencyClassCompNames() const { return this->eqCompOriginalName; };
00528 void addEquivalentComponents(vector <vector <string> > &identicalComponents);
00529 bool isEquivalentComponent(string cName) const;
00530 bool isEquivalentComponent(int cIndex) const;
00531 void getEquivalencyClass(int *&components, int &n_components, string cName) const;
00532 int getEquivalencyClassNumber(string cName) const;
00533
00534
00535 bool isIntegerComponent(string cName) const;
00536 bool isIntegerComponent(int cIndex) const;
00537
00538
00539 int getNumOfMolObs() const { return (int)molObs.size(); };
00540 string getMolObsName(int obsIndex) const;
00541 MoleculesObservable * getMolObs(int obsIndex) const { return molObs.at(obsIndex); };
00542 int getMolObsCount(int obsIndex) const;
00543 void removeFromObservables(Molecule * m);
00544 void addToObservables(Molecule * m);
00545 void outputMolObsNames(NFstream &fout);
00546 void outputMolObsCounts(NFstream &fout);
00547 void printMolObsNames();
00548 void printMolObsCounts();
00549
00550
00551
00552 void addAllToObservables();
00553
00554
00555
00556
00557 Molecule * getMolecule(int ID_molecule) const;
00558 int getMoleculeCount() const;
00559
00560 int getReactionCount() const { return reactions.size(); };
00561 int getRxnIndex(ReactionClass * rxn, int rxnPosition);
00562
00563
00564
00565
00566
00567 Molecule *genDefaultMolecule();
00568
00569 void addMoleculeToRunningSystem(Molecule *&mol);
00570 void removeMoleculeFromRunningSystem(Molecule *&m);
00571 void removeFromRxns(Molecule * m);
00572
00573
00574
00575
00576 void addReactionClass(ReactionClass * r, int rPosition);
00577 void addMolObs(MoleculesObservable * mo) { molObs.push_back(mo); };
00578
00579
00580 int createComplex(Molecule *m) { return (system->getAllComplexes()).createComplex(m); };
00581 void addTemplateMolecule(TemplateMolecule *t);
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592 void updateRxnMembership(Molecule * m);
00593
00594
00595 void populateWithDefaultMolecules(int moleculeCount);
00596
00597
00598
00599
00600
00601
00602
00603 void prepareForSimulation();
00604
00605
00606
00607 void printDetails() const;
00608 void printAllMolecules();
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626 int addLocalFunc_TypeI(LocalFunction *lf);
00627 int addLocalFunc_TypeII(LocalFunction *lf);
00628 vector <LocalFunction *> locFuncs_typeI;
00629 vector <LocalFunction *> locFuncs_typeII;
00630
00631 int getNumOfTypeIFunctions() const {return locFuncs_typeI.size(); };
00632 LocalFunction *getTypeILocalFunction(int index) { return locFuncs_typeI.at(index); };
00633 int getNumOfTypeIIFunctions() const {return locFuncs_typeII.size(); };
00634 LocalFunction *getTypeIILocalFunction(int index) { return locFuncs_typeII.at(index); };
00635
00636 int getNumOfDORrxns() const { return indexOfDORrxns.size(); };
00637 ReactionClass * getDORrxn(int dorRxnIndex) const { return reactions.at(indexOfDORrxns.at(dorRxnIndex)); };
00638 int getDORrxnIndex(int dorRxnIndex) const { return indexOfDORrxns.at(dorRxnIndex); };
00639 int getDORrxnPosition(int dorRxnIndex) const { return reactionPositions.at(indexOfDORrxns.at(dorRxnIndex)); };
00640
00641 void setUpLocalFunctionListForMolecules();
00642
00643 protected:
00644
00645 void init(
00646 string name,
00647 vector <string> &compName,
00648 vector <string> &defaultCompState,
00649 vector < vector<string> > &possibleCompStates,
00650 vector <bool> isIntegerComponent,
00651 System *system);
00652
00653
00654
00655 System *system;
00656 string name;
00657 int type_id;
00658
00659
00660 int numOfComponents;
00661 string *compName;
00662 vector < vector < string > > possibleCompStates;
00663 int *defaultCompState;
00664 bool *isIntegerCompState;
00665
00666
00667
00668 int n_eqComp;
00669 string *eqCompOriginalName;
00670 int * eqCompSizes;
00671 string **eqCompName;
00672 int **eqCompIndex;
00673
00674
00675
00676 MoleculeList * mList;
00677
00678 vector <ReactionClass *> reactions;
00679 vector <int> reactionPositions;
00680
00681 vector <int> indexOfDORrxns;
00682
00683
00684 vector <MoleculesObservable *> molObs;
00685
00686 vector <TemplateMolecule *> allTemplates;
00687
00688
00689 ReactionClass *rxn;
00690
00691
00692
00693 private:
00694
00695 vector<Molecule *>::iterator molIter;
00696 vector<MoleculesObservable *>::iterator molObsIter;
00697 vector <ReactionClass *>::iterator rxnIter;
00698 };
00699
00700
00701
00703
00712 class Molecule
00713 {
00714 public:
00715
00716
00717 Molecule(MoleculeType * parentMoleculeType, int listId);
00718 ~Molecule();
00719
00720
00721 int getMolListId() const { return listId; };
00722 string getMoleculeTypeName() const { return parentMoleculeType->getName(); };
00723 MoleculeType * getMoleculeType() const { return parentMoleculeType; };
00724 int getUniqueID() const { return ID_unique; };
00725 bool isAlive() const { return isAliveInSim; };
00726 void setAlive(bool isAlive) { isAliveInSim = isAlive; };
00727
00728 void setComplexID(int currentComplex) { this->ID_complex=currentComplex; }
00729
00730 int getComplexID() const { return ID_complex; };
00731 Complex * getComplex() const { return (parentMoleculeType->getSystem()->getAllComplexes()).getComplex(ID_complex); };
00732 int getDegree();
00733
00734
00736 int getComponentState(int cIndex) const { return component[cIndex]; };
00737 int getComponentIndexOfBond(int cIndex) const { return indexOfBond[cIndex]; };
00738 void setComponentState(int cIndex, int newValue);
00739 void setComponentState(string cName, int newValue);
00740
00741
00743 void setLocalFunctionValue(double newValue,int localFunctionIndex);
00744 double getLocalFunctionValue(int localFunctionIndex);
00745 LocalFunction * getLocalFunction(int localFunctionIndex);
00746 void setUpLocalFunctionList();
00747
00748
00750
00751
00752 bool isBindingSiteOpen(int bIndex) const;
00753 bool isBindingSiteBonded(int bIndex) const;
00754 Molecule * getBondedMolecule(int bSiteIndex) const;
00755 int getBondedMoleculeBindingSiteIndex(int cIndex) const;
00756
00757 int getRxnListMappingId(int rxnIndex) const { return rxnListMappingId[rxnIndex]; };
00758 void setRxnListMappingId(int rxnIndex, int rxnListMappingId) {
00759 this->rxnListMappingId[rxnIndex] = rxnListMappingId;
00760 };
00761
00762
00763
00764
00765 void setBondTo(Molecule * m2, int bindingSiteIndex);
00766 void moveToNewComplex(int newComplexID) { ID_complex = newComplexID; };
00767
00768
00769
00770 static void bind(Molecule *m1, int cIndex1, Molecule *m2, int cIndex2);
00771 static void bind(Molecule *m1, string compName1, Molecule *m2, string compName2);
00772 static void unbind(Molecule *m1, int bSiteIndex);
00773 static void unbind(Molecule *m1, char * bSiteName);
00774
00775
00776
00777
00778 void traverseBondedNeighborhood(list <Molecule *> &members, int traversalLimit);
00779 static void breadthFirstSearch(list <Molecule *> &members, Molecule *m, int depth);
00780 void depthFirstSearch(list <Molecule *> &members);
00781
00782
00783
00784 void prepareForSimulation();
00785
00786
00787
00788 void updateRxnMembership();
00789 void removeFromObservables();
00790 void addToObservables();
00791
00792
00793
00794
00795
00796
00797
00798 void updateTypeIIFunctions();
00799 void updateDORRxnValues();
00800
00801
00802
00803
00804 void printDetails();
00805 void printDetails(ostream &o);
00806 static void printMoleculeList(list <Molecule *> &members);
00807
00808 static int getUniqueIdCount() { return uniqueIdCount; };
00809 static const int NOT_IN_RXN = -1;
00810
00811
00812 int isObs(int oIndex) const { return isObservable[oIndex]; };
00813 void setIsObs(int oIndex, int isObs) { isObservable[oIndex]=isObs; };
00814
00815
00816
00817 bool hasVisitedMolecule;
00818 bool * hasVisitedBond;
00819 TemplateMolecule *isMatchedTo;
00820
00821
00822 bool hasEvaluatedMolecule;
00823
00824
00825 static const int NOSTATE = -1;
00826 static const int NOBOND = 0;
00827 static const int NOINDEX = -1;
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843 protected:
00844
00845
00846 bool isPrepared;
00847 bool isAliveInSim;
00848
00849
00850 int ID_complex;
00851 int ID_type;
00852 int ID_unique;
00853 int listId;
00854
00855
00856 static int uniqueIdCount;
00857
00858
00859 MoleculeType *parentMoleculeType;
00860 bool useComplex;
00861
00862
00863
00864
00865
00867
00868 int *component;
00869 int numOfComponents;
00870 Molecule **bond;
00871 int *indexOfBond;
00872
00873
00875 double *localFunctionValues;
00876
00877
00878
00879 int *isObservable;
00880
00881
00882
00883 int * rxnListMappingId;
00884 int nReactions;
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894 private:
00895
00896 static queue <Molecule *> q;
00897 static queue <int> d;
00898 static list <Molecule *>::iterator molIter;
00899
00900
00901 };
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00913
00932 class ReactionClass
00933 {
00934
00935 friend class MatchSetIter;
00936 friend class Netgen;
00937
00938 public:
00939 static const int NO_LIMIT = -3;
00940
00941 static const int BASIC_RXN = 0;
00942 static const int DOR_RXN = 1;
00943 static const int OBS_DEPENDENT_RXN = 2;
00944
00945
00946
00947 ReactionClass(string name, double rate, string baseRateParameterName, TransformationSet *transformationSet, System *s);
00948 virtual ~ReactionClass();
00949
00950 int getNumOfReactants() const { return n_reactants; };
00951
00952 string getName() const { return name; };
00953 double getBaseRate() const { return baseRate; };
00954 int getRxnType() const { return reactionType; };
00955
00956 void setBaseRate(double newBaseRate,string newBaseRateName) {
00957 if(isDimerStyle) {
00958 this->baseRate=newBaseRate*0.5;
00959 }
00960 else this->baseRate=newBaseRate;
00961 this->baseRateParameterName=newBaseRateName;
00962 update_a();
00963 };
00964
00965 void resetBaseRateFromSystemParamter();
00966
00967 void setTraversalLimit(int limit) { this->traversalLimit = limit; };
00968
00969 double get_a() const { return a; };
00970 virtual void printDetails() const;
00971 void fire(double random_A_number);
00972
00973
00974 virtual void notifyRateFactorChange(Molecule * m, int reactantIndex, int rxnListIndex) = 0;
00975 virtual int getDORreactantPosition() const { cerr<<"Trying to get DOR reactant Position from a reaction that is not of type DOR!"<<endl;
00976 cerr<<"this is an internal error, and so I will quit."<<endl; exit(1); return -1; };
00977
00978
00979
00980 virtual void init() = 0;
00981 virtual void prepareForSimulation() = 0;
00982 virtual bool tryToAdd(Molecule *m, unsigned int reactantPos) = 0;
00983 virtual void remove(Molecule *m, unsigned int reactantPos) = 0;
00984
00985 virtual double update_a() = 0;
00986
00987
00988
00989
00990 void tag() { tagged = true; };
00991
00992
00993 virtual unsigned int getReactantCount(unsigned int reactantIndex) const = 0;
00994 virtual void printFullDetails() const = 0;
00995
00996
00997 void setRxnId(int rxnId) { this->rxnId = rxnId; };
00998 int getRxnId() const { return rxnId; };
00999
01000
01001 void turnOff_OnTheFlyObs() { onTheFlyObservables=false; };
01002
01003
01004 void setTotalRateFlag(bool totalRate) { totalRateFlag = totalRate; };
01005
01006
01007 void set_match( vector <MappingSet *> & match_set );
01008 void apply( vector <Molecule *> & product_molecules );
01009
01010
01011 protected:
01012 virtual void pickMappingSets(double randNumber) const=0;
01013
01014 int rxnId;
01015
01016
01017 bool tagged;
01018
01019 string name;
01020 int reactionType;
01021 unsigned int n_reactants;
01022
01023 System * system;
01024
01025 double baseRate;
01026 string baseRateParameterName;
01027 double a;
01028 unsigned int fireCounter;
01029
01030 unsigned int traversalLimit;
01031
01032 TemplateMolecule **reactantTemplates;
01033 TransformationSet * transformationSet;
01034 MappingSet **mappingSet;
01035
01036 bool onTheFlyObservables;
01037 bool isDimerStyle;
01038
01039
01040 list <Molecule *> products;
01041 list <Molecule *>::iterator molIter;
01042
01043
01044
01045 vector <int> updatedComplexes;
01046
01047
01051 bool totalRateFlag;
01052 };
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062
01063
01064
01065
01067
01070 class Complex
01071 {
01072 public:
01073 Complex(System * s, int ID_complex, Molecule * m);
01074 ~Complex();
01075
01076
01077 bool isAlive();
01078 int getComplexID() const { return ID_complex; };
01079 int getComplexSize() const {return complexMembers.size();};
01080 int getMoleculeCountOfType(MoleculeType *m);
01081
01082 void mergeWithList(Complex * c);
01083
01084
01085 void updateComplexMembership(Molecule * m);
01086
01087
01088 void refactorToNewComplex(int new_ID_complex);
01089
01090 void emptyComplexForever() {};
01091
01092 static const int UNIFORM = 0;
01093 static const int FIXED_POINT = 1;
01094 static const int DIFFUSE_3D = 2;
01095
01096
01097 void printDegreeDistribution();
01098 void getDegreeDistribution(vector <int> °reeDist);
01099 void printDetails();
01100 void printDetailsLong();
01101
01102
01103 double getDistance(Complex * c) {return 1000.0; };
01104 double getXpos() { return 0; };
01105 double getYpos() { return 0; };
01106 double getZpos() { return 0; };
01107
01108
01109 list <Molecule *> complexMembers;
01110 list <Molecule *>::iterator molIter;
01111
01112
01113
01114 protected:
01115 System * system;
01116 int ID_complex;
01117
01118
01119 private:
01120
01121 };
01122
01123 }
01124
01125 #endif