distributeRemaining backwards

for BotE Android (get that via Google Play Store) there's a option to get a Windows version >> here
Antworten
jmichael
Junior Kadett
Junior Kadett
Beiträge: 7
phpbb forum styles
Registriert: Freitag 10. Februar 2017, 18:10

distributeRemaining backwards

Beitrag von jmichael »

A comment in SystemManager says that distributeRemaining is supposed to assign leftover workers to the building types with the highest fractional assignments. The code I see sorts, but does not reverse the list, or process the list backwards. I think this is responsible for a tiny part of the apparent unpredictability of labor assignments.
blotunga
Flottenkapitän
Flottenkapitän
Beiträge: 855
Registriert: Montag 26. Mai 2014, 15:05

Re: distributeRemaining backwards

Beitrag von blotunga »

It is sorted then reversed at the end, see here
jmichael
Junior Kadett
Junior Kadett
Beiträge: 7
Registriert: Freitag 10. Februar 2017, 18:10

Re: distributeRemaining backwards

Beitrag von jmichael »

calc sorts and reverses before returning. It sorts based on count.

Right before this, calc calls distributeRemaining, which sorts on fPart, but does not reverse before adding one worker to each category (until it runs out of idle workers).
blotunga
Flottenkapitän
Flottenkapitän
Beiträge: 855
Registriert: Montag 26. Mai 2014, 15:05

Re: distributeRemaining backwards

Beitrag von blotunga »

jmichael hat geschrieben:calc sorts and reverses before returning. It sorts based on count.

Right before this, calc calls distributeRemaining, which sorts on fPart, but does not reverse before adding one worker to each category (until it runs out of idle workers).
Ah, I missed that. Yes that should be iterated in reverse. It probably won't make a huge difference, but yes that's the correct way.
Antworten

Zurück zu „BotE Android (Windows version)“