Add `setup` button to `interaction.jl`
Opened this issue · 0 comments
Issue:
Currently, resetting an interactive model through the reset button returns the state of the simulation to the state of a previously saved deepcopy(SingleContainerABM)
.
Hence, params
passed to abmexploration
and by extension abmplots
cannot vary ABM field such as the number of agents.
Recommendations from the Julia slack group:
A setup button analogue to those found in similar ABM software to reset the ABM completely, by reading the current values of params
when they differ from the original value of the fields in the SingleContainerABM
.
Working solution:
The main issue I see is that currently, the model
struct is passed to abmexploration
already built, hence interactions
has no way to reconstruct the ABM in case any of the fields in SingleContainerABM
.
So far, my working idea is that a setup button inherits the behavior of reset by default.
Additionally a reset function can be passed to abmexploration
/abmplot
to reconstruct the ABM with default values, that are overwritten by current values inparams
where relevant.
As mentioned in slack, I'm happy to work on this feature and eventually submit a pull request.
Also, definitely let me know if my approach is obsolete/too roundabout - I'm rather new to Julia.