Class DroolsConstraintFactory<Solution_>
- java.lang.Object
-
- org.optaplanner.core.impl.score.stream.drools.DroolsConstraintFactory<Solution_>
-
- All Implemented Interfaces:
ConstraintFactory
,InnerConstraintFactory<Solution_>
public final class DroolsConstraintFactory<Solution_> extends Object implements InnerConstraintFactory<Solution_>
-
-
Constructor Summary
Constructors Constructor Description DroolsConstraintFactory(SolutionDescriptor<Solution_> solutionDescriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConstraintSessionFactory<Solution_>
buildSessionFactory(Constraint[] constraints)
This method is thread-safe.<A> UniConstraintStream<A>
fromUnfiltered(Class<A> fromClass)
LikeConstraintFactory.from(Class)
, but without any filtering of uninitializedplanning entities
.String
getDefaultConstraintPackage()
This isConstraintConfiguration.constraintPackage()
if available, otherwise the package of thePlanningSolution
class.SolutionDescriptor<Solution_>
getSolutionDescriptor()
LongSupplier
getVariableIdSupplier()
In order to guarantee that all variables have unique names within the context of a rule, we need to be able to uniquely identify them.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.optaplanner.core.api.score.stream.ConstraintFactory
fromUniquePair, fromUniquePair, fromUniquePair, fromUniquePair, fromUniquePair
-
Methods inherited from interface org.optaplanner.core.impl.score.stream.InnerConstraintFactory
from, fromUniquePair
-
-
-
-
Constructor Detail
-
DroolsConstraintFactory
public DroolsConstraintFactory(SolutionDescriptor<Solution_> solutionDescriptor)
-
-
Method Detail
-
fromUnfiltered
public <A> UniConstraintStream<A> fromUnfiltered(Class<A> fromClass)
Description copied from interface:ConstraintFactory
LikeConstraintFactory.from(Class)
, but without any filtering of uninitializedplanning entities
.- Specified by:
fromUnfiltered
in interfaceConstraintFactory
- Type Parameters:
A
- the type of the matched problem fact orplanning entity
- Parameters:
fromClass
- never null- Returns:
- never null
-
buildSessionFactory
public ConstraintSessionFactory<Solution_> buildSessionFactory(Constraint[] constraints)
Description copied from interface:InnerConstraintFactory
This method is thread-safe.- Specified by:
buildSessionFactory
in interfaceInnerConstraintFactory<Solution_>
- Parameters:
constraints
- never null- Returns:
- never null
-
getSolutionDescriptor
public SolutionDescriptor<Solution_> getSolutionDescriptor()
- Specified by:
getSolutionDescriptor
in interfaceInnerConstraintFactory<Solution_>
- Returns:
- never null
-
getVariableIdSupplier
public LongSupplier getVariableIdSupplier()
In order to guarantee that all variables have unique names within the context of a rule, we need to be able to uniquely identify them. This ID supplier is used by all variable-creating code.- Returns:
- supplier that returns a unique number each time it is invoked
-
getDefaultConstraintPackage
public String getDefaultConstraintPackage()
Description copied from interface:ConstraintFactory
This isConstraintConfiguration.constraintPackage()
if available, otherwise the package of thePlanningSolution
class.- Specified by:
getDefaultConstraintPackage
in interfaceConstraintFactory
- Returns:
- never null
-
-