KappaTools
KappaTools copied to clipboard
Inputs file, $STOP, snapshotfile, reproducibility issue
Toy model:
%agent: Agent(site) %init: 100 Agent()
Agent(site[./1]), Agent(site[./1]) @ 1
Agent(site[1/.]), Agent(site[1/.]) @ 1
%mod: ([T] > 10) do $STOP "snap_final.ka"; repeat [false]
Run with
KaSim -i model.ka
Produces a file, inputs.ka, along with snap_final.ka. Then:
KaSim -i inputs.ka
"reproduction" run did not produce a snapshot.
The inputs file contains two $STOP commands, one in [T], the other in [E]. As is, it seems the latter is evaluated first and the former is ignored, yielding the problem. Moreover, if the user were to remove the seed specification line (e.g. to produce replicates), this yields a race condition, where the snapshot may be produced if [T] advanced faster than [E] based on the RNG.
Desired behavior: the inputs file reproduces the behavior of the original run, including all snapshot generation points.