From 3a28d0595dbe963b562f63554ae61f9a757d61e7 Mon Sep 17 00:00:00 2001 From: jpmetzca Date: Tue, 4 Jun 2024 11:24:28 -0400 Subject: [PATCH] updated code to use the PhysiCell random number generator ONLY. previously, some functions used BioFVM random number generator. Hopefully I got them all. Also updated the gitignore. --- .gitignore | 66 ++++++++++++++++++++ config/leader_follower_model.xml | 1 + custom_modules/AMIGOS-invasion_uncoupled.cpp | 2 +- custom_modules/fibrosis.cpp | 2 +- main-ecm.cpp | 6 +- 5 files changed, 72 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 079ae21..19e4162 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,72 @@ out*.txt final*.txt initial*.txt +output/*.xml +output/*.csv +output/*.html +output/*.txt +!output/empty.txt +output/detailed_rules.html +output/detailed_rules.txt +output/dictionaries.txt +output/rules.html +output/rules.txt + +fibrosis_test/*.xml +fibrosis_test/*.csv +fibrosis_test/*.html +fibrosis_test/*.txt +!fibrosis_test/empty.txt +fibrosis_test/detailed_rules.html +fibrosis_test/detailed_rules.txt +fibrosis_test/dictionaries.txt +fibrosis_test/rules.html +fibrosis_test/rules.txt +fibrosis_test/*.py +fibrosis + +invasive_carcinoma_output/*.xml +invasive_carcinoma_output/*.csv +invasive_carcinoma_output/*.html +invasive_carcinoma_output/*.txt +!invasive_carcinoma_output/empty.txt +invasive_carcinoma_output/detailed_rules.html +invasive_carcinoma_output/detailed_rules.txt +invasive_carcinoma_output/dictionaries.txt +invasive_carcinoma_output/rules.html +invasive_carcinoma_output/rules.txt +invasive_carcinoma/*.py +invasive_carcinoma + +leader_follower/*.xml +leader_follower/*.csv +leader_follower/*.html +leader_follower/*.txt +!leader_follower/empty.txt +leader_follower/detailed_rules.html +leader_follower/detailed_rules.txt +leader_follower/dictionaries.txt +leader_follower/rules.html +leader_follower/rules.txt +leader_follower/*.py + +simple_test0/ +simple_test1/ +simple_test2/PhysiCell_settings.xml +simple_test2/cell_rules.csv +simple_test2/detailed_rules.html +simple_test2/detailed_rules.txt +simple_test2/dictionaries.txt +simple_test2/rules.html +simple_test2/rules.txt +simple_test2/simple_test2_random_1_D_circles.xml +simple_test2/simple_test_movies_cells_only.py +simple_test2/simple_test_stills_cells_and_environment_only.py +simple_test3/ +simple_test4/ + +stochastic_replicates/ + # Development *.xcworkspace .vscode* diff --git a/config/leader_follower_model.xml b/config/leader_follower_model.xml index 61723de..0451a63 100644 --- a/config/leader_follower_model.xml +++ b/config/leader_follower_model.xml @@ -415,5 +415,6 @@ 0 none true + 0 \ No newline at end of file diff --git a/custom_modules/AMIGOS-invasion_uncoupled.cpp b/custom_modules/AMIGOS-invasion_uncoupled.cpp index 42d7d82..b43b905 100755 --- a/custom_modules/AMIGOS-invasion_uncoupled.cpp +++ b/custom_modules/AMIGOS-invasion_uncoupled.cpp @@ -305,7 +305,7 @@ void setup_extracellular_matrix( void ) // For random 2-D initalization if(parameters.strings( "ECM_orientation_setup") == "random") { - double theta = 6.2831853071795864769252867665590 * uniform_random(); + double theta = 6.2831853071795864769252867665590 * UniformRandom(); ecm.ecm_voxels[n].ecm_fiber_alignment = {cos(theta), sin(theta), 0.0}; } // for starburst initialization diff --git a/custom_modules/fibrosis.cpp b/custom_modules/fibrosis.cpp index 3068688..80eb7a8 100755 --- a/custom_modules/fibrosis.cpp +++ b/custom_modules/fibrosis.cpp @@ -405,7 +405,7 @@ void alter_cell_uptake_secretion_saturation ( void ) void setup_tissue( void ) { // Setting seed so cells always start with same initial configuration - SeedRandom(0); + SeedRandom(parameters.ints("random_seed")); static Cell_Definition* fibroblast = find_cell_definition("fibroblast"); static Cell_Definition* dead_cell = find_cell_definition("dead cell"); static Cell_Definition* macrophage = find_cell_definition("macrophage"); diff --git a/main-ecm.cpp b/main-ecm.cpp index a02491e..e39eac3 100644 --- a/main-ecm.cpp +++ b/main-ecm.cpp @@ -153,9 +153,9 @@ int main( int argc, char* argv[] ) omp_set_num_threads(PhysiCell_settings.omp_num_threads); // PNRG setup - SeedRandom(0); //rwh do here, just once - // if( parameters.ints("unit_test_setup") == 1) - // {SeedRandom(0);} + SeedRandom(parameters.ints("random_seed")); //rwh do here, just once + if( parameters.ints("unit_test_setup") == 1) + {SeedRandom(0);} // time setup