News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

New industry just in time model

Started by jamespetts, August 16, 2020, 12:34:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

I recall that there has been some discussion recently with respect to the industry demand model, and Ranran had posted a number of detailed examples - unfortunately, I cannot seem to find that thread.
In any event, I have spent some time to-day working on an alternative demand model. I have now implemented it in the code, and it is available if one sets the just in time mode to 4. If this be not changed, the current behaviour will remain.
What this mode does is to demand goods and cause them to be put in transit whenever the consumer industry calculates that its warehouse will become empty before the next delivery if more goods be not put in transit now (plus a margin of error if the base maximum in transit percentage be set to > 100% as is recommended).

The idea is that this will cause industries to operate in a pattern of demanding shipments of enough goods to fill their internal storage entirely and then not demanding any more until their internal storage is running low enough that the industry will run out if it does not order some more.
The intention of this is to prevent industries demanding such small quantities of goods be delivered at once so as to make transport uneconomic, as had been complained of on the Bridgewater-Brunel server, especially with agricultural industries, and to allow the extent to which the industry operates a just in time system to be configurable by the pakset author by setting the ratio of the input storage to the consumption rate.

Before I modify the server's configuration to enable this mode, I should be grateful if people could test it and post feedback here. Thank you in advance.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

freddyhayward

I tested this change with an offline save of bridgewater-brunel for a long time with just in time set to 4, and unfortunately I didn't notice any improvement over the original - all the irrational behaviour of the original seems to have remained.

jamespetts

Quote from: freddyhayward on August 16, 2020, 02:35:25 AM
I tested this change with an offline save of bridgewater-brunel for a long time with just in time set to 4, and unfortunately I didn't notice any improvement over the original - all the irrational behaviour of the original seems to have remained.

Can I ask you to clarify precisely what problematic behaviour that you observe with just in time set to 4?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

freddyhayward

Quote from: jamespetts on August 16, 2020, 10:15:10 AM
Can I ask you to clarify precisely what problematic behaviour that you observe with just in time set to 4?
The same behaviour as before the change, described in a number of threads. Generally, producers are overstocked while consumers are undersupplied, too few goods are going into transit, the slowest routes are preferred over the fastest, and most freight transport is generally not viable. It's possible that the changes have effects that I haven't noticed, however.

jamespetts

Quote from: freddyhayward on August 16, 2020, 10:48:41 AM
The same behaviour as before the change, described in a number of threads. Generally, producers are overstocked while consumers are undersupplied, too few goods are going into transit, the slowest routes are preferred over the fastest, and most freight transport is generally not viable. It's possible that the changes have effects that I haven't noticed, however.

As stated in the original post, I have had trouble finding the other thread discussing this in detail. Can you elaborate on what you mean by "overstocked" and "undersupplied"? The only thing that I found in testing was that there were cases where a producer which was part way through producing 1 unit would show that it had 1 unit in the UI (owing to different rounding used in the UI and in the simulation code) and it would appear that it was not sending that unit to the consumer for no good reason whereas in fact it had simply not finished producing that unit.

Were you able to identify any issues that could not be explained by the above in your testing? If so, it would be very helpful to know the details.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

I have done some testing of the just in time 4 model myself, and have found that it does make a significant difference. See the below screenshots:







I am therefore having trouble following the suggestion that the new version is no different. Can anyone elaborate on or explain this statement? If not, I will have to assume that it was an error and will set the just in time model to 4 on the Bridgewater-Brunel server.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

freddyhayward

Those tests look promising, so it is possible that I may not have correctly set it or that the industries I observed were less affected than others. In any case, there seems to be no harm to setting bridgewater-brunel to model 4, so that should go ahead.

jamespetts

Quote from: freddyhayward on August 18, 2020, 10:51:21 PM
Those tests look promising, so it is possible that I may not have correctly set it or that the industries I observed were less affected than others. In any case, there seems to be no harm to setting bridgewater-brunel to model 4, so that should go ahead.

I have modified the default just in time mode in the pakset, so this change should take effect from to-morrow's nightly build.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

Quote from: jamespetts on August 18, 2020, 10:55:03 PM
I have modified the default just in time mode in the pakset, so this change should take effect from to-morrow's nightly build.

I should note that this did not work as expected, and, as of now, the just in time model on the server remains at 2. I have now modified the server's simuconf.tab file so that the server's pakset settings override saved game settings, so this should in fact be applied from to-morrow's nightly build.

I should be grateful if people could re-test how industries work on the server from to-morrow. Thank you.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

I noticed this from a CI warning mail from Github. (´・ω・`)

https://github.com/jamespetts/simutrans-extended/blob/adbba1241255a82e2d757cd46a2760dcd115787c/dataobj/settings.cc#L1885

I think this should be as follows:


if (file->get_extended_version() >= 15 || (file->get_extended_version() == 14 && file->get_extended_revision() >= 30))
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Mariculous

#10
Both codes are eqivalent. It's arguable which one is more readable.