How to set request priorities?

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

How to set request priorities?

Post by mrvn »

I've seen that you can set a provider priority.

But how do I tell LTN which request station to supply first?
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: How to set request priorities?

Post by Optera »

LTN only supports provider priority.
Requester are always served by oldest standing request.

If you ever need request prioritization it means your production can't keep up. No delivery system can solve that.
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to set request priorities?

Post by mrvn »

Lack of provisions is the most obvious need for request priorities. For example fuel should be send to the power plant first. Only when that is full should furnaces get some fuel. You really do not want to run into a brownout or even blackout.

But there are other considerations. With Bobs and Angels mods there are often many uses for a resource and feedback loops. You often want to keep the feedback loop full but drain any excess. Without request priorities you are in danger of draining it all, making the loop stop producing more.


Can the request amount be safely set using a combinator or would LTN freak out when it changes all the time? Should it be buffered so it only changes every 1000 ticks or so?
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: How to set request priorities?

Post by Optera »

mrvn wrote:Lack of provisions is the most obvious need for request priorities. For example fuel should be send to the power plant first. Only when that is full should furnaces get some fuel. You really do not want to run into a brownout or even blackout.
It's still an underproduction of fuel that will lead into brownout sooner or later.
But there are other considerations. With Bobs and Angels mods there are often many uses for a resource and feedback loops. You often want to keep the feedback loop full but drain any excess. Without request priorities you are in danger of draining it all, making the loop stop producing more.
Ah Bobs and Angels, the original reason provider priority exists. ;)
Can the request amount be safely set using a combinator or would LTN freak out when it changes all the time? Should it be buffered so it only changes every 1000 ticks or so?
LTN can handle combinator controlled fill values and parameters fine. The reason I strongly disencourage using combinator logic is LTN usually does a way better job at managing deliveries than any combinator logic.

For your feedback loop I'd set the drain stop to see a the request fill value only when provider and feedback request stations are full.
  • at each feedback requester and provider: if Item > 10k = Item:1 summed into circuit between stops
  • at drain if Item(from circuit between stops) > #stops = X:1 followed by a arithmetic combinator X*Item(-10k from CC)
    With the drain set to impossible provide threshold this system will do what you want without producing any freak outs.
  • alternatively use a power switch disabling the crafting machines at the drain while provider and feedback are not full
    This would not interfere with LTNat all, if you are worried about that, and also save you some power
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to set request priorities?

Post by mrvn »

Optera wrote:
mrvn wrote:Lack of provisions is the most obvious need for request priorities. For example fuel should be send to the power plant first. Only when that is full should furnaces get some fuel. You really do not want to run into a brownout or even blackout.
It's still an underproduction of fuel that will lead into brownout sooner or later.
Not really. If you produce 80% of your peak fuel requirement and the power plant only needs 50% of that then it will always get it. The furnaces on the other hand would experience fuel shortages but nothing bad happens there. And if it's just a peak then they recover just fine. Or when you cut down the next forest they get all the fuel they need again. Having a priority for the consumer by whatever means makes it work.
But there are other considerations. With Bobs and Angels mods there are often many uses for a resource and feedback loops. You often want to keep the feedback loop full but drain any excess. Without request priorities you are in danger of draining it all, making the loop stop producing more.
Ah Bobs and Angels, the original reason provider priority exists. ;)
Can the request amount be safely set using a combinator or would LTN freak out when it changes all the time? Should it be buffered so it only changes every 1000 ticks or so?
LTN can handle combinator controlled fill values and parameters fine. The reason I strongly disencourage using combinator logic is LTN usually does a way better job at managing deliveries than any combinator logic.

For your feedback loop I'd set the drain stop to see a the request fill value only when provider and feedback request stations are full.
  • at each feedback requester and provider: if Item > 10k = Item:1 summed into circuit between stops
  • at drain if Item(from circuit between stops) > #stops = X:1 followed by a arithmetic combinator X*Item(-10k from CC)
    With the drain set to impossible provide threshold this system will do what you want without producing any freak outs.
  • alternatively use a power switch disabling the crafting machines at the drain while provider and feedback are not full
    This would not interfere with LTNat all, if you are worried about that, and also save you some power
I was thinking of something simpler. Put the amount buffered at the start of the loop on a wire. Then at drain multiply that by -1 (or divide by -2 for more buffering) and use that as request amount and use a high requester limit. At the loop end have a low provider limit and at the loop start a low requester limit.

But your idea with a power switch has merit too, even if no loop and drain is involved. I should switch off every satelite factory when the output station has enough items buffered.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: How to set request priorities?

Post by Optera »

I've added request priority to 1.5.0 preview.
You can download it from github
Post Reply

Return to “Logistic Train Network”