News:

SimuTranslator
Make Simutrans speak your language.

[11.30] Industrial demand system changes

Started by Sarlock, May 12, 2014, 03:19:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sarlock

I've been exploring the changes brought about by 11.30 and I've seen a drop in overall industrial production.  Not sure if this was a short term transitional phenomenon or not, I took a local game and zoomed it up to mid-1840 to see how things would even out.  Most of my industries are producing around 25% or so of potential maximum capacity... and these are industries that have enough supplier links to be able to have them operating near 100%.



Pretty much every industry you look at has a graph similar to this... pulses of activity, rarely close to maximum potential production, then lulls as more goods are in transit waiting to be received.

With the recent change, it seems to have reduced overall production rates a bit.  This dairy can produce 644 units per month and yet it barely reaches 50% of that on a good month.  At the time I took this picture, several of its connected cattle farms were sitting idle and not producing when they could of.  The dairy decided that 4310 milk (6.5 months at max production)  in transit was enough to keep itself busy.

How is the maximum "in transit" amount calculated?  It seems to be consistently floating around 4000-4310 for this dairy which is clearly about 25% of what it should be (16,000 would keep it close to its maximum potential production level).  The milk that arrives to this dairy goes through 6-8 transits to get there, so the dairy wouldn't know how long goods take to get there... so what is the calculation based on?  Computed distance (straight-line) from suppliers?

Could "in transit" be based on an average of the last 12 months' production and storage levels?  A moving average would allow slow adjustments to supplier production levels and keep consumption near 100% (if there are sufficient suppliers able to provide that - otherwise "in transit" maximum will never be reached and it will always demand more).
Current projects: Pak128 Trees, blender graphics

jamespetts

The calculation of the maximum in-transit percentage itself has not changed: what has changed is the way in which the internal storage number is used.

The maximum in-transit percentage is a function of the internal storage, adjusted for the ratio between consumption rates and lead times. By default, to give a margin of error, it is 110%. That means that, if an industry has an internal storage of 10, the maximum in-transit number is 11. As to the adjustment, if the lead time (the time that it takes goods to arrive at the industry from the supplier, which is calculated on the basis of the average lead time from all suppliers, the times being derived from the point to point timings of each component of the trips determined by the path explorer) is greater than the consumption rate, the amount is adjusted upwards, and if it is less than the consumption rate, it is adjusted downwards. For example, if an industry's lead time was 2 hours and it took 1 hour to consume the 10 units in its internal storage, the in-transit percentage would be doubled from its base level of 110% to 220%, meaning that the maximum number of units in transit would be 22.

The change is how these figures are factored into the demand. Previously, whenever the internal storage was full or the number of goods in transit exceeded the maximum in-transit percentage, demand would stop. Now, the two numbers are added together and the maximum in-transit percentage is doubled: if the number of goods in transit and in the factory's input store combined exceed 2x the maximum in-transit percentage, demand will stop.

I hope that that clarifies matters.
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.

Sarlock

Thank you.

I went back to a save game from earlier to do a comparison:



Note that this cattle farm is not currently producing milk for this dairy.  The dairy has indicated that it is "full" and does not want any more milk... even though it is only receiving enough to run at 50% capacity.



This is the same dairy served by the same network configuration in the top post.  There were a few more cattle farms added to the network since then but other than that there isn't a change in setup.  Production rate was fairly steady at 50% of maximum production, which was similar to many other industries at that time.  It is interesting to note how that production/consumption graph has changed since then.

I wonder if this is more an effect of the change to the calculated routing times rather than the industrial production model directly.  If the system is not correctly calculating how long it takes for goods to arrive, then it would be incorrectly calculating what "in transit" should be to keep the industry running at an appropriate level.

Either way, it is clear that "in transit" is being calculated much too low.
Current projects: Pak128 Trees, blender graphics

jamespetts

The actual route timings you can work out yourself from the information in the relevant stop details window for each set of routes: it is these same data that are used.

May I ask - is this an isolated example, or is this part of a general trend? I have had reports in the game from other players more or less opposite to that which you have reported, to the effect that they are now able to supply their industries to 100% whereas that had not been possible before.
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.

Sarlock

#4
I'll do some additional profiling but it seems to be common throughout most industries, both mine and other players'.  The key is finding industries that have excess supplier capacity, otherwise it isn't a fair comparison since production is limited by supply limits.

