Super Factory Manager ( SFM )

Super Factory Manager ( SFM )

16M Downloads

[BUG] Round Robin selecting different targets in same operation

Maverick238 opened this issue ยท 1 comments

commented

Using the latest ATM9 Version.

The following program is used.

every 20 ticks do
  INPUT item::, fluid:: FROM RECIPE_INPUT
  OUTPUT item::, fluid:: TO BUFFER_TARGET ROUND ROBIN BY BLOCK
  FORGET
  
  INPUT item::, fluid:: FROM EACH EBF_OUTPUT
  OUTPUT Item::, fluid:: TO RECIPE_OUTPUT
end

When using the OUTPUT operation here it chooses different ROUND ROBING targets for the fluid and the items.
As far as my understanding goes it should be the same right ? If not is there an option to make it the same so recipes can safely be transported from a Ingredient Buffer to a e.g. GT Machine ?

commented

caused by

for (var resourceType : resourceLimits.getReferencedResourceTypes()) {
// log gather for resource type
context
.getLogger()
.debug(x -> x.accept(LOG_PROGRAM_TICK_IO_STATEMENT_GATHER_SLOTS_FOR_RESOURCE_TYPE.get(
resourceType.displayAsCapabilityClass(),
resourceType.displayAsCapabilityClass()
)));
// gather slots for each capability found for positions tagged by a provided label
Consumer<LimitedInputSlot<?, ?, ?>> finalSlotConsumer = slotConsumer;
resourceType.forEachCapability(context, labelAccess, (label, pos, direction, cap) -> {
List<IInputResourceTracker> inputTrackers = resourceLimits.createInputTrackers();
gatherSlotsForCap(
context,
(ResourceType<Object, Object, Object>) resourceType,
label, pos, direction, cap,
inputTrackers,
finalSlotConsumer
);
});
}

public void forEachCapability(
ProgramContext programContext,
LabelAccess labelAccess,
CapabilityConsumer<CAP> consumer
) {
// Log
programContext
.getLogger()
.trace(x -> x.accept(LocalizationKeys.LOG_RESOURCE_TYPE_GET_CAPABILITIES_BEGIN.get(
displayAsCode(),
displayAsCapabilityClass(),
labelAccess
)));
CableNetwork network = programContext.getNetwork();
RoundRobin roundRobin = labelAccess.roundRobin();
LabelPositionHolder labelPositionHolder = programContext.getLabelPositionHolder();
ArrayList<Pair<Label, BlockPos>> positions = roundRobin.getPositionsForLabels(
labelAccess,
labelPositionHolder
);
for (var pair : positions) {

which has the resource type as the outer loop instead of the block positions

This is also present in OutputStatement