[1.10.2] Logistical Sorter appears fixated on sending certain items before others, causing severe backlogs.
JaSpr opened this issue ยท 7 comments
I have a complex Mekanism setup where after each step in the ore refinement process, items are redirected back to a single chest. The logistical sorter on that chest then determines where the item should go next (e.g. ore > purifier, clump > crusher, dirty dust > enricher, dust > smelter). Throughout the entire setup, elite logistical transporters are used, with a different color for each branch into each machine.
Quite often, when processing a lot of different ores and items, the system will only send through one type of item over and over, while the rest of the items start stacking up in the chest.
The perfect example is having cobblestone sent to the Elite Smelter... If I give the chest 2 rows of cobble, it'll send a whole lot to the smelter, but once the smelted Stone gets to the chest, then the logistical sorter will start ONLY sending the stone through to its final destination (which would be another chest). So long as a few stone blocks are coming into the source chest, they will be pushed out to the final destination while the remaining cobblestone will be sitting idle in that chest, not being pushed to the smelting factory.
As a result, the smelting factory might have something like 10 cobble in each slot, while there are STACKS of cobble available for it, but the logistical sorter will not send it until no Stone Blocks are available to it. Changing the auto and round-robin settings do not affect the way the sorter forwards items on.
Example in creative mode:
I added a few stacks of a few types of ore to the source chest, let it run for a minute, then the sorter started ONLY sending out clumps, everything else stayed in the chest.
Only crusher is currently in use.
Source chest has lots of stuff that can be processed.
Destination chest is empty.
Logistical Sorter configuration has auto + round robin.
Can you list your complete filter list, in order that it appears in the GUI? The logistical sorter will start from the top of the list and find the first match every update.
It does make sense that my issue would occur provided that the filter list is run top-to-bottom on each update. This means that the first items in the list will always get priority over the lower items.
I've spent a few days thinking about this. This seems reasonable for getting the job done (and especially reasonable considering how advanced Mekanism is as compared to other mods and as opposed to manually performing all the work that Mekanism automation takes care of). As much as I'd like to see the logistical transporter algorithm able to figure out a priority based upon availability of items in the chest, versus availability of slots to send them to (thus allowing it to process items efficiently, without need for human intervention) this is probably outside the scope of the project.
I think I could work out an algorithm, but it would be a massive undertaking, and also depends on what a logistical transporter can be aware of (e.g. is it possible to query destination machines for available slots.)
I'd love to see this come to light, but it's a lot of work, and could potentially be a lot of work wasted if it turns out unfeasible once testing has started.
I would suggest the best thing to do would just be to have multiple logistical sorters where possible for the different phases of the chain, they should all be able to pipe to the same pipe net
@thiakil is right, the Logistical Transporter/Sorter routing algorithm is enormously complex at the moment. If you can figure out a way to do as you said, feel free to open a PR.