total_duration = 5 * 60 * 1000 seconds
I guess that it is 560 seconds or 560*1000 miliseconds, but that is minor thing (rather a bit funny to me )
No it is 5 minutes, but value is arbitrary...
curent_result_weight (...) If "something" took few seconds it will have lesser impact and so on...
I don't understand everything (total duration is a constant here?), but as I know you, I believe that this formulas are good. So I will have no objections for your work any more! Go for it and merge to make the AI even better!
What I dont like (too) about current main statistics, that it covers varying range of time. From 20x skipped to 20x producing, this can be from 1 minute to more then 20 minutes...
the current statistics for display in the UI does not count skipped cycles it simply ignores them. Only thing that got updated was the AI crude_percent value with a scaling factor of 98%. only failing and completing is added in the register of the last 20 program cycles. As explained in the branch review I think a task based productivity count like it is implemented now fits much better the informational need of the player as well as of the AI. For me the question is not how long has the building been working in the last 20 minutes. The question is rather how often has it been succesful in the last 20 attempts. A nice side effect of the current implementation is that the falling time is much shorter due to failing is much shorter than completing a task. So we really get a quick alert if a building has a problem.