MRC-CSO-SPHSU / LoneParentsModel.jl

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

remove sleeptime from simulation functions #106

Closed mhinsch closed 1 year ago

mhinsch commented 2 years ago

sleep should be called by the functions calling the simulation functions (i.e. the scheduler) not by the simulation itself.

AtiyahElsheikh commented 2 years ago

When a low-level function that is called x-hundreds of times is being debugged, I don't want to overlook 500 hundreds iterations. This has been helpful a lot in many circumstances.

mhinsch commented 2 years ago

I would suggest using a debugger for that or to just insert a call to sleep in the function you want to debug. Cluttering up the API with this is really not nice IMO.

AtiyahElsheikh commented 2 years ago

Sometimes it is also not about debugging but being capable of seeing the simulation progress, whether the numbers appearing make sense etc. At this stage of incremental development, it is still good to have this. But at syntax level, something like #102 would lead to a shorted syntax.

mhinsch commented 2 years ago

Sorry, but this keeps bugging me... How about some global switches and a couple of utility functions to replace verbose/checkAssumptions/sleep? Then you can switch them on or off in main or the REPL and if you need more fine-grained control you just change the values before and after the function call in question.