LTN with full trains

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

Post Reply
menzel72
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Mar 27, 2019 12:03 am
Contact:

LTN with full trains

Post by menzel72 »

I've been struggling figuring out how (or even if it's possible) to only use LTN only with full trains.

Lets say I run trains in the 2-4 configuration. With 50 stack size items, that's 8000 items per train, with 200 stack size, that's 32,000 items per train.

So I set provide and request thresholds to the value of the stack size. But this system all breaks down whenever I have a requester station that needs to request items with different stack sizes. If I set the request threshold to the minimal stack size.

Example: I need Coal and Iron-Plates delivered to an oil outpost to make sulfuric acid and plastic. If I set the request threshold to 16k, coal will never be delivered, but if I set it to 8k, whenever iron is needed, LTN is creating 2 8k requests to the Iron plate factory, but the first train will empty it out, leaving the 2nd train just a waste of time.

This is super duper annoying at my mall requester station, which has a request for rocket fuel (1600 items). LTN is consistently creating 3 delivery of just over 1000 items of iron plates to my home, which completely drains my plate factory (because trains are waiting for inactivity and get filled all the way) and overflows my mall with iron plates.

So I came up with the idea to just request/provide things in multiples of 1. 1 being a full train. So if a coal mine has 17k ore available, it outputs a supply of 2.
This works fairly well and is the best system I've found so far. However, it has one kind of large weakness; I cant request multiple trains. If I set my plate factory to -2 iron ore, since a train can carry more than 2 ore, LTN will only dispatch 1 train.

So, i decided to go all hacky on it, and modified dispatcher.lua line 379 to return all train sizes as 1. But this doesnt seem to allow LTN to dispatch more than 1 train.

Am I going about this all wrong?

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: LTN with full trains

Post by Optera »

menzel72 wrote:
Wed Mar 27, 2019 12:17 am
Lets say I run trains in the 2-4 configuration. With 50 stack size items, that's 8000 items per train, with 200 stack size, that's 32,000 items per train.

Example: I need Coal and Iron-Plates delivered to an oil outpost to make sulfuric acid and plastic. If I set the request threshold to 16k, coal will never be delivered, but if I set it to 8k, whenever iron is needed, LTN is creating 2 8k requests to the Iron plate factory, but the first train will empty it out, leaving the 2nd train just a waste of time.
2L-4C trains have 4 * 40 = 160 stacks of cargo inventory.

This means all stations should be set to a stack threshold of 160.
LTN will take care of all math, triggering deliveries only when whatever item fills up 160 stacks.

I have no idea why you over complicate things doing math on your own and even messing with LTNs code.

boran_blok
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Fri Mar 01, 2019 7:56 am
Contact:

Re: LTN with full trains

Post by boran_blok »

Wait, is this something new I missed, we can set thresholds on stacks ?

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: LTN with full trains

Post by Optera »

Version: 1.10.2
Date: 2019-03-07
Features:
- added Stack Thresholds, only for items of course

boran_blok
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Fri Mar 01, 2019 7:56 am
Contact:

Re: LTN with full trains

Post by boran_blok »

I am staying on 0.16 for a while longer but I am looking forward to that. Thanks for the great mod!

User avatar
Mmmmmmorten
Long Handed Inserter
Long Handed Inserter
Posts: 82
Joined: Sat Mar 30, 2019 6:04 pm
Contact:

Re: LTN with full trains

Post by Mmmmmmorten »

Optera wrote:
Wed Mar 27, 2019 6:27 am

2L-4C trains have 4 * 40 = 160 stacks of cargo inventory.

This means all stations should be set to a stack threshold of 160.
LTN will take care of all math, triggering deliveries only when whatever item fills up 160 stacks.
Hi Optera - super feature... could you please add this description to your LTN Manual - the Stack Threshold for Requester / Provider is missing from it!
Super timing as I just needed this for a station where stack size is 50 and 200 on items and messy with item request ;)

/old dude
:geek:

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: LTN with full trains

Post by Optera »

Will do.
Do these forum posts still not update themselves? :lol:

Post Reply

Return to “Logistic Train Network”