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

Issue in buildUp when nRequired < nExisting and new = FALSE #486

Closed janaobsteter closed 1 year ago

janaobsteter commented 1 year ago

See test in L2

janaobsteter commented 1 year ago

Let's say we have a colony with 100 workers. Then the user calls this line:

buildUp(colony, nWorkers = 70, exact = TRUE, new = FALSE)

What should we do in such a case? Do nothing or remove 30 workers (i.e. return a colony with 70 "old" workers)?

janaobsteter commented 1 year ago

In the tests we have a colony with 100 workers and:

Which I think is not OK! Both should return the same number - in one case, those are new bees and in the other they are old, but the numbers should match.

I've changed to function to now return 70 bees in both cases. Is this ok? @JerBub , @gregorgorjanc

janaobsteter commented 1 year ago

In #488

gregorgorjanc commented 1 year ago

@janaobsteter tricky edge case. Ideally we would not be hitting this edge case most times. I am open to either implementation, but please do make a note in the docs on what the implementation does for this edge case.

janaobsteter commented 1 year ago

Done and merged