org.optaplanner.constraint.streams.bavet.bi.FlattenLastBiNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of optaplanner-constraint-streams-bavet Show documentation
Show all versions of optaplanner-constraint-streams-bavet Show documentation
OptaPlanner solves planning problems.
This lightweight, embeddable planning engine implements powerful and scalable algorithms
to optimize business resource scheduling and planning.
This module contains implementation of Constraint streams (Bavet).
package org.optaplanner.constraint.streams.bavet.bi;
import java.util.function.Function;
import org.optaplanner.constraint.streams.bavet.common.AbstractFlattenLastNode;
import org.optaplanner.constraint.streams.bavet.common.TupleLifecycle;
final class FlattenLastBiNode extends AbstractFlattenLastNode, BiTuple, B, NewB> {
private final int outputStoreSize;
FlattenLastBiNode(int flattenLastStoreIndex, Function> mappingFunction,
TupleLifecycle> nextNodesTupleLifecycle, int outputStoreSize) {
super(flattenLastStoreIndex, mappingFunction, nextNodesTupleLifecycle);
this.outputStoreSize = outputStoreSize;
}
@Override
protected BiTuple createTuple(BiTuple originalTuple, NewB newB) {
return new BiTupleImpl<>(originalTuple.getFactA(), newB, outputStoreSize);
}
@Override
protected B getEffectiveFactIn(BiTuple tuple) {
return tuple.getFactB();
}
@Override
protected NewB getEffectiveFactOut(BiTuple outTuple) {
return outTuple.getFactB();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy