Skip to content

Commit

Permalink
updated code to use the PhysiCell random number generator ONLY. previ…
Browse files Browse the repository at this point in the history
…ously, some functions used BioFVM random number generator. Hopefully I got them all. Also updated the gitignore.
  • Loading branch information
johnmetzcar committed Jun 4, 2024
1 parent 9e546ae commit 3a28d05
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 5 deletions.
66 changes: 66 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down
1 change: 1 addition & 0 deletions config/leader_follower_model.xml
Original file line number Diff line number Diff line change
Expand Up @@ -415,5 +415,6 @@
<march_unit_test_setup type="int" units="" description="Testing set up: 1 for cell march, 0 for typical simulation">0</march_unit_test_setup>
<visual_guideline_pattern type="string" units="" description="Specifies pattern of line overlay: none, horizontal lines, vertical lines, or concentric circles">none</visual_guideline_pattern>
<enable_ecm_outputs type="bool" units="" description="">true</enable_ecm_outputs>
<random_seed type="int" units="" description="">0</random_seed>
</user_parameters>
</PhysiCell_settings>
2 changes: 1 addition & 1 deletion custom_modules/AMIGOS-invasion_uncoupled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion custom_modules/fibrosis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions main-ecm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a28d05

Please sign in to comment.