Closed wenzeslaus closed 1 year ago
Includes an intermediate state of soils addition.
Includes a concept for the soils addition with a more appropriate behavior.
My initial idea was to do mortality in the action to keep the special action to the action object, but I ended up implementing mortality in the host pool object and here, just call the right method because mortality behavior is linked to the host. Eventually, even mortality_rate and mortality_time_lag may end up in the host for multi-host because they are linked to the to the host.
class Mortality
{
void action(Hosts host)
{
for (const auto& [i, j] : hosts.suitable_cells) {
for (host in hosts) {
for (item in hosts.mortality_at(i, j)) {
if (index == 0)
mortality = item;
else
mortality = mortality_rate * item;
list.push_back(mortality);
}
hosts.kill_at(i, j, mortality);
}
}
}
};
Old code design:
New code design:
Code:
Compatibility:
Last phase pieces:
completely_remove_*
methods into one.The results from tests for core and for r.pops.spread are identical with the new code.
For now, this includes also the original pseudo code for host object and actions.
Note: The separate seeds and generators PR (#192) required a lot of changes, so the merge was not trivial.