MRC-CSO-SPHSU / LoneParentsModel.jl

An initial implementation of an ABM for social and child care
0 stars 4 forks source link

Parameters #121

Closed mhinsch closed 1 year ago

mhinsch commented 1 year ago

This implements setting parameters from the command line as well as reading and writing to YAML files. I've also done a bit of refactoring where required or convenient. Only marginally tested, so quite possibly buggy.

Solves issue #96.

mhinsch commented 1 year ago
mhinsch commented 1 year ago

This branch doesn't run, BTW, so please don't merge.

mhinsch commented 1 year ago
  • If seeding is done externally, e.g. in main(), then it is a matter of the client whether to view seed=0 to be time dependent or not

I don't understand what you mean.

* Model parameters can sometimes follow a stochastic distribution (may be not really needed at the current stage)

Yes, but I think in this case either the parameters need to be set by the program running the simulation (i.e. externally) or the parameters of the distribution (e.g. mean, variance, etc.) become the actual parameters and the values drawn from the distribution become part of the model.

BTW, you edited my comment instead of quote replying.

mhinsch commented 1 year ago

For the record, my first comment (accidentally overwritten):

main.jl

  • seems seed value 0 does not enforce time-dependent seeding ( Ok saw it within mainHelper.jl)

Generally I would rather get rid of time dependent seeding anyway, to be honest. Unless the RNG is seriously broken, setting seeds in sequence (1, 2, 3, ...) produces exactly as much randomness as setting a time dependent seed.

  • at the moment model parameters are fixed, but in case any parameter gets assigned a random value, then it makes sense to seed before reading / loading a model parameter (might be already the case, but just ensuring)

Hmm, I would argue that a parameter that's set at random isn't really a parameter, but part of the model. Or, put differently, anything that requires random numbers should not be part of parameter loading anyway, IMO.

mainHelpers.jl

  • Would be good to move the part regarding LOAD_PATH to main.jl (so that I can use the code as well)

Module loading needs a revamp anyway. I would rather fix that separately, though.

  • Model data structure contains data fields, while model parameters are external. It makes sense to either join the parameters or separate the data from the model data structure.

I see your point. I'll have to think about this a bit, so if possible I would like to add an issue for this and solve it later.

  • mainHelper.jl is quite large and thus it makes sense to decompose it into several source files within a directory

Yes, definitely.

docs

I did not try now to understand every thing in details. But would be great to have some docs e.g. the purpose / usage of functions s.a.

  • asType(*)

  • parse

  • setValue!

  • ...

Sorry, will do.

AtiyahElsheikh commented 1 year ago

With seeding I mean the call to Random.seed!

AtiyahElsheikh commented 1 year ago

Sorry .. did not mean to overwrite.

mhinsch commented 1 year ago

With seeding I mean the call to Random.seed!

Yes, I thought as much, but I don't understand what you mean by 'then it is a matter of the client whether to view seed=0 to be time dependent or not'.

AtiyahElsheikh commented 1 year ago

Consider removing the label / or hinting if the branch is ready to merge?