IngeWntSwatCellCycleModel.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2009
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
00026 
00027 */
00028 #ifndef INGEWNTSWATCELLCYCLEMODEL_HPP_
00029 #define INGEWNTSWATCELLCYCLEMODEL_HPP_
00030 
00031 #include <boost/serialization/access.hpp>
00032 #include <boost/serialization/base_object.hpp>
00033 
00034 #include <cfloat>
00035 
00036 #include "AbstractOdeSystem.hpp"
00037 #include "AbstractWntOdeBasedCellCycleModel.hpp"
00038 #include "IngeWntSwatCellCycleOdeSystem.hpp"
00039 #include "CellMutationStates.hpp"
00040 #include "Exception.hpp"
00041 
00042 
00043 // Needs to be included last
00044 #include <boost/serialization/export.hpp>
00045 
00052 class IngeWntSwatCellCycleModel : public AbstractWntOdeBasedCellCycleModel
00053 {
00054 private:
00055 
00057     friend class boost::serialization::access;
00064     template<class Archive>
00065     void serialize(Archive & archive, const unsigned int version)
00066     {
00067         assert(mpOdeSystem!=NULL);
00068         archive & boost::serialization::base_object<AbstractWntOdeBasedCellCycleModel>(*this);
00069         // Reference can be read or written into once mpOdeSystem has been set up
00070         // mpOdeSystem isn't set up by the first constructor, but is by the second
00071         // which is now utilised by the load_construct at the bottom of this file.
00072         archive & static_cast<IngeWntSwatCellCycleOdeSystem*>(mpOdeSystem)->rGetMutationState();
00073     }
00074 
00083     void ChangeCellTypeDueToCurrentBetaCateninLevel();
00084 
00089     unsigned mHypothesis;
00090 
00091 public:
00092 
00099     IngeWntSwatCellCycleModel(unsigned hypothesis)
00100        : mHypothesis(hypothesis)
00101     {
00102         if ( !(mHypothesis==1u || mHypothesis==2u) )
00103         {
00104             EXCEPTION("Model must be set up with argument(hypothesis) = 1u or 2u");
00105         }
00106     };
00107 
00121     IngeWntSwatCellCycleModel(const unsigned& rHypothesis,
00122                               AbstractOdeSystem* pParentOdeSystem,
00123                               const CellMutationState& rMutationState,
00124                               double birthTime,
00125                               double lastTime,
00126                               bool inSG2MPhase,
00127                               bool readyToDivide,
00128                               double divideTime);
00129 
00137     IngeWntSwatCellCycleModel(const unsigned& rHypothesis,
00138                               const std::vector<double>& rParentProteinConcentrations,
00139                               const CellMutationState& rMutationState);
00140 
00146     AbstractCellCycleModel* CreateDaughterCellCycleModel();
00147 
00153     void Initialise();
00154 
00161     bool SolveOdeToTime(double currentTime);
00162 
00166     double GetMembraneBoundBetaCateninLevel();
00167 
00171     double GetCytoplasmicBetaCateninLevel();
00172 
00176     double GetNuclearBetaCateninLevel();
00177 
00181     unsigned GetHypothesis() const; // this function promises not to change the object
00182 
00183 };
00184 
00185 // Declare identifier for the serializer
00186 BOOST_CLASS_EXPORT(IngeWntSwatCellCycleModel)
00187 
00188 
00189 namespace boost
00190 {
00191 namespace serialization
00192 {
00197 template<class Archive>
00198 inline void save_construct_data(
00199     Archive & ar, const IngeWntSwatCellCycleModel * t, const unsigned int file_version)
00200 {
00201     const unsigned hypothesis = t->GetHypothesis();
00202     ar & hypothesis;
00203 }
00204 
00209 template<class Archive>
00210 inline void load_construct_data(
00211     Archive & ar, IngeWntSwatCellCycleModel * t, const unsigned int file_version)
00212 {
00220     std::vector<double> state_vars;
00221     for (unsigned i=0; i<22; i++)
00222     {
00223         state_vars.push_back(0.0);
00224     }
00225 
00226     CellMutationState mutation_state = HEALTHY;
00227 
00228     unsigned hypothesis;
00229     ar & hypothesis;
00230 
00231     ::new(t)IngeWntSwatCellCycleModel(hypothesis, state_vars, mutation_state);
00232 }
00233 }
00234 } // namespace ...
00235 
00236 #endif /*INGEWNTSWATCELLCYCLEMODEL_HPP_*/
00237 

Generated on Wed Mar 18 12:51:50 2009 for Chaste by  doxygen 1.5.5