org.optaplanner.constraint.streams.bavet.uni.FlattenLastUniNode 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.uni;
import java.util.function.Function;
import org.optaplanner.constraint.streams.bavet.common.AbstractFlattenLastNode;
import org.optaplanner.constraint.streams.bavet.common.TupleLifecycle;
final class FlattenLastUniNode extends AbstractFlattenLastNode, UniTuple, A, NewA> {
private final int outputStoreSize;
FlattenLastUniNode(int flattenLastStoreIndex, Function> mappingFunction,
TupleLifecycle> nextNodesTupleLifecycle, int outputStoreSize) {
super(flattenLastStoreIndex, mappingFunction, nextNodesTupleLifecycle);
this.outputStoreSize = outputStoreSize;
}
@Override
protected UniTuple createTuple(UniTuple originalTuple, NewA item) {
return new UniTupleImpl<>(item, outputStoreSize);
}
@Override
protected A getEffectiveFactIn(UniTuple tuple) {
return tuple.getFactA();
}
@Override
protected NewA getEffectiveFactOut(UniTuple outTuple) {
return outTuple.getFactA();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy