Skip to content

Commit

Permalink
Merge pull request #277 from elmbeech/patch_reset_cellid
Browse files Browse the repository at this point in the history
add reset function for Cell ID.
  • Loading branch information
MathCancer authored Sep 25, 2024
2 parents 63cfd24 + 87a0d5e commit 80016c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions BioFVM/BioFVM_basic_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,16 @@ namespace BioFVM{

std::vector<Basic_Agent*> all_basic_agents(0);

static int max_basic_agent_ID = 0;

void reset_max_basic_agent_ID( void )
{
max_basic_agent_ID = 0;
}

Basic_Agent::Basic_Agent()
{
//give the agent a unique ID
static int max_basic_agent_ID = 0;
ID = max_basic_agent_ID; //
max_basic_agent_ID++;
// initialize position and velocity
Expand Down Expand Up @@ -341,4 +347,4 @@ void Basic_Agent::simulate_secretion_and_uptake( Microenvironment* pS, double dt
return;
}

};
};
4 changes: 3 additions & 1 deletion BioFVM/BioFVM_basic_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
#include "BioFVM_vector.h"

namespace BioFVM{


void reset_max_basic_agent_ID( void );

class Basic_Agent
{
private:
Expand Down

0 comments on commit 80016c1

Please sign in to comment.