Population_Study/Run_Simulations.sh
2025-12-11 17:31:11 -07:00

49 lines
1.9 KiB
Bash

#Run all simulations as needed. Comment out to skip any. All but the primary results have 10^5 simulations
echo "Starting all model Simulations. This will take a while!!"
#start_time=$(date +%s)
#Rscript 1A_Run_Full_Simulation_2016.r
#echo "Pre-2016 data simulations for benchmark complete! 100k simulations total"
# Your command or script here
#end_time=$(date +%s)
#elapsed_seconds=$((end_time - start_time))
#hours=$((elapsed_seconds / 3600))
#minutes=$(( (elapsed_seconds % 3600) / 60 ))
#seconds=$(( elapsed_seconds % 60 ))
#printf "Execution time: %02d hours, %02d minutes, %02d seconds\n" "$hours" "$minutes" "$seconds"
start_time=$(date +%s)
Rscript 1C_Run_Simulation_Upper_Bound.r
echo "Upper bound migration with county average migration rates complete! 100k simulations total"
end_time=$(date +%s)
elapsed_seconds=$((end_time - start_time))
hours=$((elapsed_seconds / 3600))
minutes=$(( (elapsed_seconds % 3600) / 60 ))
seconds=$(( elapsed_seconds % 60 ))
printf "Execution time: %02d hours, %02d minutes, %02d seconds\n" "$hours" "$minutes" "$seconds"
start_time=$(date +%s)
Rscript 1D_Run_Simulation_Lower_Bound.r
echo "Lower bound migration with Kemmerere average migration rates complete! 100k simulations total"
end_time=$(date +%s)
elapsed_seconds=$((end_time - start_time))
hours=$((elapsed_seconds / 3600))
minutes=$(( (elapsed_seconds % 3600) / 60 ))
seconds=$(( elapsed_seconds % 60 ))
printf "Execution time: %02d hours, %02d minutes, %02d seconds\n" "$hours" "$minutes" "$seconds"
start_time=$(date +%s)
Rscript 1B_Run_Full_Simulation.r
echo "Main results with variable migration rates complete! 1 million simulations total"
end_time=$(date +%s)
elapsed_seconds=$((end_time - start_time))
hours=$((elapsed_seconds / 3600))
minutes=$(( (elapsed_seconds % 3600) / 60 ))
seconds=$(( elapsed_seconds % 60 ))
printf "Execution time: %02d hours, %02d minutes, %02d seconds\n" "$hours" "$minutes" "$seconds"