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

LaubLoomisDictyRunDirector.cpp

Go to the documentation of this file.
00001 // LaubLoomisDictyRunDirector.cpp: implementation of the CLaubLoomisDictyRunDirector class.
00002 //
00004 
00005 #include "LaubLoomisDictyRunDirector.h"
00006 
00008 // Construction/Destruction
00010 
00011 CLaubLoomisDictyRunDirector::CLaubLoomisDictyRunDirector()
00012 {
00013         double maxSimTime = 300.0;
00014         int intTime = (int) maxSimTime + 2;
00015         double stepSize = 0.001;
00016         double frequency = 1.0;
00017         double moveTol = 1.0e-06;
00018 
00019         int cnt = 0;
00020 
00021         // spontaneous oscillations
00022         m_vpRxnNetworks.push_back(new CLaubLoomisDictyNetwork());
00023         m_vpRxnMovers.push_back(new CQualityControlCashKarpMover(frequency,stepSize,moveTol));
00024         int nChemicals = m_vpRxnNetworks[cnt]->GetNumberOfChemicals();
00025         m_vpCellObservers.push_back(new CellAverageObserver(nChemicals,intTime,1));
00026         m_vpRunnables.push_back(new CRunnable());
00027         m_vpRunnables[cnt]->SetComponents(m_vpRxnNetworks[cnt],m_vpRxnMovers[cnt],m_vpCellObservers[cnt]);
00028         // create an observer for the runnable
00029         m_vpGnuPlotters.push_back(new GnuPlotterRunnableObserver());
00030         m_vpGnuPlotters[cnt]->SetTitle("cAMP Signaling in D. discoideum : Laub and Loomis : Spontaneous Oscillations");
00031         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(0);
00032         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(1);
00033         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(2);
00034         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(3);
00035         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(4);
00036         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(5);
00037         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(6);
00038         // attach the observer
00039         m_vpRunnables[cnt]->Attach(m_vpGnuPlotters[cnt]);
00040         cnt++;
00041 
00042         // external cAMP spike at t=0
00043         m_vpRxnNetworks.push_back(new CLaubLoomisDictyNetwork());
00044         m_vpRxnMovers.push_back(new CQualityControlCashKarpMover(frequency,stepSize,moveTol));
00045         nChemicals = m_vpRxnNetworks[cnt]->GetNumberOfChemicals();
00046         m_vpCellObservers.push_back(new CellAverageObserver(nChemicals,intTime,1));
00047         m_vpRunnables.push_back(new CRunnable());
00048         m_vpRunnables[cnt]->SetComponents(m_vpRxnNetworks[cnt],m_vpRxnMovers[cnt],m_vpCellObservers[cnt]);
00049         // create an observer for the runnable
00050         m_vpGnuPlotters.push_back(new GnuPlotterRunnableObserver());
00051         m_vpGnuPlotters[cnt]->SetTitle("cAMP Signaling in D. discoideum : Laub and Loomis : 20 uM cAMPe Spike");
00052         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(0);
00053         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(1);
00054         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(2);
00055         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(3);
00056         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(4);
00057         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(5);
00058         m_vpGnuPlotters[cnt]->AddChemicalNumberToList(6);
00059         // attach the observer
00060         m_vpRunnables[cnt]->Attach(m_vpGnuPlotters[cnt]);
00061         cnt++;
00062 
00063         // define runs
00064         DefineRuns();
00065 
00066 }
00067 
00068 CLaubLoomisDictyRunDirector::~CLaubLoomisDictyRunDirector()
00069 {
00070 
00071 
00072 }
00073 
00074 void CLaubLoomisDictyRunDirector::DefineRuns()
00075 {
00076         // set parameters in the runnables to those read from a previous
00077         // optimization pass; assumes all runnables have same number of 
00078         // rate constants
00079         ParameterReader *pReader = new ParameterReader("LLconvert.par");
00080         int nRC = m_vpRunnables[0]->GetReactionNetwork()->GetNumberOfRateConstants();
00081         for(int j = 0; j < nRC; j++)
00082         {
00083                 double rate = pReader->ReadParameter();
00084                 for(int i = 0; i < m_vpRunnables.size(); i++)
00085                 {
00086                         m_vpRunnables[i]->GetReactionNetwork()->GetRateConstant(j)->SetRateConstant(rate);
00087                 }
00088         }
00089         delete pReader;
00090 
00091         
00092         m_vpRunnables[1]->GetReactionNetwork()->GetChemical(5)->SetInitialAmount(20*300000.0);
00093         m_vpRunnables[1]->GetReactionNetwork()->GetChemical(5)->Reset();
00094 
00095 }

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