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

OneGeneInhibitoryNetworkMinimizableDirectorOLD.cpp

Go to the documentation of this file.
00001 // OneGeneInhibitoryNetworkMinimizableDirector.cpp: implementation of the OneGeneInhibitoryNetworkMinimizableDirector class.
00002 //
00004 
00005 #include "OneGeneInhibitoryNetworkMinimizableDirector.h"
00006 
00008 // Construction/Destruction
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         // fake experiment 1 - 1 free promoter, no mRNA or protein
00029         _networkList.push_back(new OneGeneInhibitoryNetwork());
00030         _experimentList.push_back(new Experiment(_networkList[0],"SmallNetwork"));
00031         // data files
00032         LocateInputFileDirectory locate("smallOneGeneDS.dat");
00033         const char* foundFileName = locate.Get("smallOneGeneDS.dat");
00034         _experimentList[0]->AddDataFileToList(foundFileName);
00035         // mover and plotter
00036         _moverList.push_back(new CQualityControlCashKarpMover(frequency,stepSize,moveTol));
00037         // minimizable
00038         _minimizableList.push_back(new SingleNetworkMinimizable());
00039         // parameters
00040         _minimizableList[0]->Initialize(_experimentList[0],_moverList[0],nCells,rateFlag,chemFlag,logsFlag,timeWeight,rateWeight,chemWeight);
00041         _minimizableList[0]->SetRateConstantsWeight(0.0);
00042         // attach observer
00043 //      m_vpPlotterList.push_back(new GnuPlotterTimeSeriesObserver());
00044         // title
00045 //      m_vpPlotterList[0]->SetTitle("Small OGN:1 Free Promoter:ODE");
00046 //      _minimizableList[0]->Attach(m_vpPlotterList[0]);
00047 
00048         // parameters which need a prior
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         // allocate the master residuals list
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         // add residuals for prior parameter costs, if applicable
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         // define the experiments
00076         DefineExperiments();
00077 
00078         // dump info about residuals
00079         //DumpResidualInfo();
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         // 1 free promoter region, no bound, no mRNA, no protein
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         // Just return the first set (they are all the same)
00103         return _minimizableList[0]->GetParameter(parIndex);
00104 }
00105 
00106 int COneGeneInhibitoryNetworkMinimizableDirector::GetNParameters()
00107 {
00108         // Return the size of the first set (all have the same size)
00109         return _minimizableList[0]->GetNParameters();
00110 }
00111 

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