org.optaplanner.constraint.streams.bavet.tri.BavetJoinBridgeTriConstraintStream 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.tri;
import java.util.Set;
import org.optaplanner.constraint.streams.bavet.BavetConstraintFactory;
import org.optaplanner.constraint.streams.bavet.common.BavetAbstractConstraintStream;
import org.optaplanner.constraint.streams.bavet.common.BavetJoinConstraintStream;
import org.optaplanner.constraint.streams.bavet.common.NodeBuildHelper;
import org.optaplanner.core.api.score.Score;
import org.optaplanner.core.api.score.stream.ConstraintStream;
public final class BavetJoinBridgeTriConstraintStream
extends BavetAbstractTriConstraintStream {
private final BavetAbstractTriConstraintStream parent;
private final boolean isLeftBridge;
private BavetJoinConstraintStream joinStream;
public BavetJoinBridgeTriConstraintStream(BavetConstraintFactory constraintFactory,
BavetAbstractTriConstraintStream parent, boolean isLeftBridge) {
super(constraintFactory, parent.getRetrievalSemantics());
this.parent = parent;
this.isLeftBridge = isLeftBridge;
}
@Override
public boolean guaranteesDistinct() {
return parent.guaranteesDistinct();
}
public void setJoinStream(BavetJoinConstraintStream joinStream) {
this.joinStream = joinStream;
}
// ************************************************************************
// Node creation
// ************************************************************************
@Override
public void collectActiveConstraintStreams(Set> constraintStreamSet) {
parent.collectActiveConstraintStreams(constraintStreamSet);
constraintStreamSet.add(this);
}
public BavetAbstractTriConstraintStream getParent() {
return parent;
}
@Override
public ConstraintStream getTupleSource() {
return parent.getTupleSource();
}
@Override
public > void buildNode(NodeBuildHelper buildHelper) {
// Do nothing. BavetJoinQuadConstraintStream, etc build everything.
}
@Override
public String toString() {
return "JoinBridge()";
}
// ************************************************************************
// Getters/setters
// ************************************************************************
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy