The International Simutrans Forum

 

Author Topic: Matching freight network capacity with freight demand  (Read 504 times)

0 Members and 1 Guest are viewing this topic.

Offline Jando

  • *
  • Posts: 444
Matching freight network capacity with freight demand
« on: February 26, 2019, 11:52:11 PM »
The thing I struggle with most on my current map (all industries placed manually as public player, cross-connect industries flag switched on) is to match freight network capacity with demand. That's about the whole network, but the crucial thing is the last part of the network, from station or freight yard to end-consumers. When a new town is connected to the network - and with it multiple end-consumers, bakeries, markets, grocers, that sort of things - it always creates a huge spike in demand. Huge compared to what the end-consumers will actually consume once they got the stock delivered: it's very common that a end-consumer when first connected will demand stock that will equal multiple years of consumption of the same end-consumer. I've seen cases with up to 12 years of consumption demanded by end-consumers.

Of course that means that the same end-consumer will not demand anything at all for some years after the items from the spike have been delivered but instead consume the stock without any demand for new deliveries. That makes it very difficult to design the freight network. A new market would need a dedicated train service initially delivering the hundreds of fish, fruit and vegetable during the initial spike, but once these items have been delivered it only needs a packhorse to keep the link alive. That packhorse of course will never leave it's cargo bay. I've started to group end-consumers by location now, allowing that pack horse to keep the link to multiple end-consumers, else I'd need to bulldoze half a town to make room for cargo bays with pack horses that never leave the bay anyway. :)

And that cycle continues, after the stock is consumed I see a new spike and then again years of no demand at all.

A suggestion about what I would prefer:
If an end-consumer (thus an industry that produces nothing) has less stock than it's nominal consumption (first line of industry window, max. XYZ units per month) then let it demand that nominal consumption once per game month. Eventually - after deliveries happened - it will have more than that nominal consumption in stock. When it does let an industry demand what it consumed at the end of a game month.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2508
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Matching freight network capacity with freight demand
« Reply #1 on: February 27, 2019, 12:05:11 AM »
This sort of spikes have been dealt with in standard - JIT=2, but this never got to extended. Instead James has made some other more sophisticated algorithm for orders. Maybe it is time to reconsider if something simpler would not be better?

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2583
  • Languages: EN
Re: Matching freight network capacity with freight demand
« Reply #2 on: February 27, 2019, 06:43:54 AM »
I do not think extended is designed to work with cross-connect factories.

Offline Jando

  • *
  • Posts: 444
Re: Matching freight network capacity with freight demand
« Reply #3 on: February 27, 2019, 09:52:07 AM »
I do not think extended is designed to work with cross-connect factories.

What I described in my original post happens without cross-connect as well.

Offline accord2 pt

  • *
  • Posts: 234
  • Languages: EN, PT
Re: Matching freight network capacity with freight demand
« Reply #4 on: March 02, 2019, 06:19:04 PM »
I do agree with this post. It simply makes cargo transport not profitable... I think in this case James needs to put first gameplay quality and not realism.

Also, I don't think balance will solve this problem, since it is much more than that.

Offline Jando

  • *
  • Posts: 444
Re: Matching freight network capacity with freight demand
« Reply #5 on: March 03, 2019, 11:36:28 PM »
I think in this case James needs to put first gameplay quality and not realism.

Hehe, Accord2, for sure the current mechanic is not good for gameplay, but it's highly unrealistic as well. I believe my suggestion in my OP would lead to a far more realistic mechanic. Here's a screenshot from what just happened at some consumers, all of them around 8-10 game-years old.



Three industries pictured. Storage and transit graphs shown.
- The hardware shop, average consumption around 1 unit per day/month, with 100 units in stock demands 58 new units.
- The clothes shop, average consumption around 0.8 units per day/month, with 37 units in stock demands 73 new units.
- The market, average fruit consumption around 5 units per day/month, with 185 units in stock demands 328 new units. Same with vegetables, average vegetable consumption 4 units per day/month, with 42 units in stock demands 140 new units.

That looks all rather odd to me. :)

Offline Ranran jp

  • *
  • Posts: 306
  • Languages: ja
Re: Matching freight network capacity with freight demand
« Reply #6 on: March 04, 2019, 09:15:23 AM »
I suppose some balancing issues can be pakset issues or both extended and pakset.

I guess many of the recently reported issues may have been caused by this adjustment from August 2017.

By this adjustment, the industry of pak128.britain set abnormal numerical values in dat, and as a result, it has many contradictions with the extended code specification.
For example, a farm can not create more than 400 fields, but not only is the minimum field set beyond that, but the maximum value is set to 1900.
So I am confused what is going on... (´・ω・`)

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18246
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Matching freight network capacity with freight demand
« Reply #7 on: March 13, 2019, 01:19:47 AM »
This is a complex issue, as all issues relating to balance are. First of all, to deal with Ranran's point: I had not realised when adding the larger number of fields for farms that there was a hard limit of a 9 tile radius. I have now abolished this hard limit from the next nightly build, so hopefully farms will have their correct production.

However, I do not believe that this is relevant to the initial issue. That issue seems to be that the storage capacity of consumer industries is too high, which, coupled with a system in which industries demand goods until their storage is full, can lead to initial spikes in demand. The system is designed to regulate the demand thereafter, but this will not affect the initial spikes. One thing to bear in mind is that all times should be treated as on the short timescale not the long timescale, so a game year is actually 76.8 hours which makes (assuming 16 hour days, as we do not simulate the night) 4.8 days. 12 game years would be 57.6 days, which would be too much for a market stall with fresh fruit or meat, but probably not too much for a hardware or furniture shop.

Can anyone identify any particular industries whose internal storage is too high? If so, I can look into recalibrating these.

As to demand regulation more generally. it is possible that, when introducing the new visitor based demand system for industries, I had not adjusted the demand regulation algorithm to take account of the fact that the industry's demand is based on actual visits rather than a hard-coded number, which would mean that ongoing demand is too high. However, initial demand is necessarily an intractable problem, since it is not knowable how many customers will visit the consumer industry when it is selling products until it actually starts selling products.

If the only demand spike issues are initial, then this suggests that the problem is not that the demand regulation did not take into account visitor numbers. However, if demand spikes persist indefinitely, then this would suggest that I would need to look at adapting the demand regulation algorithm to take account of visitor numbers.

I should be very grateful if people could let me know what they are experiencing as to demand spikes (i.e., initial only or indefinitely persistent) so that I know whether to look into this aspect further.

Thank you for your feedback on this so far.

Offline Jando

  • *
  • Posts: 444
Re: Matching freight network capacity with freight demand
« Reply #8 on: March 13, 2019, 11:59:26 AM »
Hello James, and many thanks for looking at the issue!

That issue seems to be that the storage capacity of consumer industries is too high, which, coupled with a system in which industries demand goods until their storage is full

I do not believe that storage capacity of consumers has anything to do with the issue, instead storage capacity of industries seems to have no effect. Consumers commonly demand much, much more, even hundreds of times the size of their storage capacity. If you can please look at the screenshot I posted in reply #5. There you have a market (storage capacity for fruits: 2 crates), yet the market has 185 crates in stock and has now demanded 328 more. With that demand delivered the market will have about 250 times it's storage capacity in stock. That seems to be true for all industries: storage capacity has little or perhaps even no effect on demand at all.

If the only demand spike issues are initial

No, spikes are not only initial. In the screenshot in reply #5 you see consumers that are in operation since 8-10 game years that are creating a new spike.

Thank you again, James, for your good work on Extended!

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18246
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Matching freight network capacity with freight demand
« Reply #9 on: March 13, 2019, 12:08:58 PM »
Thank you for letting me know: that is helpful. Are you able to upload a saved game in which these demand spikes can reliably be reproduced so as to assist me in testing for the causes of this and devising remedies? That would be most helpful.

Offline Jando

  • *
  • Posts: 444
Re: Matching freight network capacity with freight demand
« Reply #10 on: March 14, 2019, 02:28:08 PM »
Are you able to upload a saved game in which these demand spikes can reliably be reproduced so as to assist me in testing for the causes of this and devising remedies?

Hello James, can be observed in every developed freight map. :) Here's a link to my current Pinterridge map (link valid for 60 days): https://simutrans-germany.com/files/upload/AA_Demand.sve

How to observe:

1. Load above map, hit pause.
2. Map is centered on Pinterridge Freight Yard that is connected to almost all producers on that entire map. Just across the street to the north of the cargo bays are 3 free tiles (that I just bulldozed), switch to public player and place a grocer on one of these free tiles, the grocer will be in range of the freight yard there.
3. Switch back to default player and examine grocer, unpause game. The grocer will immediately demand 22 canned food. Why 22? Because that is the output storage size of the cannery, thus the grocer immediately demands all canned food in storage there.
4. Cannery will produce more canned food and the grocer will demand 4 canned food more when they become available, for a total of 26 canned food, that is 13 times the input storage of the grocer and about 52 times it's future daily/monthly consumption.

You can repeat this test by placing a hardware shop or a builders' yard on one of these free spots, the mechanism will always be the same. A placed hardware shop will initially demand 54 crates (because that is what the hardware factory has in stock) and will continue demanding until it has demanded 62 crates. That is about 5 times it's input storage and about 60 times it's daily/monthly consumption. Same with a builders' yard, you would see it demand all steel and all concrete available in the respective factories.

Obviously the above shows how the initial spikes happen. Why we also get spikes years later like shown in the screenshot in my reply #5 in this thread I have no idea.