Skip to content

Commit

Permalink
bug fix and update
Browse files Browse the repository at this point in the history
  • Loading branch information
DeshanPerera committed Sep 18, 2024
1 parent 514ca7f commit 8036c9b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cancer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ void cancer::ingress()
tissues_ATGC_positions_Mutation_rate_factor,
tissues_ATGC_positions_Generation_death,
tissues_ATGC_positions_Replication_prob,
tissues_ATGC_positions_Metastatic);
tissues_ATGC_positions_Metastatic,
profile_tissue_Limits);

if (stop == 1)
{
Expand Down
18 changes: 15 additions & 3 deletions cancer_Host.cu
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ void cancer_Host::simulate_Generations(functions_library &functions,
float **tissues_ATGC_positions_Mutation_rate_factor,
float **tissues_ATGC_positions_Generation_death,
float **tissues_ATGC_positions_Replication_prob,
float **tissues_ATGC_positions_Metastatic)
float **tissues_ATGC_positions_Metastatic,
int *profile_tissue_Limits)
{
cout << "\nSTEP 6: Conducting simulation\n";

Expand Down Expand Up @@ -282,6 +283,12 @@ void cancer_Host::simulate_Generations(functions_library &functions,
}
}

if (profile_tissue_Limits[tissue] != -1 && parent_population_Count > profile_tissue_Limits[tissue])
{
cout << "\nMax cell count in tissue reached\n";
parent_population_Count = profile_tissue_Limits[tissue];
}

check_to_Remove.clear();
removed_by_Transfer_Indexes[tissue].clear();
dead_Particle_count[tissue] = 0;
Expand Down Expand Up @@ -727,10 +734,15 @@ void cancer_Host::calculate_Tajima(functions_library &functions,

for (double n = 1; n < N; n++)
{
a_1 = a_1 + ((double)1.0 / n);
a_2 = a_2 + ((double)1.0 / (n * n));
a_1 = a_1 + (1.0 / n);
a_2 = a_2 + (1.0 / (n * n));
}
cout << "a1: " << a_1 << endl;
if (isinf(a_2))
{
// pi_squared /6
a_2 = 1.64493128;
}
cout << "a2: " << a_2 << endl;

b1 = (N_float + 1.0) / (3.0 * (N_float - 1.0));
Expand Down
3 changes: 2 additions & 1 deletion cancer_Host.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ public:
float **tissues_ATGC_positions_Generation_death,
float **tissues_ATGC_positions_Replication_prob,
float **tissues_ATGC_positions_Metastatic,
string &viral_Migration);
string &viral_Migration,
int *profile_tissue_Limits);

// void replication_Generation_thread(int gpu, cudaStream_t *streams,
// char *cuda_full_Char, char *full_Char,
Expand Down

0 comments on commit 8036c9b

Please sign in to comment.