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