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

OneGeneReplicaMinimizableDirector.cpp

Go to the documentation of this file.
00001 // OneGeneReplicaMinimizableDirector.cpp: implementation of the COneGeneReplicaMinimizableDirector class.
00002 //
00004 
00005 #include "OneGeneReplicaMinimizableDirector.h"
00006 
00008 // Construction/Destruction
00010 
00011 COneGeneReplicaMinimizableDirector::COneGeneReplicaMinimizableDirector(double epsSqr, double deltaSqr)
00012 :CReplicaMinimizableDirector(epsSqr, deltaSqr)
00013 {
00014         double maxSimTime = 91.0;
00015         double stepSize = 0.0001;
00016         double frequency = 1.0;
00017         int nCells = 1;
00018 
00019         bool rateFlag = true;
00020         bool chemFlag = false;
00021         bool logsFlag = false;
00022         double timeWeight = 1.0;
00023         double rateWeight = 0.0;
00024         double chemWeight = 0.0;
00025 
00026         // penalty for long integrations
00027         m_dGammaSquared = 0.0;
00028 
00029         // fake experiment 1 - large network
00030         _networkList.push_back(new CAlternateOneGeneInhibitoryNetwork());
00031         _experimentList.push_back(new Experiment(_networkList[0],"Big Network"));
00032         // data files
00033         _experimentList[0]->AddDataFileToList("bigOneGeneDS.dat");
00034         // mover and plotter
00035         _moverList.push_back(new CQualityControlCashKarpMover(frequency,stepSize,1.0e-06));
00036         m_vpPlotterList.push_back(new GnuPlotterTimeSeriesObserver());
00037         // title
00038         m_vpPlotterList[0]->SetTitle("Big OGN:1 Free Promoter:ODE");
00039         // minimizable
00040         _minimizableList.push_back(new SingleNetworkMinimizable());
00041         // parameters
00042         _minimizableList[0]->Initialize(_experimentList[0],_moverList[0],nCells,rateFlag,chemFlag,logsFlag,timeWeight,rateWeight,chemWeight);
00043         // attach observer
00044         _minimizableList[0]->Attach(m_vpPlotterList[0]);
00045 
00046         // fake experiment 2 - small network
00047         _networkList.push_back(new OneGeneInhibitoryNetwork());
00048         _experimentList.push_back(new Experiment(_networkList[1],"Small Network"));
00049         // data files
00050         _experimentList[1]->AddDataFileToList("smallOneGeneDS.dat");
00051         // mover and plotter
00052         _moverList.push_back(new CQualityControlCashKarpMover(frequency,stepSize,1.0e-06));
00053         m_vpPlotterList.push_back(new GnuPlotterTimeSeriesObserver());
00054         // title
00055         m_vpPlotterList[1]->SetTitle("Small OGN:1 Free Promoter:ODE");
00056         // minimizable
00057         _minimizableList.push_back(new SingleNetworkMinimizable());
00058         // parameters
00059         _minimizableList[1]->Initialize(_experimentList[1],_moverList[1],nCells,rateFlag,chemFlag,logsFlag,timeWeight,rateWeight,chemWeight);
00060         // attach observer
00061         _minimizableList[1]->Attach(m_vpPlotterList[1]);
00062 
00063         // find the parameter intersection lists
00064         SetIntersectionLists();
00065 
00066         // allocate the master residuals list
00067         int masterResidualsSize = 0;
00068         for(int i = 0; i < _minimizableList.size(); i++)
00069         {
00070                 masterResidualsSize += _minimizableList[i]->GetNResiduals();
00071         }
00072         masterResidualsSize += m_viIntersectOne.size();
00073         masterResidualsSize += 1;               // for the participation ratio  
00074         if(m_dGammaSquared > 0.0)
00075         {
00076                 masterResidualsSize += 1;
00077         }
00078         Allocate(masterResidualsSize);
00079 
00080         cout << "Master Residuals size : " << masterResidualsSize << endl;
00081         
00082         // define the experiments
00083         DefineExperiments();
00084 }
00085 
00086 COneGeneReplicaMinimizableDirector::~COneGeneReplicaMinimizableDirector()
00087 {
00088         for(int i = 0; i < _minimizableList.size(); i++)
00089         {
00090                 _minimizableList[i]->Detach(m_vpPlotterList[i]);
00091         }
00092         for(int i = 0; i < m_vpPlotterList.size(); i++)
00093         {
00094                 delete m_vpPlotterList[i];
00095         }
00096 
00097 }
00098 
00099 void COneGeneReplicaMinimizableDirector::DefineExperiments()
00100 {
00101         // 1 free promoter, no bound, no mRNA, no protein
00102         _minimizableList[0]->GetExperiment()->GetReactionNetwork()->GetChemical(0)->SetInitialAmount(1.0);
00103         _minimizableList[0]->GetExperiment()->GetReactionNetwork()->GetChemical(0)->Reset();
00104         _minimizableList[0]->GetExperiment()->GetReactionNetwork()->GetChemical(1)->SetInitialAmount(0.0);
00105         _minimizableList[0]->GetExperiment()->GetReactionNetwork()->GetChemical(1)->Reset();
00106 
00107         // 1 free promoter, no bound, no mRNA, no protein
00108         _minimizableList[1]->GetExperiment()->GetReactionNetwork()->GetChemical(0)->SetInitialAmount(1.0);
00109         _minimizableList[1]->GetExperiment()->GetReactionNetwork()->GetChemical(0)->Reset();
00110         _minimizableList[1]->GetExperiment()->GetReactionNetwork()->GetChemical(1)->SetInitialAmount(0.0);
00111         _minimizableList[1]->GetExperiment()->GetReactionNetwork()->GetChemical(1)->Reset();
00112 
00113 }
00114 

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