News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

[patch] just-in-time and cargo distribution

Started by Dwachs, December 14, 2012, 08:23:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dwachs

Currently, the distribution of goods to factories is broken: If all consumers of a factories' good do not have anything in their storage, then the output goods is always sent to the same factory.

Patch attached. I do not know whether it break something else. Overflowing target factories still should be treated equally.

Parsley, sage, rosemary, and maggikraut.

prissi

Does this problem only occur for just_in_time off?

Another solution would be to use the in transit number to distribute to the factories with least in store + in transit. This would also prefer closer factories more.

Dwachs

It effects only the just-in-time=off branch. There factories that are empty are not treated equally, the factory with the largest storage always wins.

The patch uses maximum storage and available storage at target factory in the same way as halt capacity and available halt capacity are used with just-in-time on.
Parsley, sage, rosemary, and maggikraut.

prissi

Since we record now, how much is in transit: Maybe now the factory with the least percentage of goods in (storage+in transit)*100/max should get the delivery? (If possible)

Dwachs

#4
I rather would first fix this, before thinking about alternatives.

Edit: Commited.
Parsley, sage, rosemary, and maggikraut.