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

OneGeneStochasticNetworkRunDirector.cpp

Go to the documentation of this file.
00001 // OneGeneStochasticNetworkRunDirector.cpp: implementation of the COneGeneStochasticNetworkRunDirector class.
00002 //
00004 
00005 #include "OneGeneStochasticNetworkRunDirector.h"
00006 
00008 // Construction/Destruction
00010 
00011 COneGeneStochasticNetworkRunDirector::COneGeneStochasticNetworkRunDirector()
00012 {
00013         double maxSimTime = 120.0;
00014         int intTime = (int) maxSimTime + 2;
00015         double stepSize = 0.001;
00016         double frequency = 1.0;
00017         double moveTol = 1.0e-06;
00018         int seed = 298989;
00019 
00020         // unbound promoter, diff eq.
00021         m_vpRxnNetworks.push_back(new OneGeneInhibitoryNetwork());
00022 //      m_vpRxnMovers.push_back(new CQualityControlCashKarpMover(frequency,stepSize,moveTol));
00023         m_vpRxnMovers.push_back(new CContinuousTimeMonteCarloMover(seed,frequency));
00024         int nChemicals = m_vpRxnNetworks[0]->GetNumberOfChemicals();
00025         m_vpCellObservers.push_back(new CellAverageObserver(nChemicals,intTime,1));
00026         m_vpRunnables.push_back(new CRunnable());
00027         m_vpRunnables[0]->SetComponents(m_vpRxnNetworks[0],m_vpRxnMovers[0],m_vpCellObservers[0]);
00028         // create an observer for the runnable
00029         m_vpGnuPlotters.push_back(new GnuPlotterRunnableObserver());
00030         m_vpGnuPlotters[0]->AddChemicalNumberToList(2);
00031         m_vpGnuPlotters[0]->AddChemicalNumberToList(3);
00032         // attach the observer
00033         m_vpRunnables[0]->Attach(m_vpGnuPlotters[0]);
00034 
00035         // define runs
00036         DefineRuns();
00037 
00038 }
00039 
00040 COneGeneStochasticNetworkRunDirector::~COneGeneStochasticNetworkRunDirector()
00041 {
00042 
00043 }
00044 
00045 void COneGeneStochasticNetworkRunDirector::DefineRuns()
00046 {
00047         // set parameters in the runnables to those read from a previous
00048         // optimization pass; assumes all runnables have same number of 
00049         // rate constants
00050 
00051         ParameterReader *pReader = new ParameterReader("onegene_cg.par");
00052         int nRC = m_vpRunnables[0]->GetReactionNetwork()->GetNumberOfRateConstants();
00053         for(int j = 0; j < nRC; j++)
00054         {
00055                 double rate = pReader->ReadParameter();
00056                 for(int i = 0; i < m_vpRunnables.size(); i++)
00057                 {
00058                         m_vpRunnables[i]->GetReactionNetwork()->GetRateConstant(j)->SetRateConstant(rate);
00059                 }
00060         }
00061         delete pReader;
00062 
00063         // specific to this simulation
00064         // 1 free promoter
00065         m_vpRunnables[0]->GetReactionNetwork()->GetChemical(0)->SetInitialAmount(1.0);
00066         m_vpRunnables[0]->GetReactionNetwork()->GetChemical(0)->Reset();
00067         m_vpRunnables[0]->GetReactionNetwork()->GetChemical(1)->SetInitialAmount(0.0);
00068         m_vpRunnables[0]->GetReactionNetwork()->GetChemical(1)->Reset();
00069         m_vpGnuPlotters[0]->SetTitle("Promoter Binding, ODE");
00070 
00071 }

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