Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Reaction.cpp

Go to the documentation of this file.
00001 // Reaction.cpp: implementation of the Reaction class.
00002 //
00004 
00005 #ifdef _WINDOWS
00006 #include "stdafx.h"
00007 #endif
00008 
00009 #include "Reaction.h"
00010 
00012 // Construction/Destruction
00014 
00015 Reaction::Reaction()
00016 {
00017 
00018 }
00019 
00020 Reaction::Reaction(std::string reactionName)
00021 {
00022         this->reactionName = reactionName;
00023 }
00024 
00025 Reaction::~Reaction()
00026 {
00027         // WARNING:
00028         // chemicals and rate constants have already been deleted in the network
00029         // so don't delete them here!
00030 
00031         // clean up jacobian
00032         for(int i = 0; i < chemicalJacobian.size(); i++)
00033         {
00034                 delete chemicalJacobian[i];
00035         }
00036 }
00037 
00038 std::vector<Chemical *> *Reaction::GetChemicals()
00039 {
00040         return &chemicals;
00041 }
00042 
00043 void Reaction::DoReactionOnce()
00044 {
00045         // Iterate over chemicals: change amount of each 
00046         int numChemicals = chemicals.size();
00047         for (int i=0; i<numChemicals; i++)
00048         {
00049                 chemicals[i]->IncrementAmount(numberOfEachChemicalChangedByReaction[i]);
00050         }
00051 
00052 }
00053 
00054 int Reaction::GetNumberChangedByReaction(int chemicalNumber)
00055 {
00056         return numberOfEachChemicalChangedByReaction[chemicalNumber];
00057 }

Generated on Mon Nov 3 09:38:11 2003 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002