if (!randomSelection) {
return new AbstractOriginalSwapIterator<Move, Object>(leftEntitySelector, rightEntitySelector) {
@Override
protected Move newSwapSelection(Object leftSubSelection, Object rightSubSelection) {
return anyChained
? new ChainedSwapMove(variableDescriptors, leftSubSelection, rightSubSelection)
: new SwapMove(variableDescriptors, leftSubSelection, rightSubSelection);
}
};
} else {
return new AbstractRandomSwapIterator<Move, Object>(leftEntitySelector, rightEntitySelector) {
@Override
protected Move newSwapSelection(Object leftSubSelection, Object rightSubSelection) {
return anyChained
? new ChainedSwapMove(variableDescriptors, leftSubSelection, rightSubSelection)
: new SwapMove(variableDescriptors, leftSubSelection, rightSubSelection);
}
};
}
}