00001
00002
00004
00005 #include "OneGeneInhibitoryNetworkMinimizableDirector.h"
00006
00008
00010
00011 COneGeneInhibitoryNetworkMinimizableDirector::COneGeneInhibitoryNetworkMinimizableDirector()
00012 {
00013 double maxSimTime = 91.0;
00014 double stepSize = 0.0001;
00015 double frequency = 1.0;
00016 int nCells = 1;
00017 double moveTol = 1.0e-06;
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 m_dGammaSquared = 1.0e-07;
00027
00028
00029 _networkList.push_back(new OneGeneInhibitoryNetwork());
00030 _experimentList.push_back(new Experiment(_networkList[0],"SmallNetwork"));
00031
00032 LocateInputFileDirectory locate("smallOneGeneDS.dat");
00033 const char* foundFileName = locate.Get("smallOneGeneDS.dat");
00034 _experimentList[0]->AddDataFileToList(foundFileName);
00035
00036 _moverList.push_back(new CQualityControlCashKarpMover(frequency,stepSize,moveTol));
00037
00038 _minimizableList.push_back(new SingleNetworkMinimizable());
00039
00040 _minimizableList[0]->Initialize(_experimentList[0],_moverList[0],nCells,rateFlag,chemFlag,logsFlag,timeWeight,rateWeight,chemWeight);
00041 _minimizableList[0]->SetRateConstantsWeight(0.0);
00042
00043
00044
00045
00046
00047
00048
00049 m_iPriorList.push_back(0);
00050 m_iPriorList.push_back(1);
00051 m_iPriorList.push_back(2);
00052 m_iPriorList.push_back(3);
00053 m_iPriorList.push_back(4);
00054 m_iPriorList.push_back(5);
00055
00056
00057 int masterResidualsSize = 0;
00058 for(int i = 0; i < _minimizableList.size(); i++)
00059 {
00060 int subRes = _minimizableList[i]->GetNResiduals();
00061 masterResidualsSize += subRes;
00062 cout << subRes << " residuals in minimizable " << i << endl;
00063 }
00064
00065 masterResidualsSize += m_iPriorList.size();
00066 cout << m_iPriorList.size() << " parameters are constrained by a prior " << endl;
00067 if(m_dGammaSquared > 0.0)
00068 {
00069 masterResidualsSize += 1;
00070 }
00071 Allocate(masterResidualsSize);
00072
00073 cout << "Master Residuals size : " << masterResidualsSize << endl;
00074
00075
00076 DefineExperiments();
00077
00078
00079
00080 }
00081
00082 COneGeneInhibitoryNetworkMinimizableDirector::~COneGeneInhibitoryNetworkMinimizableDirector()
00083 {
00084 for(int i = 0; i < m_vpPlotterList.size(); i++)
00085 {
00086 _minimizableList[i]->Detach(m_vpPlotterList[i]);
00087 delete m_vpPlotterList[i];
00088 }
00089 }
00090
00091 void COneGeneInhibitoryNetworkMinimizableDirector::DefineExperiments()
00092 {
00093
00094 _minimizableList[0]->GetExperiment()->GetReactionNetwork()->GetChemical(0)->SetInitialAmount(1.0);
00095 _minimizableList[0]->GetExperiment()->GetReactionNetwork()->GetChemical(0)->Reset();
00096 _minimizableList[0]->GetExperiment()->GetReactionNetwork()->GetChemical(1)->SetInitialAmount(0.0);
00097 _minimizableList[0]->GetExperiment()->GetReactionNetwork()->GetChemical(1)->Reset();
00098 }
00099
00100 double COneGeneInhibitoryNetworkMinimizableDirector::GetParameter(int parIndex)
00101 {
00102
00103 return _minimizableList[0]->GetParameter(parIndex);
00104 }
00105
00106 int COneGeneInhibitoryNetworkMinimizableDirector::GetNParameters()
00107 {
00108
00109 return _minimizableList[0]->GetNParameters();
00110 }
00111