HighlanderLab / SIMplyBee

SIMplyBee R package extends AlphaSimR for simulating honeybee populations and breeding programmes
http://www.simplybee.info/
Other
0 stars 5 forks source link

resetEvents() can reset the collapse slot if requested. Is this OK? #460

Closed gregorgorjanc closed 1 year ago

gregorgorjanc commented 1 year ago

In line with this discussion https://github.com/HighlanderLab/SIMplyBee/issues/81#issuecomment-1315696801 should we allow resetEvents() to reset the collapse slot, if requested?

janaobsteter commented 1 year ago

Hm, is this sort of to "revive" and "recycle" a colony? We could, but throw a warning?

gregorgorjanc commented 1 year ago

At the moment we have this in the resetEvents()

...
    # Reset collapse only if asked (!is.null(collapse)) or if it was not yet
    #   turned on (is.null(x@collapse))
    if (is.null(collapse)) {
      collapse <- is.null(x@collapse)
    }
    if (collapse) {
      x@collapse <- FALSE
    }
...

So, we only reset the collapse slot (that means setting it to FALSE) if it was FALSE (in which case we have not done anything) or was NULL (this is only relevant for the createColony() really to set this collapse slot to FALSE). In short, this means that resetEvents() at the moment can not reset the collapse slot if it was TRUE.

I am leaning toward leaving this limiting behaviour because this "revive" and "recycle" a colony is only complicating things, right? Its easier to just fire a new createColony()!

janaobsteter commented 1 year ago

@gregorgorjanc , this is done, right?

gregorgorjanc commented 1 year ago

Yes

With regards, Gregor

On Fri, Nov 25 2022 at 6:21 pm, janaobsteter @.***> wrote:

@gregorgorjanc https://github.com/gregorgorjanc , this is done, right?

— Reply to this email directly, view it on GitHub https://github.com/HighlanderLab/SIMplyBee/issues/460#issuecomment-1327768955, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFRGST6P3QJSI4YAPQZYW3WKD7SDANCNFSM6AAAAAASBJFMTQ . You are receiving this because you were mentioned.Message ID: @.***>