[suggestion] Depot priority

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

ParanoikCZ
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sat Mar 18, 2017 8:36 am
Contact:

[suggestion] Depot priority

Post by ParanoikCZ »

(playing 0.17/0.11.9 so not sure if not already implemetned in latest)

Use case is that I have small depot on every unloading station, so it's decentralized. However, I want to have some central backup depot with e.g. 40 trains to cover peaks and building new stations requiring a lot of material to initial storage fill. These should be used only when there is no train in any other depot available, so I would like to have something like depot priority set to minus value. This way, centralized depot could also simply tell me what is trains coverage, e.g. when there are 5 trains constantly missing, I would need to add those to normal depots network.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [suggestion] Depot priority

Post by Optera »

Trains are picked by distance to provider, so for your use case it's somewhat implemented already.
ParanoikCZ
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sat Mar 18, 2017 8:36 am
Contact:

Re: [suggestion] Depot priority

Post by ParanoikCZ »

Well, but that would need to build this depot a far far away from base which would affect overall performance.
ParanoikCZ
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sat Mar 18, 2017 8:36 am
Contact:

Re: [suggestion] Depot priority

Post by ParanoikCZ »

So, possibly only solution is to connect all depots' lights and count number of blue signals. If zero, enable depot signal in my backup depot. However, it requires connecting all depots into logistic network and also mess with depot lights (always green if there is at least one green in network .. so, always).
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [suggestion] Depot priority

Post by Optera »

ParanoikCZ wrote: Wed Apr 15, 2020 5:15 pm So, possibly only solution is to connect all depots' lights and count number of blue signals. If zero, enable depot signal in my backup depot. However, it requires connecting all depots into logistic network and also mess with depot lights (always green if there is at least one green in network .. so, always).
Use a data diode (each + 0 = each) when reading from the input.
ParanoikCZ
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sat Mar 18, 2017 8:36 am
Contact:

Re: [suggestion] Depot priority

Post by ParanoikCZ »

Optera wrote: Wed Apr 15, 2020 7:04 pm
ParanoikCZ wrote: Wed Apr 15, 2020 5:15 pm So, possibly only solution is to connect all depots' lights and count number of blue signals. If zero, enable depot signal in my backup depot. However, it requires connecting all depots into logistic network and also mess with depot lights (always green if there is at least one green in network .. so, always).
Use a data diode (each + 0 = each) when reading from the input.
hmm .. can you please tell me what a data diode is? NVM .. I've got it now .. it will just shield out the signal.

meanwhile, I've realised I could also connect semaphores, so I'm counting red lights in other depots.
But my thesis doesn't work as expected .. well, it works flawlessly until backup trains returned into the backup depot, which is atm not marked as a depot, so their schedule is not removed and they leave for another loop after 5s. So, stuck here. The only idea is to add some logic for every rail and check that it's like 6s after hitting semaphore before the station and cross fingers that train stopped and the schedule was deleted.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [suggestion] Depot priority

Post by Optera »

Enabling "delivery completes at requester" will reset the schedule when the train leaves a requester.

Depot priority will probably be a feature of next release.
ParanoikCZ
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sat Mar 18, 2017 8:36 am
Contact:

Re: [suggestion] Depot priority

Post by ParanoikCZ »

Thanks a lot, dunno how could I live without this one :O
Btw it works flawlessly now .. connected all depots, counting blue signals, and when zero, enabling depot signal for backup. Alsou counting blue signals there to see how many trains are free there. But this works only when depot is enabled, as when disabled, it reports purple state due to duplicated name.

However, I was calling all the trains for some service and reschedule and when removed all schedules (from above) while unloading in requester, this happened.

The mod LTN - Logistic Train Network caused a non-recoverable error.
Please report this error to the mod author.

Error while running event LogisticTrainNetwork::on_train_changed_state (ID 23)
__LogisticTrainNetwork__/script/train-events.lua:170: attempt to index field 'schedule' (a nil value)
stack traceback:
__LogisticTrainNetwork__/script/train-events.lua:170: in function 'TrainLeaves'
__LogisticTrainNetwork__/script/train-events.lua:201: in function <__LogisticTrainNetwork__/script/train-events.lua:195>
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [suggestion] Depot priority

Post by Optera »

ParanoikCZ wrote: Thu Apr 16, 2020 8:31 pm But this works only when depot is enabled, as when disabled, it reports purple state due to duplicated name.
Duplicate name error was removed in 1.3.0. I'm only supporting the most recent version of LTN.
Post Reply

Return to “Logistic Train Network”