Skip to content

Commit edc54fd

Browse files
committed
async default for sweep script
1 parent 65ec59e commit edc54fd

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ results/
88
# Jupyter Notebook checkpoints
99
.ipynb_checkpoints/
1010
# Data files
11-
data/
11+
data/
12+
.pytest_cache/

docs/kimon_prompts.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
1. Create a comprehensive testing suite for the CA and PP classes. Test initialization, async update changes, synchronous update changes, prey growth in isolation behavior, predator starvation, parameter evolution and long run dynamics. Also make sur ethe test_viz mehtod works as desired
2222

23+
---
24+
2325
### Parameter Sweep and PP Class Analysis
2426

2527
2. Create a skeletal version of a .py script that will be subimtted into Snellius for parameter analysis. The purpose of this script should be to identify power law distribution with the consideration of finite size scaling, the hydra effect, and suitable parameter configurtaions for time series analysis for model evolution. Compare the non-evo to the evo model.
@@ -31,3 +33,5 @@
3133

3234
5. Create a minimal bash script for Snellius. Use the rome configiuration.
3335

36+
6. Fix predator-prey analysis script so that the hydra effect focuses on the prey hydra effect as a result of the increasing prey death rate.
37+

models/mean_field.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,6 @@ def sweep_death_rate(
182182
"net_growth": self.birth - d_r_values,
183183
}
184184

185-
186-
# FIXME: Add plotting utilities
187-
188-
189185
if __name__ == "__main__":
190186
print("Mean-Field Model Module")
191187
mf = MeanFieldModel()

pp_analysis.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ class Config:
110110
# Parallel settings
111111
n_jobs: int = -1 # -1 = all available cores
112112

113-
synchronous: bool = True # Use synchronous/async updates
113+
# Update mode (False = asynchronous/random-sequential, matches Gillespie)
114+
synchronous: bool = False
114115

115116
def get_prey_births(self) -> np.ndarray:
116117
return np.linspace(self.prey_birth_min, self.prey_birth_max, self.n_prey_birth)
@@ -921,10 +922,10 @@ def main():
921922
)
922923

923924
parser.add_argument(
924-
"--async",
925-
action="store_false",
925+
"--sync",
926+
action="store_true",
926927
dest="synchronous",
927-
help="Run simulation in asynchronous (random-sequential) mode"
928+
help="Run simulation in synchronous mode (default is asynchronous)"
928929
)
929930

930931
args = parser.parse_args()
@@ -957,7 +958,7 @@ def main():
957958
logger.info(f"Mode: {args.mode}")
958959
logger.info(f"Output: {output_dir}")
959960
logger.info(f"Cores: {cfg.n_jobs}")
960-
logger.info(f"Update mode: {'synchronous' if cfg.synchronous else 'asynchronous'}")
961+
logger.info(f"Update rule: {'synchronous' if cfg.synchronous else 'asynchronous (random-sequential)'}")
961962
logger.info(f"Fixed predator_death: {cfg.predator_death}")
962963
logger.info(f"Evolving: prey_death (SD={cfg.evolve_sd}, bounds=[{cfg.evolve_min}, {cfg.evolve_max}])")
963964

0 commit comments

Comments
 (0)