-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshedding.h
More file actions
60 lines (48 loc) · 1.65 KB
/
shedding.h
File metadata and controls
60 lines (48 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef SHEDDING_H_
#define SHEDDING_H_
#include "tissue/keratinocyte.h"
#include "infra/sim_param.h"
namespace bdm {
namespace skibidy {
// ---------------------------------------------------------------------------
// Behavior: desquamation of cornified cells after residence time, and
// apoptosis of exhausted TA cells that remain in the basal layer.
// ---------------------------------------------------------------------------
struct Shedding : public Behavior {
BDM_BEHAVIOR_HEADER(Shedding, Behavior, 1);
Shedding() { AlwaysCopyToNew(); }
virtual ~Shedding() {}
void Run(Agent* agent) override {
auto* cell = dynamic_cast<Keratinocyte*>(agent);
if (!cell) return;
auto* sim = Simulation::GetActive();
auto* sp = sim->GetParam()->Get<SimParam>();
// Tissue boundary: remove cells pushed past lateral (x/y) edges
auto pos = cell->GetPosition();
if (pos[0] < sp->tissue_min || pos[0] > sp->tissue_max ||
pos[1] < sp->tissue_min || pos[1] > sp->tissue_max) {
cell->RemoveFromSimulation();
return;
}
if (cell->GetStratum() == kCornified) {
steps_cornified_++;
if (steps_cornified_ > sp->shedding_delay) {
cell->RemoveFromSimulation();
return;
}
} else {
steps_cornified_ = 0;
}
// Apoptosis: exhausted TA cells lingering in basal layer are cleared
if (cell->GetStratum() == kBasal && !cell->IsStem() &&
cell->GetDivisionsLeft() <= 0 &&
cell->GetStratumSteps() > sp->apoptosis_delay) {
cell->RemoveFromSimulation();
}
}
private:
int steps_cornified_ = 0;
};
} // namespace skibidy
} // namespace bdm
#endif // SHEDDING_H_