All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.optaplanner.constraint.streams.bavet.uni.ConditionalUniTupleLifecycle Maven / Gradle / Ivy

Go to download

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).

There is a newer version: 10.0.0
Show newest version
package org.optaplanner.constraint.streams.bavet.uni;

import java.util.function.Predicate;

import org.optaplanner.constraint.streams.bavet.common.AbstractConditionalTupleLifecycle;
import org.optaplanner.constraint.streams.bavet.common.TupleLifecycle;

final class ConditionalUniTupleLifecycle extends AbstractConditionalTupleLifecycle> {
    private final Predicate predicate;

    public ConditionalUniTupleLifecycle(Predicate predicate, TupleLifecycle> tupleLifecycle) {
        super(tupleLifecycle);
        this.predicate = predicate;
    }

    @Override
    protected boolean test(UniTuple tuple) {
        return predicate.test(tuple.getFactA());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy