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>
This commit is contained in:
Markus Armbruster 2016-06-04 09:50:09 +02:00
parent 43fc32a365
commit 41a2f7d1df
6 changed files with 40 additions and 56 deletions

View file

@ -663,8 +663,7 @@ extern int dodistribute(struct sctstr *, int, double);
/* finish.c */
extern void finish_sects(int);
/* human.c */
extern int new_work(struct sctstr *, int);
extern int do_feed(struct sctstr *, struct natstr *, int);
extern int do_feed(struct sctstr *, struct natstr *, int, int);
extern int feed_people(short *, int);
extern double food_needed(short *, int);
extern int famine_victims(short *, int);