VPTissue Reference Manual
cell_split/WrapperModel.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2016 Universiteit Antwerpen
3  *
4  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
5  * the European Commission - subsequent versions of the EUPL (the "Licence");
6  * You may not use this work except in compliance with the Licence.
7  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the Licence is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the Licence for the specific language governing
13  * permissions and limitations under the Licence.
14  */
20 #include "WrapperModel.h"
21 
22 #include "bio/Cell.h"
23 #include "math/RandomEngine.h"
24 #include "sim/CoreData.h"
25 
26 #include <boost/property_tree/ptree.hpp>
27 #include <trng/uniform01_dist.hpp>
28 #include <array>
29 
30 namespace SimPT_Default {
31 namespace CellSplit {
32 
33 using namespace std;
34 using namespace boost::property_tree;
35 
37 {
38  Initialize(cd);
39 }
40 
42 {
43  const trng::uniform01_dist<double> dist;
44  m_uniform_generator = cd.m_random_engine->GetGenerator(dist);
45 
46  const auto& p = cd.m_parameters;
47  m_cell_division_threshold = p->get<double>("wrapper_model.cell_division_threshold");
48 }
49 
50 std::tuple<bool, bool, std::array<double, 3>> WrapperModel::operator()(Cell* cell)
51 {
52  bool must_divide = false;
53  double CCnoise2 = 1 /*+ m_cell_division_noise * (m_uniform_generator() - 0.5)*/;
54  if(/*(cell->GetChemical(9) / cell->GetArea()) > m_CDK_threshold ) &&*/ cell->GetArea() >= ( m_cell_division_threshold * CCnoise2 )) {
55  must_divide = true;
56  }
57 
58  return std::make_tuple(must_divide, true, array<double, 3> {{1.0, 0.0, 0.0}});
59 }
60 
61 } // namespace
62 } // namespace
Core data with mesh, parameters, random engine and time data.
Definition: CoreData.h:38
CellSplit for Wrapper model.
STL namespace.
A cell contains walls and nodes.
Definition: Cell.h:48
Core data used during model execution.
Interface of RandomEngine.
Namespace for components of the Default model group.
Interface for Cell.
void Initialize(const CoreData &cd)
Initialize or re-initialize.
WrapperModel(const CoreData &cd)
Initializing constructor.
std::tuple< bool, bool, std::array< double, 3 > > operator()(Cell *cell)
Execute.
double GetArea() const
Return the area of the cell.
Definition: Cell.cpp:178