Skip to content

Commit 607fa7f

Browse files
committed
compiling rebased project
1 parent 09b70c8 commit 607fa7f

File tree

4 files changed

+27
-23
lines changed

4 files changed

+27
-23
lines changed

bdm.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ additional_data_members = [
1111
]
1212

1313
[[visualize_agent]]
14-
name = "CartCell"
14+
name = "CarTCell"
1515
additional_data_members = ["diameter_","volume_"]
1616

1717
[[visualize_diffusion]]
1818
name = "oxygen"
19+
20+
[[visualize_diffusion]]
21+
name = "immunostimulatory_factor"

src/cart_cell.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ void CarTCell::ChangeVolumeExponentialRelaxationEquation(
142142
}
143143

144144
//compute Displacement
145-
Real3 CartCell::CalculateDisplacement(const InteractionForce* force, real_t squared_radius, real_t dt) {
145+
Real3 CarTCell::CalculateDisplacement(const InteractionForce* force, real_t squared_radius, real_t dt) {
146146

147147
auto* sim = Simulation::GetActive();
148148

149149
// real_t h = dt;
150150
Real3 movement_at_next_step{0, 0, 0};
151151
// this should be chaged in a future version of BioDynaMo in order to have a cleaner code instead of hardcoding it here
152-
squared_radius=kSquaredMaxDistanceNeighborsForce;
152+
squared_radius=gKSquaredMaxDistanceNeighborsForce;
153153

154154
// the physics force to move the point mass
155155

@@ -185,7 +185,7 @@ Real3 CartCell::CalculateDisplacement(const InteractionForce* force, real_t squa
185185
//--------------------------------------------
186186
//CAR-T killing or victim cell escaping
187187
//--------------------------------------------
188-
if (state_ == CartCellState::kAlive) {//If cell is not apoptotic
188+
if (state_ == CarTCellState::kAlive) {//If cell is not apoptotic
189189

190190
if (attached_to_tumor_cell_) {//attached to tumor cell
191191
// try to kill the cancer cell and in case of failure see if it manages to scape
@@ -252,7 +252,7 @@ Real3 CartCell::CalculateDisplacement(const InteractionForce* force, real_t squa
252252
}
253253

254254
// Try to get attached to a tumor cell
255-
void CartCell::TryToGetAttachedTo(TumorCell* victim, real_t squared_distance, Random* rng){
255+
void CarTCell::TryToGetAttachedTo(TumorCell* victim, real_t squared_distance, Random* rng){
256256
//If the tumor cell is not already attached to a CAR-T cell, is not dead and is not too far away.
257257
if(!victim->IsAttachedToCart()&& !victim->IsDead() && squared_distance < kSquaredMaxAdhesionDistanceCart) {
258258

@@ -293,7 +293,7 @@ void CartCell::TryToGetAttachedTo(TumorCell* victim, real_t squared_distance, Ra
293293
}
294294

295295
//Try to induce apoptosis
296-
bool CartCell::TryToInduceApoptosis(bdm::AgentPointer<TumorCell> attached_cell, Random* rng) {
296+
bool CarTCell::TryToInduceApoptosis(bdm::AgentPointer<TumorCell> attached_cell, Random* rng) {
297297
// If there is no attached cell (this should not happen)
298298

299299
if (!attached_to_tumor_cell_)

src/hyperparams.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ constexpr real_t kDnew = 1.5 * kDtMechanics;
205205
constexpr real_t kDold = -0.5 * kDtMechanics;
206206

207207
///Do not change this line
208-
const real_t kLengthBoxMechanics =22;
208+
const real_t gKLengthBoxMechanics =22;
209209

210210
/// Max Distance for considering two cells as neighbours for force calculations
211211
/// in μm Do not change this line
@@ -234,16 +234,16 @@ constexpr real_t kAverageMaximumTimeUntillApoptosisCart= kDtCycle* 10.0 * 24.0 *
234234
constexpr real_t kDefaultOxygenConsumptionCarT = 1.0;
235235
///Volume parameters
236236
/// Default total volume of a new CAR-T cell in μm³
237-
constexpr real_t kDefaultVolumeNewCartCell = 2494.0;
237+
constexpr real_t kDefaultVolumeNewCarTCell = 2494.0;
238238
/// Default volume of the nucleus of a new CAR-T cell in μm³
239-
constexpr real_t kDefaultVolumeNucleusCartCell = 540.0;
239+
constexpr real_t kDefaultVolumeNucleusCarTCell = 540.0;
240240
/// Default fraction of fluid volume in a new CAR-T cell
241-
constexpr real_t kDefaultFractionFluidCartCell = 0.75;
241+
constexpr real_t kDefaultFractionFluidCarTCell = 0.75;
242242

243243
/// How often a CAR-T cell tries to kill an attached cancer cell
244244
constexpr real_t kKillRateCart = 0.06667; // 1/min
245245
/// How often a CAR-T cell tries to attach to a cancer cell
246-
constexpr real_t kAdhesionRateCart = 0.013;//0.2;//0.0092//0.0085; // 1/min
246+
constexpr real_t kAdhesionRateCart = 0.013;// 1/min
247247
/// Maximum adhesion distance between CAR-T and tumor cells
248248
constexpr real_t kMaxAdhesionDistanceCart = 18.0;//micrometers
249249
/// Minimum adhesion distance between CAR-T and tumor cells
@@ -291,12 +291,12 @@ constexpr real_t kDifferenceCartAdhesionDistances = kMaxAdhesionDistanceCart - k
291291
const real_t kRadiusTumorCell = std::cbrt(kDefaultVolumeNewTumorCell * 3. / (4. * Math::kPi));
292292

293293
///Do not change this line: radius cart cell
294-
const real_t kRadiusCartCell = std::cbrt(kDefaultVolumeNewCartCell * 3. / (4. * Math::kPi));
294+
const real_t kRadiusCarTCell = std::cbrt(kDefaultVolumeNewCarTCell * 3. / (4. * Math::kPi));
295295

296296
//Do not change this line: maximum squared distance to avoid CAR-T pushing tumor cells
297297
//If a CAR-T and a Tumor Cell are closer than this distance, the CAR-T cell will only move to the tumor cell with the adhesion forces
298298
//(radiusCART + radiusTumorCell + 0.1 to avoid numerical errors)**2
299-
const real_t kMaxSquaredDistanceCartMovingTowardsTumorCell = std::pow(kRadiusCartCell + kRadiusTumorCell + 1, 2);
299+
const real_t kMaxSquaredDistanceCartMovingTowardsTumorCell = std::pow(kRadiusCarTCell + kRadiusTumorCell + 1, 2);
300300

301301

302302
} // namespace bdm

src/utils_aux.cc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "utils_aux.h"
2323
#include "hyperparams.h"
2424
#include "tumor_cell.h"
25+
#include "cart_cell.h"
2526
#include "core/agent/agent.h"
2627
#include "core/container/math_array.h"
2728
#include "core/real_t.h"
@@ -122,15 +123,15 @@ std::tuple<size_t, size_t, size_t, size_t, size_t, size_t, size_t, real_t, real_
122123

123124
// Count tumor cells by type and accumulate oncoprotein levels if the cell is alive
124125
switch (tumor_cell->GetType()) {
125-
case 1: acumulator_oncoprotein += tumor_cell->GetOncoproteinLevel(); num_tumor_cells_type1++; break;
126-
case 2: acumulator_oncoprotein += tumor_cell->GetOncoproteinLevel(); num_tumor_cells_type2++; break;
127-
case 3: acumulator_oncoprotein += tumor_cell->GetOncoproteinLevel(); num_tumor_cells_type3++; break;
128-
case 4: acumulator_oncoprotein += tumor_cell->GetOncoproteinLevel(); num_tumor_cells_type4++; break;
129-
case 5: num_tumor_cells_type5_dead++; break;
126+
case TumorCellType::kType1: acumulator_oncoprotein += tumor_cell->GetOncoproteinLevel(); num_tumor_cells_type1++; break;
127+
case TumorCellType::kType2: acumulator_oncoprotein += tumor_cell->GetOncoproteinLevel(); num_tumor_cells_type2++; break;
128+
case TumorCellType::kType3: acumulator_oncoprotein += tumor_cell->GetOncoproteinLevel(); num_tumor_cells_type3++; break;
129+
case TumorCellType::kType4: acumulator_oncoprotein += tumor_cell->GetOncoproteinLevel(); num_tumor_cells_type4++; break;
130+
case TumorCellType::kType5: num_tumor_cells_type5_dead++; break;
130131
default: break;
131132
}
132-
} else if (auto* cart_cell = dynamic_cast<const CartCell*>(agent)) {
133-
if (cart_cell->GetState() == CartCellState::kAlive)
133+
} else if (auto* cart_cell = dynamic_cast<const CarTCell*>(agent)) {
134+
if (cart_cell->GetState() == CarTCellState::kAlive)
134135
num_alive_cart++;
135136
}
136137
});
@@ -152,7 +153,7 @@ void OutputSummary::operator()() {
152153
std::ofstream file("output/final_data.csv", std::ios::app);
153154
if (file.is_open()) {
154155
if (current_step == 0) {
155-
file << "total_days,total_hours,total_minutes,tumor_radius,num_cells,num_tumor_cells,tumor_cells_type1,tumor_cells_type2,tumor_cells_type3,tumor_cells_type4,tumor_cells_type5_dead,num_alive_cart, average_oncoprotein, average_oxygen_cancer_cells\n";// Header for CSV file
156+
file << "total_days,total_hours,total_minutes,tumor_radius,num_cells,num_tumor_cells,tumor_cells_type1,tumor_cells_type2,tumor_cells_type3,tumor_cells_type4,tumor_cells_type5_dead,num_alive_cart,average_oncoprotein,average_oxygen_cancer_cells\n";// Header for CSV file
156157
}
157158

158159
// Calculate time in days, hours, minutes
@@ -241,7 +242,7 @@ void SpawnCart::operator()() {
241242
real_t px,py,pz,radi_sq;
242243

243244
auto* ctxt = simulation->GetExecutionContext();
244-
CartCell* cart = nullptr;
245+
CarTCell* cart = nullptr;
245246

246247
for( unsigned int i=0 ;i < cells_to_spawn ; i++ ){
247248
//look for a valid position
@@ -252,7 +253,7 @@ void SpawnCart::operator()() {
252253
radi_sq = px*px + py*py + pz*pz;
253254
}while(minimum_squared_radius > radi_sq);
254255
//spawn CAR-T
255-
cart = new CartCell({px,py,pz});
256+
cart = new CarTCell({px,py,pz});
256257
cart->AddBehavior(new StateControlCart());
257258
ctxt->AddAgent(cart);
258259
}

0 commit comments

Comments
 (0)