]> git.pond.sub.org Git - empserver/commit
neweff production: Consider insufficient food
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 4 Jun 2016 07:50:09 +0000 (09:50 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:57 +0000 (19:59 +0200)
commit41a2f7d1df923b8742785784a8e66d034b93012d
tree11cfae57f3b8f34c3496ccbc25e48229ed7fa6e1
parent43fc32a365bd5b6c13f8cac0213a9fa04b050182
neweff production: Consider insufficient food

newe() and prod() duplicate parts of the update's do_feed(), except
they round babies down instead of randomly, to get a stable,
conservative forecast.  Unlike the update, they assume sufficient
food.  Inaccurate for sectors that are going to starve or have
suboptimal population growth.  Not documented.  Has always been that
way.

Eliminate the undocumented assumption by replacing the duplicate code
by a call of do_feed().  Add a suitable parameter to do_feed() to
preserve the different rounding.

The update test shows the improvement.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/prototypes.h
src/lib/commands/newe.c
src/lib/commands/prod.c
src/lib/update/human.c
src/lib/update/sect.c
tests/update/journal.log