I had a thought: since storage does not equal production rate, does it seem wiser to be basing in transit off of production levels rather than storage?  In the dairy example above, it can produce 636 units per month but its storage is only 100 -- in transit should be a multiple of the production level times the average transit time for goods to arrive, not storage, since it is only 1/6th of production levels.  If, say, the industry requires an average of 10 months to receive its goods, it should have an "in transit" of 10x636=6360.

EDIT: I've looked around at a lot of different industries and they almost all exhibit the same "pulses" of activity as the graphs above.  This is due to in transit not being sufficient to fully supply these industries.  It's easiest to notice in direct supplier-consumer chains, like cattle farm-dairy, as it gets more complicated if you try and analyze a 3-level industry chain (the same pulses of activity phenomenon does occur there as well though).

An additional question: is the in transit computed off of all currently connected industries or all industries on the potential supply chain for that industry?
Current projects: Pak128 Trees, blender graphics

jamespetts

Hmm - some players are latterly reporting errors in the way in which this is calculated, but so far nobody has been able to be specific enough to be able to narrow down specific repeatable incorrect behaviour for testing purposes. Can you be more specific as to what is happening so that I can try to understand precisely where the difficulty is? It would be helpful to give some steps to reproduce the problem reliably.

As to your question, the lead time is calculated using only industries actually connected, rather than potential industries.
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.

Sarlock

I made a simple test save game to demonstrate this:

Save game:
Industry Test Save Game

I connected 3 cattle farms to 1 dairy, 2 to another and just 1-1 for the last pair.  In each instance the cattle farms can produce more than 100% of what the dairies requires, so theoretically the dairies should all be running at 100%.  However:



You can see they are not.  I also notice the problem reported by other players about industries not demanding more production until they hit 0 storage.  (see middle image)

There are two issues contributing: the first is the new resource demand doesn't occur until the industry reaches 0 storage and the second is that the amount demanded in transit is not enough to keep the industries running full out.  I think basing in transit off of production level is the key aspect.  Taking 110% x storage x lead time x 200% can only achieve about 1/3rd of a factories production if its production level is 6x its storage level (a number which varies by industry type).  If it's 110% x production x lead time, it will be much closer to achieving 100%.  As before, in transit will act as the limiting factor to keeping the industry from being overwhelmed - once the in transit limit is reached, no more goods are demanded.
Current projects: Pak128 Trees, blender graphics

Sarlock

#7
I've been running this save game through the new release version, 11.31, and it has addressed the 0 issue with calling for more in transit production, thank you for this fix :)

I still think in transit should be boosted further.  3x would get it closer to ideal production levels.
EDIT Actually, it has to be based on production levels.  Different industries have different levels of storage ratios vs. production levels.  For some industries (markets, pubs) the storage ratio is higher and they are better able to achieve maximum production.  I think the issue is that the 2x multiplier works for industries that have a storage level roughly 50% of their production level.  For industries such as the dairy, which is roughly 1/6th storage vs. production, it doesn't work.

The middle cattle farm and dairy are connected only to each other.  The dairy reached a 79% maximum production in its highest month, but averaged around 60% over the period.

Current projects: Pak128 Trees, blender graphics

jamespetts

Hmm - this should work in principle: a storage level of 50% of the production level does not not fully make sense in any event, as the storage figure is not time dependant, whereas the production figure is. Are you sure that this problem is not occasioned by vehicles waiting until they are full or at a certain percentage of load before they leave? This new system does require in some cases careful adjusting of the minimum loads to achieve maximum efficiency, as the number of units permitted in transit will increase gradually from zero after a delivery which fulfils the industry's requirement fully for the time being.
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.

Sarlock

Question: is waiting time factored in to the in transit time?  I see that most of my freight connections show "waiting time unknown"... will this factor in to the calculation as 0 wait time due to this?
Current projects: Pak128 Trees, blender graphics

jamespetts

Waiting time is indeed part of journey time, which is indeed taken into account. Waiting time unknown is actually 1 minute 54 seconds (1.9 minutes), but the absence of good waiting time information might very well impact on the accuracy of the in-transit percentage calculation.

The next major version will have a much better way of guessing waiting times when information is unavailable based on service frequency, so this problem should be abated.
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.

nathansamson

Potential improvement (As I am having problems as well => see my other posts).

Do not (only) take the storage capacity in account but also the storage of the last station. so especially for long journey times with big transporters but only a few (think ships or large trains), can drop off their load at the station.

jamespetts

The trouble with this is that there is not necessarily a single "last station" - there may be a whole multitude of routes simultaneously supplying any given industry, each with a different last station, and the last station for each route (as well as the number of routes in operation, and the amount of goods transported on each) may well change very regularly.
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.