NTD-Modelling-Consortium / ntd-model-sch

NTD SCH model
MIT License
0 stars 6 forks source link

Seed used for amis integration #58

Closed thk123 closed 4 months ago

thk123 commented 5 months ago

Fixes NTD-Modelling-Consortium/endgame-project#18

This sets a seed provided by the AMIS algorithm before doing any stochastic parts of the simulation. This ensures the model will give consistent outputs given consistent inputs.

Both numpy.random and the python standard library random are used, therefore both seeds are required.

Currently there is no consistent entry point for the model, so the seed setting ends up going in the amis integration. Raised NTD-Modelling-Consortium/endgame-project#57 for fixing this.

Also using a legacy way of generating random numbers in numpy, raised NTD-Modelling-Consortium/endgame-project#56 to fix that in the future.

thk123 commented 5 months ago

@mattg3004 This is ready for review - I left it as a draft so we make sure we merge #44 first (see the link in the description to see what has changed in this PR)

tlestang commented 5 months ago

In case this is useful you could change the base of this PR to #44 by clicking on "edit" next to the PR name. This would give you the relevant diff automatically. Then once #44 is merged you can redirect the PR to master again.

thk123 commented 5 months ago

Annoyingly I have pushed these branches to my fork as I didn't have write access to this repo when I started - so if I do that then the PR disappears from this repo entirely 😅 but thanks for sharing.