Separate request thresholds?
Moderator: Optera
-
- Manual Inserter
- Posts: 4
- Joined: Mon Oct 31, 2016 6:13 pm
- Contact:
Separate request thresholds?
At a given requester station I would like to request more than one type of item. One of them I would like 50k in the buffer and the other I would like 5k in the buffer. What should I set the request amounts and request threshold to? Also, a similar question could be asked for provider station. Thanks in advance.
Re: Separate request thresholds?
You can't set separate thresholds. Either use two separate stations, or just use the same threshold for both (it will still make larger deliveries when circumstances permit), or you can use some circuit logic to change the threshold dynamically depending on what items need delivering (but this will still allow "undersized" deliveries of the item you want more of while you're waiting for the item you need less of).
Re: Separate request thresholds?
Note that the threshold is just the amount lacking at which a train will be requested to deliver goods. This just prevents trains being dispatched the moment the first item is removed from the buffer chests. Instead LTN waits till there are enough items to make it worth it.
So set the request limits to the minimum number of items you want in a train. Must be less than the smallest amount of items you request I guess.
And for the items you want to request set their number as negative input to the lamp. So -50k for one and -5k for the other. I would leave the request limit at the default of 1k in that case. Then a train will be requested when less than 49k or 4k items are buffered respectively.
So set the request limits to the minimum number of items you want in a train. Must be less than the smallest amount of items you request I guess.
And for the items you want to request set their number as negative input to the lamp. So -50k for one and -5k for the other. I would leave the request limit at the default of 1k in that case. Then a train will be requested when less than 49k or 4k items are buffered respectively.
Re: Separate request thresholds?
Which will lead to trains always running with ~1k of both items.mrvn wrote:Note that the threshold is just the amount lacking at which a train will be requested to deliver goods. This just prevents trains being dispatched the moment the first item is removed from the buffer chests. Instead LTN waits till there are enough items to make it worth it.
So set the request limits to the minimum number of items you want in a train. Must be less than the smallest amount of items you request I guess.
And for the items you want to request set their number as negative input to the lamp. So -50k for one and -5k for the other. I would leave the request limit at the default of 1k in that case. Then a train will be requested when less than 49k or 4k items are buffered respectively.
The OP wanted to mix items with low stack size e.g. rocket fuel and items with high stack size e.g. electronic circuits at one stop.
That's not feasible without at least adding one threshold signal/stack size.
My Mods: mods.factorio.com
Re: Separate request thresholds?
Not quite true. At least not when you limit the number of trains for the station or don't have 50 spare trains. Say you limit it to 1 train. If you use up more than 1k items in the time the train delivers new items than the next train will be tasked with a bigger order.Optera wrote:Which will lead to trains always running with ~1k of both items.mrvn wrote:Note that the threshold is just the amount lacking at which a train will be requested to deliver goods. This just prevents trains being dispatched the moment the first item is removed from the buffer chests. Instead LTN waits till there are enough items to make it worth it.
So set the request limits to the minimum number of items you want in a train. Must be less than the smallest amount of items you request I guess.
And for the items you want to request set their number as negative input to the lamp. So -50k for one and -5k for the other. I would leave the request limit at the default of 1k in that case. Then a train will be requested when less than 49k or 4k items are buffered respectively.
The OP wanted to mix items with low stack size e.g. rocket fuel and items with high stack size e.g. electronic circuits at one stop.
That's not feasible without at least adding one threshold signal/stack size.
What it does mean is that it will run trains with ~1k of both items or run trains constantly. Inefficient but that's the limitation for a mixed station.
Re: Separate request thresholds?
I'm butting up against this too. I'd like to use the Roboport blueprint in the design thread, and have stations that can request a variety of materials, but like OP, I don't want to set the request threshold to be small and end up with half full trains of things with big stack sizes.
Is it possible to add a new signal, something like request stack threshold? So if I have an 8 car train, I'd set it to 320? And then LTN can figure out the request threshold based on the item?
Is it possible to add a new signal, something like request stack threshold? So if I have an 8 car train, I'd set it to 320? And then LTN can figure out the request threshold based on the item?
Re: Separate request thresholds?
Actually I've started to use more mixed stations and it starts to bug me too. But for provide threshold.
Specifically I have a station requesting fluids and solids. For fluids I want a request/provide threshold of 75000 because I only deal in full fluid wagons. But that really doesn't work with solids. Providing 75000 iron plates would be way to big a buffer.
What I'm trying now is to have multiple stops that overlap. But then trains can arrive for multiple stops at the same time and you have to buffer them. The limit # trains doesn't work with multiple stations as you can't tell LTN that "this set of stations can only have N trains total".
The same would be true with stations going in opposite directions. Maybe LTN could allow connecting stations with a wire to make them a single multi-stop station with separate request/provide limits per station.
Specifically I have a station requesting fluids and solids. For fluids I want a request/provide threshold of 75000 because I only deal in full fluid wagons. But that really doesn't work with solids. Providing 75000 iron plates would be way to big a buffer.
What I'm trying now is to have multiple stops that overlap. But then trains can arrive for multiple stops at the same time and you have to buffer them. The limit # trains doesn't work with multiple stations as you can't tell LTN that "this set of stations can only have N trains total".
The same would be true with stations going in opposite directions. Maybe LTN could allow connecting stations with a wire to make them a single multi-stop station with separate request/provide limits per station.
Re: Separate request thresholds?
You do not need to change the threshold.
Simply set the different thresholds behind different decider combinators.
Item 1 -> *Each <= -50k = *Each
Item 2 -> *Each <= -5k = *Each
This way the station will not see any request until it reaches your desired threshold. The only downside is the splitting which doubles up everything...
Simply set the different thresholds behind different decider combinators.
Item 1 -> *Each <= -50k = *Each
Item 2 -> *Each <= -5k = *Each
This way the station will not see any request until it reaches your desired threshold. The only downside is the splitting which doubles up everything...
Code: Select all
0eNrNVk2PmzAQ/S8+41VwIB9o1UtVae/bW7VCDjjJSGAjY7KNIv57bdylhAVikCotByRj5s3MezNj39Ahq1ghgSsU3RAkgpco+nVDJZw4zcw3dS0YihAoliMPcZqblaSQodpDwFP2G0V+7T00SVkCKZM4EfkBOFVCdgBI/eYhxhUoYDaAZnGNeZUfmNQeWhwToqJcdYE8VIhS2wpu3Gu81VPooSuK8Pop1F5SkCyx24FnEJQUWXxgZ3oBba5tjpApJp1yTwRtck9EZVjD/so8HS7emk3OrcvSAPnmJVnaTQ1SGw3IpALVLI1tbbjsZU/mZY//Z/qSvuN3IdI7CsLFDIRuDKxnMkA+GCB9BsgCBi4gVaW/tEHYP/D3Dgn+g24Yw3gZxCCzMH4MYqxnYbwOYgSzMH4OYoQO06HXVLu7lto6AAyU5S4ISYuxGy3Kk2SMLyzLYGq8jU8l4tSUfyFjvZdCG/MRZKliZ0kYTc6WE9s22ntoydWRFlQ2kUboWRuKShXVIujiGjecx0cp8hi4hkGRkhWr3QeBb44AVy08RFylIx3ZzHo/ImU4S0r8hbT8clKSUSnXPTGCedIG09JuR6TdtOlm4gSlggQrfYPhuFSiwJarCYlX/SNkM+BjO+nD8jhRRdbHUOV8JNxWzoLCofyqzsBP98XTL5xvZrsqmXaVCXMUNrIvH5pkRI7dFFUDU9OK8FiCfYubsxSqHLNM/y41fCEy9hmYfCLfLc3ALU1/9U8Gk9/prHBzbx7JsDdImiZqzrioc0n30EXfUiwFQUA2+3VAtqSu/wByGfmq
Re: Separate request thresholds?
This could get complex. Say you have Items 1, 2 and 3. If in the sum of them they fill a train car then you want LTN to send a train. But only if all 3 of them will be requested.Shia wrote:You do not need to change the threshold.
Simply set the different thresholds behind different decider combinators.
Item 1 -> *Each <= -50k = *Each
Item 2 -> *Each <= -5k = *Each
This way the station will not see any request until it reaches your desired threshold. The only downside is the splitting which doubles up everything...
I guess in my case I can set the request/provide limit for solid goods and handle them directly and then use combinators to handle liquids. Liquids can't share tanks so they are a binary. Either you provide/request a tank full or not.
PS: is anyone connecting their pumps to the LTN station and request only half a fluid wagon full of liquid?
Re: Separate request thresholds?
Just to get you correct: You are requesting different items in one train? My trains only deliver 1 type of item... maybe I use it the wrong way
"If" I need item "1" then the factory will not do anything (as I need that one item) and that way item 2 will not be used up. This way I would not get any new Items.
I probably missed something here
"If" I need item "1" then the factory will not do anything (as I need that one item) and that way item 2 will not be used up. This way I would not get any new Items.
I probably missed something here
Re: Separate request thresholds?
With Angels mods you have many things that produce various ores. Ore crushing produces crushed ore and crushed stone. First level of ore sorting produces e.g. 2 iron ore, 1 copper ore and 1 slag. It's fun to just put them into buffer chests and have LTN send a train to pick up the right thing.
The more advanced sorting methods use a combinaton of (angels) ores as input to produce a combination of pure (bobs) ores as output. With ore fields near together I sometimes build one station with a warehouse filled with multiple ores (with combinators to give each an equal share of the warehouse). I also have stations that request multiple ores to use the merged sorting recipes. LTN can then send a train to pick up 2000 Sapharite ore and 4000 Jivolite ore.
Happens when you have a station requesting multiple goods that another station provides. LTN combines the requests for the goods into a single delivery.
I also have a warehouse with everything needed to build outposts. It's fun to go somewhere, put down an LTN station and request: 1000 belts, 50 undergorund belts, 20 splitter, 20 stack inserters, 50 inserters, 20 asembler, 10 signals, 5 chain signals, 500 rails, .... Now I only need something so I can cut&paste a blueprint into a constant provider to program the LTN stop.
The more advanced sorting methods use a combinaton of (angels) ores as input to produce a combination of pure (bobs) ores as output. With ore fields near together I sometimes build one station with a warehouse filled with multiple ores (with combinators to give each an equal share of the warehouse). I also have stations that request multiple ores to use the merged sorting recipes. LTN can then send a train to pick up 2000 Sapharite ore and 4000 Jivolite ore.
Happens when you have a station requesting multiple goods that another station provides. LTN combines the requests for the goods into a single delivery.
I also have a warehouse with everything needed to build outposts. It's fun to go somewhere, put down an LTN station and request: 1000 belts, 50 undergorund belts, 20 splitter, 20 stack inserters, 50 inserters, 20 asembler, 10 signals, 5 chain signals, 500 rails, .... Now I only need something so I can cut&paste a blueprint into a constant provider to program the LTN stop.
Re: Separate request thresholds?
Thanks for the idea. But you still run into issues with trains not being full.Shia wrote:You do not need to change the threshold.
Simply set the different thresholds behind different decider combinators.
Item 1 -> *Each <= -50k = *Each
Item 2 -> *Each <= -5k = *Each
This way the station will not see any request until it reaches your desired threshold. The only downside is the splitting which doubles up everything...
Code: Select all
0eNrNVk2PmzAQ/S8+41VwIB9o1UtVae/bW7VCDjjJSGAjY7KNIv57bdylhAVikCotByRj5s3MezNj39Ahq1ghgSsU3RAkgpco+nVDJZw4zcw3dS0YihAoliMPcZqblaSQodpDwFP2G0V+7T00SVkCKZM4EfkBOFVCdgBI/eYhxhUoYDaAZnGNeZUfmNQeWhwToqJcdYE8VIhS2wpu3Gu81VPooSuK8Pop1F5SkCyx24FnEJQUWXxgZ3oBba5tjpApJp1yTwRtck9EZVjD/so8HS7emk3OrcvSAPnmJVnaTQ1SGw3IpALVLI1tbbjsZU/mZY//Z/qSvuN3IdI7CsLFDIRuDKxnMkA+GCB9BsgCBi4gVaW/tEHYP/D3Dgn+g24Yw3gZxCCzMH4MYqxnYbwOYgSzMH4OYoQO06HXVLu7lto6AAyU5S4ISYuxGy3Kk2SMLyzLYGq8jU8l4tSUfyFjvZdCG/MRZKliZ0kYTc6WE9s22ntoydWRFlQ2kUboWRuKShXVIujiGjecx0cp8hi4hkGRkhWr3QeBb44AVy08RFylIx3ZzHo/ImU4S0r8hbT8clKSUSnXPTGCedIG09JuR6TdtOlm4gSlggQrfYPhuFSiwJarCYlX/SNkM+BjO+nD8jhRRdbHUOV8JNxWzoLCofyqzsBP98XTL5xvZrsqmXaVCXMUNrIvH5pkRI7dFFUDU9OK8FiCfYubsxSqHLNM/y41fCEy9hmYfCLfLc3ALU1/9U8Gk9/prHBzbx7JsDdImiZqzrioc0n30EXfUiwFQUA2+3VAtqSu/wByGfmq
Say a full load is 18,000. Using this logic, you won't make a request until you need 18,000. So you hit that threshold, and a train full of 18,000 is dispatched. But while that train is coming, your buffer gets smaller, and now you need 19,000. LTN will make a request for that 1,000 difference.
So I had a different idea, which is to divide how many I want by a full train size, and then multiply that by the full train size.
So say I have a request for -8,000. Divide that by 18,000, and you get 0 (Factorio drops the everything after the decimal). So 0 times 18,000 is 0, and no request is made. If I have a -26,000 input, that gets divided by 18,000, and that is 1. 1 train full, multiply that by 18,000 and the request that hits LTN is for 18,000. In my head, that should mean there should never be a smaller request than 18,000, assuming there are stations providing the full amount.
But I am still seeing requests for smaller, partially full trains.
I would really like a way to set a flag for full trains only or some way LTN can figure out the threshold based on stack sizes. Like instead of setting a request threshold, I'd like to set a request train slot threshold. So if I had 10 cargo wagons on my trains, I'd set that signal to 10 * 40 = 400, and LTN would never send a partial train.
Re: Separate request thresholds?
Only if multiple trains are set for the station. If just 1 train is allowed to use the station at any time, then the new request only can be created after the actual one leaves that station, but at that moment the threshold is below the 18k and so no other train will be sent.Say a full load is 18,000. Using this logic, you won't make a request until you need 18,000. So you hit that threshold, and a train full of 18,000 is dispatched. But while that train is coming, your buffer gets smaller, and now you need 19,000. LTN will make a request for that 1,000 difference.
Also the provider is a part of it. If it is set to a minimum of 10k, then no 1k deliveries will be done. Using a combination of this and the maximum/minimum train length, also can be helpfull.
The real problem here is some kind of misunderstanding of the threshold.
Assume min request is set to 3000 and you want 6k. If the provider is set to 1k and holds 1.5k, then 1.5k will be send. The threshold tells at which point a dispatch will be done. If the request and provide both fulfill their own threshold then it is dispatched (even if the requested amount can't be delivered).
Maybe there will be a signal (in the future) for "only send full trains"...
Re: Separate request thresholds?
Yeah, that's kind of critical for me. Especially on stations that have mixed deliveries.Only if multiple trains are set for the station.
Re: Separate request thresholds?
I've run into the same problem with Shias logic when allowing multiple trains too. The first is full and the second gets whatever remains. And using "amount lacking / train size * train size" is indeed a better solution. So as stuff is used up the requested amount jumps from 0 to -4000 to -8000 to -12000 and so on.
It is not perfect though. After some redesign I destroyed an old factory part and set the station to provider limit 1 and provider priority 1000000. Now even if 4000 items are requested LTN might still send a train with just 1000 items because that is all that is left from the old factory. LTN then still sees a lack of 3000 items so a second train is dispatched to fetch 3000 items. But that is a short lived problem. In general make sure your provider limit on the providing stations is a full train or use the same combinator trick to only provide multiples of train sizes. This only works if both provider and requester deal in multiples of trains.
It is not perfect though. After some redesign I destroyed an old factory part and set the station to provider limit 1 and provider priority 1000000. Now even if 4000 items are requested LTN might still send a train with just 1000 items because that is all that is left from the old factory. LTN then still sees a lack of 3000 items so a second train is dispatched to fetch 3000 items. But that is a short lived problem. In general make sure your provider limit on the providing stations is a full train or use the same combinator trick to only provide multiples of train sizes. This only works if both provider and requester deal in multiples of trains.
Re: Separate request thresholds?
Maybe in the future one could set the requester/provider limit as number of stacks or units of liquid. That way I could set the limit to 38 stacks for a station supplying coal, wood, solid fuel, ...Shia wrote:Maybe there will be a signal (in the future) for "only send full trains"...
Re: Separate request thresholds?
I have something which I think works. It basically limits to one train, but one train load per material, instead of one train for everything. The basic idea is you tell the circuit how many items fit onto a train load (signal T in the combinators), and no matter how many of anything you need, you will only request one train load.
So if you need 4 train loads of iron plates, it will just constantly request one train full, until you no longer need any. That prevents the small deliveries from being made.
The top combinator would be the amount you have on hand, from your chests. Here I am using copper and iron plates, and green circuits.
Each row of the combinators represents one stack size. The top row is 100 stack size, for plates. The farthest right combinator is a constant T you set that represents how much a full train load is, but you do it negative. I have 9 cargo wagons, so that's -36,000 (40 slots * 9 * 100) = -36,000.
The next constant combinator over is how many of each thing I want to keep on hand, for me it's 4 train loads, or 144,000.
The next combinator is a decider combinator, and it just outputs 1 for anything which needs a train load, so if the material is less than T, it outputs 1 for that material. The next arithmetic combinator multiplies that 1 by the train constant, T.
The end result for my picture is copper only needs 9,000, so there's no request. Iron needs 130,000, so it outputs -36,000, for one train load. Green circuits needs a ton, but it outputs one train load, or -72,0000.
Doing it this way will never let me get two train loads of iron plates at the same time, but it will let me request green circuits and iron plates at the same time, which is nice. I haven't used it in a production setting yet, but in my little test it's worked great, with no requests below that threshold of one train full.
Here's the blue print:
So if you need 4 train loads of iron plates, it will just constantly request one train full, until you no longer need any. That prevents the small deliveries from being made.
The top combinator would be the amount you have on hand, from your chests. Here I am using copper and iron plates, and green circuits.
Each row of the combinators represents one stack size. The top row is 100 stack size, for plates. The farthest right combinator is a constant T you set that represents how much a full train load is, but you do it negative. I have 9 cargo wagons, so that's -36,000 (40 slots * 9 * 100) = -36,000.
The next constant combinator over is how many of each thing I want to keep on hand, for me it's 4 train loads, or 144,000.
The next combinator is a decider combinator, and it just outputs 1 for anything which needs a train load, so if the material is less than T, it outputs 1 for that material. The next arithmetic combinator multiplies that 1 by the train constant, T.
The end result for my picture is copper only needs 9,000, so there's no request. Iron needs 130,000, so it outputs -36,000, for one train load. Green circuits needs a ton, but it outputs one train load, or -72,0000.
Doing it this way will never let me get two train loads of iron plates at the same time, but it will let me request green circuits and iron plates at the same time, which is nice. I haven't used it in a production setting yet, but in my little test it's worked great, with no requests below that threshold of one train full.
Here's the blue print:
Code: Select all
0eNrtV9GuojAQ/Zc+bmADBRXJfsa+bQypMF4ngZaUYq4x/PttYeNyQbGguftyX0xKZ05Pzxlm8EL2eQ2lRK5IfCGYCl6R+M+FVPjGWW6eqXMJJCaooCAO4awwKyZRHQtQmLqpKPbImRKSNA5BnsE7if3GeYiRQYoZyNsAtNk5BLhChdAxahfnhNfFHqQ+4YpjOCvGVR/IIaWodK7g5niN5znkTGI30CdkKCHtttaOyVZS5MkejuyEOlXHHzBXIK2EQCm4W+ZMgSGfitoI6Yee583SIhVlqaUYAQWrPhK1QIJcX06TMs6gTGtUfTzP6+MFza7d47wTpDKovvl5kwC8LztmJA51bAfZLn2d3RhGA2folUsBGdaF21HShEqRw9gaN+i88edwCT5zoXe4BA8qdkyG/ly1dHyrSvmHmujtDK/MDygrlYy8OqFUtX5ypdVFuMDSo/GpAgNjn/fbJAldOqyjSX7oEFGrsp59ePNEKdCe9Ga9aguL3k0fxm/s3AynesfYSm+WlX8h/6OP+jIlk+1lYvJrsZEGqDwn7SufHKQoEuQahsQHlldwz2YJ2dCl1cCltenJN/30B5HRuFNMlUNg11hW81o+nWH+ZMd/YFrbWd1g/bnn7+x1HvdV5ymd1vN08l+lk8VkdP3wVbNxCEWfk/ymkpvF44N+j4+J8RFNjw/fm9cw7s2LaNm8oN/zYtG82N6w0bH+lJzye2P3um6XND766sY3+QXu0ihaPCgiOxl8b8mgpF80KDf0hfd3ZtSLDm6Ninv/eR1y0rfpLhyGdL0NQrqhTfMBU0gkqw==
Re: Separate request thresholds?
But you are missing on the great opportunity to get 9000 copper plates and 27000 iron plates in a single train.
Re: Separate request thresholds?
Sou still need this also for the provider in some way. Because if the threshold is 10k and you have 16k then you will get this 16k even the request says 36k (which was a part of the problem).
To still get multiple full train loads you simply can divide by T and then multiply by T. (Which was already suggested.) But this also would lead to partially loaded trains based on the provider.
The only solution would be to cycle. Looking at your 9 cargo setup (assuming 2 locomotives at each side) then one state would be min & max train length of 13.
Again, this needs to be done for the requester and the provider. Which would require cycle setups to not exclude each other by time (request and provider need te send the 13 setup at the same time).
Again, space shouldn't be a problem, so having different stations for different setups will be the easiest way.
To still get multiple full train loads you simply can divide by T and then multiply by T. (Which was already suggested.) But this also would lead to partially loaded trains based on the provider.
The only solution would be to cycle. Looking at your 9 cargo setup (assuming 2 locomotives at each side) then one state would be min & max train length of 13.
Again, this needs to be done for the requester and the provider. Which would require cycle setups to not exclude each other by time (request and provider need te send the 13 setup at the same time).
Again, space shouldn't be a problem, so having different stations for different setups will be the easiest way.
Re: Separate request thresholds?
What would simplify the combinators for multi good stations would be combinators that work on wire colors. E.g. each = red-wire / green-wire.
I know how to do red-wire * green-wire with a few combinators but does anyone have an idead how to do red-wire / green wire?
I know how to do red-wire * green-wire with a few combinators but does anyone have an idead how to do red-wire / green wire?