00001
00002
00004
00005 #include "OneGeneReplicaMinimizableDirector.h"
00006
00008
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
00027 m_dGammaSquared = 0.0;
00028
00029
00030 _networkList.push_back(new CAlternateOneGeneInhibitoryNetwork());
00031 _experimentList.push_back(new Experiment(_networkList[0],"Big Network"));
00032
00033 _experimentList[0]->AddDataFileToList("bigOneGeneDS.dat");
00034
00035 _moverList.push_back(new CQualityControlCashKarpMover(frequency,stepSize,1.0e-06));
00036 m_vpPlotterList.push_back(new GnuPlotterTimeSeriesObserver());
00037
00038 m_vpPlotterList[0]->SetTitle("Big OGN:1 Free Promoter:ODE");
00039
00040 _minimizableList.push_back(new SingleNetworkMinimizable());
00041
00042 _minimizableList[0]->Initialize(_experimentList[0],_moverList[0],nCells,rateFlag,chemFlag,logsFlag,timeWeight,rateWeight,chemWeight);
00043
00044 _minimizableList[0]->Attach(m_vpPlotterList[0]);
00045
00046
00047 _networkList.push_back(new OneGeneInhibitoryNetwork());
00048 _experimentList.push_back(new Experiment(_networkList[1],"Small Network"));
00049
00050 _experimentList[1]->AddDataFileToList("smallOneGeneDS.dat");
00051
00052 _moverList.push_back(new CQualityControlCashKarpMover(frequency,stepSize,1.0e-06));
00053 m_vpPlotterList.push_back(new GnuPlotterTimeSeriesObserver());
00054
00055 m_vpPlotterList[1]->SetTitle("Small OGN:1 Free Promoter:ODE");
00056
00057 _minimizableList.push_back(new SingleNetworkMinimizable());
00058
00059 _minimizableList[1]->Initialize(_experimentList[1],_moverList[1],nCells,rateFlag,chemFlag,logsFlag,timeWeight,rateWeight,chemWeight);
00060
00061 _minimizableList[1]->Attach(m_vpPlotterList[1]);
00062
00063
00064 SetIntersectionLists();
00065
00066
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;
00074 if(m_dGammaSquared > 0.0)
00075 {
00076 masterResidualsSize += 1;
00077 }
00078 Allocate(masterResidualsSize);
00079
00080 cout << "Master Residuals size : " << masterResidualsSize << endl;
00081
00082
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
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
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