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 
00100     IngeWntSwatCellCycleModel(unsigned hypothesis, unsigned dimension);
00101 
00109     IngeWntSwatCellCycleModel(const IngeWntSwatCellCycleModel& rOtherModel);
00110 
00111 
00120     IngeWntSwatCellCycleModel(const unsigned& rHypothesis,
00121                               const std::vector<double>& rParentProteinConcentrations,
00122                               const CellMutationState& rMutationState,
00123                               const unsigned& rDimension);
00124 
00129     AbstractCellCycleModel* CreateCellCycleModel();
00130 
00136     void Initialise();
00137 
00144     bool SolveOdeToTime(double currentTime);
00145 
00149     double GetMembraneBoundBetaCateninLevel();
00150 
00154     double GetCytoplasmicBetaCateninLevel();
00155 
00159     double GetNuclearBetaCateninLevel();
00160 
00164     unsigned GetHypothesis() const; // this function promises not to change the object
00165 
00166 };
00167 
00168 // Declare identifier for the serializer
00169 BOOST_CLASS_EXPORT(IngeWntSwatCellCycleModel)
00170 
00171 
00172 namespace boost
00173 {
00174 namespace serialization
00175 {
00180 template<class Archive>
00181 inline void save_construct_data(
00182     Archive & ar, const IngeWntSwatCellCycleModel * t, const unsigned int file_version)
00183 {
00184     const unsigned hypothesis = t->GetHypothesis();
00185     ar & hypothesis;
00186 }
00187 
00192 template<class Archive>
00193 inline void load_construct_data(
00194     Archive & ar, IngeWntSwatCellCycleModel * t, const unsigned int file_version)
00195 {
00203     std::vector<double> state_vars;
00204     for (unsigned i=0; i<22; i++)
00205     {
00206         state_vars.push_back(0.0);
00207     }
00208 
00209     CellMutationState mutation_state = HEALTHY;
00210     unsigned dimension = UINT_MAX;
00211 
00212     unsigned hypothesis;
00213     ar & hypothesis;
00214 
00215     ::new(t)IngeWntSwatCellCycleModel(hypothesis, state_vars, mutation_state, dimension);
00216 }
00217 }
00218 } // namespace ...
00219 
00220 #endif /*INGEWNTSWATCELLCYCLEMODEL_HPP_*/
00221 

Generated on Tue Aug 4 16:10:21 2009 for Chaste by  doxygen 1.5.5