org.optaplanner.constraint.streams.bavet.quad.FlattenLastQuadNode 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.quad;
import java.util.function.Function;
import org.optaplanner.constraint.streams.bavet.common.AbstractFlattenLastNode;
import org.optaplanner.constraint.streams.bavet.common.TupleLifecycle;
final class FlattenLastQuadNode
extends AbstractFlattenLastNode, QuadTuple, D, NewD> {
private final int outputStoreSize;
FlattenLastQuadNode(int flattenLastStoreIndex, Function> mappingFunction,
TupleLifecycle> nextNodesTupleLifecycle, int outputStoreSize) {
super(flattenLastStoreIndex, mappingFunction, nextNodesTupleLifecycle);
this.outputStoreSize = outputStoreSize;
}
@Override
protected QuadTuple createTuple(QuadTuple originalTuple, NewD newD) {
return new QuadTupleImpl<>(originalTuple.getFactA(), originalTuple.getFactB(), originalTuple.getFactC(), newD,
outputStoreSize);
}
@Override
protected D getEffectiveFactIn(QuadTuple tuple) {
return tuple.getFactD();
}
@Override
protected NewD getEffectiveFactOut(QuadTuple outTuple) {
return outTuple.getFactD();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy