00001
00002
00004
00005 #include "LaubLoomisDictyRunDirector.h"
00006
00008
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
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
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
00039 m_vpRunnables[cnt]->Attach(m_vpGnuPlotters[cnt]);
00040 cnt++;
00041
00042
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
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
00060 m_vpRunnables[cnt]->Attach(m_vpGnuPlotters[cnt]);
00061 cnt++;
00062
00063
00064 DefineRuns();
00065
00066 }
00067
00068 CLaubLoomisDictyRunDirector::~CLaubLoomisDictyRunDirector()
00069 {
00070
00071
00072 }
00073
00074 void CLaubLoomisDictyRunDirector::DefineRuns()
00075 {
00076
00077
00078
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 }