+2 votes
in Suggestion by (190 points)
edited by

The point here is to achieve adjustable throughput for each output, also priority.
Simple round-robin way probably would not work with adjustable throughputs.

This is kinda different suggestion than "add priority splitter" and "add adjustable rate splitter" because we need this two at the same time in one piece and also because i suggest an algorithm to make it work in order to make it easier to implement the suggestion. (We all know, guys at Coffee Stain have a lot of work right now)

A splitter, looks similar to regular splitters. Has 1 input, 3 outputs.

There is a GUI interface for the splitter, in which you can adjust the following for each output:
1. Priority, which can be "Low", "Medium" or "High". Same priorities can be adjusted for more than one output.
2. Output rate, which is an integer number of how many items per minute is given out by given output. Can be blank, which means no limit on throughput.
3. Initial state of the built splitter is "Medium priority" and blank throughput for each output.

There is an internal buffer (think of it as an internal inventory) of items. Size of buffer can be 1 to 3 items. Size depends on adjustments made in GUI interface.


After a splitter is built or changes been applied using GUI interface, calculations are made:
1. buffer size equals to how many different priorities are present in current configuration
2. queues of item consumers are created for each priority (of which at least one output assigned). Count of items in buffer is assigned to each queue, from which queue is allowed to take items from buffer. 1 is assigned to highest priority of all present, 2 to the next, 3 to least priority. Let it be called queue_permission

While an item comes from input conveyor belt, following happens:
1. if the buffer is full, item is not accepted and input conveyor stops. Nothing more happens.
2.1. if the buffer has room, item is accepted and put into least free slot.
2.2. queue, which has queue_permission equal to slot just been filled is checked. If then slot is not empty, next queue (with higher queue_permission) is checked, and so on, until either item is consumed or all priorities confirmed not demanding item from this slot.

While queue is checked, following happens:
1. corresponding slot (slot number equals queue_permission) is checked for item presence. If it is empty, nothing more happens.
2. if slot is filled with an item, all consumers in queue are checked in order (order comes from definition of a queue, not of a stack), until found a consumer with not-blocked conveyor output. When such found:
2.1. item is consumed to the corresponding output.
2.2. if no limit on throughput for this consumer's output is set, consumer is immediately added to the queue, otherwise a timer is set, which is meant to add the consumer to the queue and trigger another queue check when it(timer) fires. Timer time equals interval required to maintain adjusted throughput.

While blocked output ceases to be blocked and room appears there to output to, it's priority's queue is checked. (not sure how it works, but something like that works for regular machinery's outputs)

After an item is consumed from a buffer slot, an item from another slot with bigger number is taken to fill the gap, if there is a non-empty slot with bigger number. Rule of queue also applied here. Last in, last out.
An item is always taken from slot 1, regardless of queue_permission value is assigned to queue, which takes the item. It may be required to 3 slots be filled with items, but if an item is taken, it is taken from slot 1.

Also, exactly 1 item occupies exactly 1 slot. Nothing stacks.

by (800 points)
by (190 points)
If i understand this algorithm correctly, its purpose is to calculate the maximum flow, the number. Not to continuesly dispatch items between one input and three outputs maintaining given restrictions.
by (800 points)
That's true, it's just the basics, but this was the first thing that came to my mind when i read your post.

I am sure with a little tweaking one could make it so that a splitter is a source of the "network", with capacity given by the connected input belt. Mergers are nodes alongside your route, connected with edges (belts) with capacity given by the type of belt. Machines are sinks that consume the flow etc....

If you could then specify the maximum capacity (must be <= than the belt's max) for each edge, then you can calculate how many items must be routed alongside which edge to fullfill the desired flow.... just brainstormed that, but i hope you get the idea
by (190 points)
edited by
I kinda got it, but a lot of questions pops up. Like how many times that algorithm should be applied? Once per tick? What should we do when demand exceeds supply? How do we calculate if there is no stable supply at all, like individual items on the belt once in a while?

Now, we got a number, say, 40 per minute, what do we do with it? Just spawn 40 items per minute? And what if one item on the input conveyor just missing?

What i'm saying that a conveyor belt with distinct items is not a pipe with "flow".

Also, i'm not quite sure that algorithm which answers a question could be easily reworked into algorithm that maintains something continuously. Totally different things.

Anyways, my suggestion seems rather optimal algorithm to me. But i'm not convinced it's ideal, so i'm open to comments if you find issues in it.
Welcome to Satisfactory Q&A, where you can ask questions and receive answers from other members of the community.
In order to keep this site accessible for everybody, please write your post in english :)
August 28th update: We've removed downvotes! One major reason is because we don't want to discourage folks from posting legitimate suggestions / reports / questions with fear of being mass downvoted (which has been happening a LOT). So we now allow you to upvote what you like, or ignore what you don't. Points have also been adjusted to account for this change.
Please use the search function before posting a new question and upvote existing ones to bring more attention to them, It will help us a lot. <3
Remember to mark resolved questions as answered by clicking on the check mark located under the upvotes of each answer.