Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ class RandomSubListChangeMoveIterator<Solution_> extends UpcomingSelectionIterat

@Override
protected Move<Solution_> createUpcomingSelection() {
if (!subListIterator.hasNext() || !destinationIterator.hasNext()) {
if (!subListIterator.hasNext()) {
return noUpcomingSelection();
}

// The inner node may need the outer iterator to select the next value first
var subList = subListIterator.next();
if (!destinationIterator.hasNext()) {
return noUpcomingSelection();
}
var destination = findUnpinnedDestination(destinationIterator, listVariableDescriptor);
if (destination == null) {
return noUpcomingSelection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,14 @@ private Move<Solution_> pickTwoOptMove() {
if (!originIterator.hasNext()) {
return NoChangeMove.getInstance();
}
// The inner node may need the outer iterator to select the next value first
Object firstValue = originIterator.next();
@SuppressWarnings("unchecked")
var valueIterator = (Iterator<Node_>) valueSelector.iterator();
if (!valueIterator.hasNext()) {
return NoChangeMove.getInstance();
}

Object firstValue = originIterator.next();
Object secondValue = valueIterator.next();

var firstElementPosition = listVariableStateSupply.getElementPosition(firstValue)
.ensureAssigned();
var secondElementPosition = listVariableStateSupply.getElementPosition(secondValue)
Expand Down
Loading