WntCellCycleModel.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2010
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 WNTCELLCYCLEMODEL_HPP_
00029 #define WNTCELLCYCLEMODEL_HPP_
00030 
00031 #include "ChasteSerialization.hpp"
00032 #include <boost/serialization/base_object.hpp>
00033 #include <boost/serialization/split_member.hpp>
00034 #include <boost/serialization/shared_ptr.hpp>
00035 
00036 #include <cfloat>
00037 
00038 #include "AbstractWntOdeBasedCellCycleModel.hpp"
00039 #include "WntCellCycleOdeSystem.hpp"
00040 #include "AbstractCellMutationState.hpp"
00041 
00042 
00055 class WntCellCycleModel : public AbstractWntOdeBasedCellCycleModel
00056 {
00057 private:
00058     friend class boost::serialization::access;
00065     template<class Archive>
00066     void save(Archive & archive, const unsigned int version) const
00067     {
00068         assert(mpOdeSystem);
00069         archive & boost::serialization::base_object<AbstractWntOdeBasedCellCycleModel>(*this);
00070         boost::shared_ptr<AbstractCellMutationState> p_mutation_state = static_cast<WntCellCycleOdeSystem*>(mpOdeSystem)->GetMutationState();
00071         archive & p_mutation_state;
00072     }
00079     template<class Archive>
00080     void load(Archive & archive, const unsigned int version)
00081     {
00082         // The ODE system is set up by the archiving constructor, so we can set the mutation state
00083         // here.  This is a horrible hack, but avoids having to regenerate test archives...
00084         assert(mpOdeSystem);
00085         archive & boost::serialization::base_object<AbstractWntOdeBasedCellCycleModel>(*this);
00086         boost::shared_ptr<AbstractCellMutationState> p_mutation_state;
00087         archive & p_mutation_state;
00088         static_cast<WntCellCycleOdeSystem*>(mpOdeSystem)->SetMutationState(p_mutation_state);
00089     }
00090     BOOST_SERIALIZATION_SPLIT_MEMBER()
00091 
00092     
00100     void ChangeCellProliferativeTypeDueToCurrentBetaCateninLevel();
00101 
00102 public:
00103 
00107     WntCellCycleModel();
00108 
00116     WntCellCycleModel(const WntCellCycleModel& rOtherModel);
00117 
00131     WntCellCycleModel(AbstractOdeSystem* pParentOdeSystem,
00132                       boost::shared_ptr<AbstractCellMutationState> pMutationState,
00133                       double birthTime,
00134                       double lastTime,
00135                       bool inSG2MPhase,
00136                       bool readyToDivide,
00137                       double divideTime,
00138                       unsigned dimension);
00139 
00147     WntCellCycleModel(const std::vector<double>& rParentProteinConcentrations,
00148                       boost::shared_ptr<AbstractCellMutationState> pMutationState,
00149                       const unsigned& rDimension);
00150 
00155     AbstractCellCycleModel* CreateCellCycleModel();
00156 
00164     void Initialise();
00165 
00172     bool SolveOdeToTime(double currentTime);
00173 };
00174 
00175 
00176 #include "SerializationExportWrapper.hpp"
00177 // Declare identifier for the serializer
00178 CHASTE_CLASS_EXPORT(WntCellCycleModel)
00179 
00180 namespace boost
00181 {
00182 namespace serialization
00183 {
00188 template<class Archive>
00189 inline void save_construct_data(
00190     Archive & ar, const WntCellCycleModel * t, const unsigned int file_version)
00191 {
00192 }
00193 
00198 template<class Archive>
00199 inline void load_construct_data(
00200     Archive & ar, WntCellCycleModel * t, const unsigned int file_version)
00201 {
00209     std::vector<double> state_vars;
00210     for (unsigned i=0; i<9; i++)
00211     {
00212         state_vars.push_back(0.0);
00213     }
00214 
00215     boost::shared_ptr<AbstractCellMutationState> p_mutation_state;
00216     unsigned dimension = 1;
00217     ::new(t)WntCellCycleModel(state_vars, p_mutation_state, dimension);
00218 }
00219 }
00220 } // namespace
00221 
00222 #endif /*WNTCELLCYCLEMODEL_HPP_*/

Generated by  doxygen 1.6.2