Skip to content

Commit

Permalink
more on conservation during phagocytosis
Browse files Browse the repository at this point in the history
In response to Issue MathCancer#307, cells by default ingest 100% of internalized substrates when eating another cell.

(Note that the values for std::vector<bool> fraction_tranferred_when_ingested in Basic_Agent is *overwritten* by constructors in the cell Phenotype, so we have ot do it there.)
  • Loading branch information
MathCancer committed Oct 14, 2024
1 parent bf15329 commit a3fde73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion core/PhysiCell_cell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1399,9 +1399,10 @@ void Cell::ingest_cell( Cell* pCell_to_eat )
// absorb the internalized substrates

// multiply by the fraction that is supposed to be ingested (for each substrate)

*(pCell_to_eat->internalized_substrates) *=
*(pCell_to_eat->fraction_transferred_when_ingested); //

*internalized_substrates += *(pCell_to_eat->internalized_substrates);
static int n_substrates = internalized_substrates->size();
pCell_to_eat->internalized_substrates->assign( n_substrates , 0.0 );
Expand All @@ -1410,6 +1411,7 @@ void Cell::ingest_cell( Cell* pCell_to_eat )
// so that each daughter cell gets half of the original ;
for( int nn = 0 ; nn < custom_data.variables.size() ; nn++ )
{
custom_data.variables[nn].conserved_quantity = true;
if( custom_data.variables[nn].conserved_quantity == true )
{
custom_data.variables[nn].value +=
Expand Down
4 changes: 2 additions & 2 deletions core/PhysiCell_phenotype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ void Molecular::sync_to_current_microenvironment( void )
{
internalized_total_substrates.resize( 0 , 0.0 );
fraction_released_at_death.resize( 0 , 0.0 );
fraction_transferred_when_ingested.resize( 0, 0.0 );
fraction_transferred_when_ingested.resize( 0, 1.0 );
}
return;
}
Expand All @@ -1062,7 +1062,7 @@ void Molecular::sync_to_microenvironment( Microenvironment* pNew_Microenvironmen

internalized_total_substrates.resize( number_of_densities , 0.0 );
fraction_released_at_death.resize( number_of_densities , 0.0 );
fraction_transferred_when_ingested.resize( number_of_densities , 0.0 );
fraction_transferred_when_ingested.resize( number_of_densities , 1.0 );

return;
}
Expand Down

0 comments on commit a3fde73

Please sign in to comment.