Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Round Robin selecting different targets in same operation #166

Open
Maverick238 opened this issue Sep 9, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@Maverick238
Copy link

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 ?

@TeamDman TeamDman added the bug Something isn't working label Sep 9, 2024
@TeamDman TeamDman self-assigned this Sep 9, 2024
@github-project-automation github-project-automation bot moved this to ⏭ Probably next in @TeamDman's SFM project Sep 9, 2024
@TeamDman TeamDman moved this from ⏭ Probably next to 🏗 In progress in @TeamDman's SFM project Sep 9, 2024
@TeamDman
Copy link
Owner

TeamDman commented Oct 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ⏭ Probably next
Development

No branches or pull requests

2 participants