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

MartielGoldbeterDictyNetworkMinimizableDirector.cpp

Go to the documentation of this file.
00001 // MartielGoldbeterDictyNetworkMinimizableDirector.cpp: implementation of the CMartielGoldbeterDictyNetworkMinimizableDirector class.
00002 //
00004 
00005 #include "MartielGoldbeterDictyNetworkMinimizableDirector.h"
00006 
00008 // Construction/Destruction
00010 
00011 CMartielGoldbeterDictyNetworkMinimizableDirector::CMartielGoldbeterDictyNetworkMinimizableDirector()
00012 {
00013         // create networks,experiments,observers,movers,minimizables
00014         double maxSimTime = 91.0;
00015         double stepSize = 0.0001;
00016         double frequency = 1.0;
00017         int nCells = 1;
00018         double moveTol = 1.0e-06;
00019 
00020         m_dGammaSquared = 1.0e-07;
00021         
00022         // flags for all minimizables
00023         bool rateFlag = true;
00024         bool chemFlag = false;
00025         bool logsFlag = false;
00026         double timeWeight = 1.0;
00027         double rateWeight = 0.0;
00028         double chemWeight = 0.0;
00029 
00030         int cnt = 0;
00031 
00032         // expt. 1 - Roos 1977
00033         // networks and data
00034         _networkList.push_back(new CMartielGoldbeterDictyNetwork());
00035         _experimentList.push_back(new Experiment(_networkList[cnt],"Roos et. al. 1977"));
00036         // put data files here
00037         _experimentList[cnt]->AddDataFileToList("../DataFiles/TimeSeries/cAMPiRoos.dat");
00038         // mover and plotter
00039         _moverList.push_back(new CQualityControlCashKarpMover(frequency,stepSize,moveTol));
00040         _plotterList.push_back(new GnuPlotterTimeSeriesObserver());
00041         // title
00042         _plotterList[cnt]->SetTitle("D. discoideum cAMP Production:Roos et. al. 1977:ODE");
00043         // minimizable
00044         _minimizableList.push_back(new SingleNetworkMinimizable());
00045         // parameters
00046         _minimizableList[cnt]->Initialize(_experimentList[cnt],_moverList[cnt],nCells,rateFlag,chemFlag,logsFlag,timeWeight,rateWeight,chemWeight);
00047         _minimizableList[cnt]->SetRateConstantsWeight(0.0);
00048         // attach observer
00049         _minimizableList[cnt]->Attach(_plotterList[cnt]);
00050         cnt++;
00051 
00052 
00053         // allocate the master residuals list
00054         int masterResidualsSize = 0;
00055         for(int i = 0; i < _minimizableList.size(); i++)
00056         {
00057                 int subRes = _minimizableList[i]->GetNResiduals();
00058                 masterResidualsSize += subRes;
00059                 cout << subRes << " residuals in minimizable " << i << endl;
00060         }
00061         if(m_dGammaSquared > 0.0)
00062         {
00063                 masterResidualsSize += 1;
00064         }
00065         Allocate(masterResidualsSize);
00066 
00067         cout << "Master Residuals size : " << masterResidualsSize << endl;
00068 
00069         // define the experiments
00070         DefineExperiments();
00071 
00072 }
00073 
00074 CMartielGoldbeterDictyNetworkMinimizableDirector::~CMartielGoldbeterDictyNetworkMinimizableDirector()
00075 {
00076         for(int i = 0; i < _plotterList.size(); i++)
00077         {
00078                 _minimizableList[i]->Detach(_plotterList[i]);
00079                 delete _plotterList[i];
00080         }
00081 }
00082 
00083 void CMartielGoldbeterDictyNetworkMinimizableDirector::DefineExperiments()
00084 {
00085 
00086 }
00087 
00088 double CMartielGoldbeterDictyNetworkMinimizableDirector::GetParameter(int parIndex)
00089 {
00090         // for this director, everyone has the same parameters so any set 
00091         // can be returned
00092         return _minimizableList[0]->GetParameter(parIndex);
00093 }
00094 
00095 int CMartielGoldbeterDictyNetworkMinimizableDirector::GetNParameters()
00096 {
00097         // ditto as for GetParameters()
00098         return _minimizableList[0]->GetNParameters();
00099 }
00100 

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