public final class BavetConstraintFactory<Solution_> extends Object implements InnerConstraintFactory<Solution_>
| Constructor and Description |
|---|
BavetConstraintFactory(SolutionDescriptor<Solution_> solutionDescriptor) |
| Modifier and Type | Method and Description |
|---|---|
ConstraintSessionFactory<Solution_> |
buildSessionFactory(Constraint[] constraints)
This method is thread-safe.
|
<A> BavetAbstractUniConstraintStream<Solution_,A> |
from(Class<A> fromClass)
Start a
ConstraintStream of all instances of the fromClass
that are known as problem facts or planning entities. |
<A> BavetAbstractUniConstraintStream<Solution_,A> |
fromUnfiltered(Class<A> fromClass)
Like
ConstraintFactory.from(Class),
but without any filtering of uninitialized planning entities. |
<A> BiConstraintStream<A,A> |
fromUniquePair(Class<A> fromClass,
BiJoiner<A,A> joiner)
Create a new
BiConstraintStream for every unique combination of A and another A with a higher PlanningId
for which the BiJoiner is true (for the properties it extracts from both facts). |
String |
getDefaultConstraintPackage()
This is
ConstraintConfiguration.constraintPackage() if available,
otherwise the package of the PlanningSolution class. |
SolutionDescriptor<Solution_> |
getSolutionDescriptor() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfromUniquePair, fromUniquePair, fromUniquePair, fromUniquePair, fromUniquePairpublic BavetConstraintFactory(SolutionDescriptor<Solution_> solutionDescriptor)
public <A> BavetAbstractUniConstraintStream<Solution_,A> from(Class<A> fromClass)
ConstraintFactoryConstraintStream of all instances of the fromClass
that are known as problem facts or planning entities.
If the fromClass is a PlanningEntity, then it will be automatically
filtered to only contain fully initialized entities,
for which each genuine PlanningVariable (of the fromClass or a superclass thereof) is initialized
(so when the value is not null - unless PlanningVariable.nullable() is modified).
This filtering will NOT automatically apply to genuine planning variables of subclass planning entities of the fromClass.
from in interface ConstraintFactoryA - the type of the matched problem fact or planning entityfromClass - never nullpublic <A> BavetAbstractUniConstraintStream<Solution_,A> fromUnfiltered(Class<A> fromClass)
ConstraintFactoryConstraintFactory.from(Class),
but without any filtering of uninitialized planning entities.fromUnfiltered in interface ConstraintFactoryA - the type of the matched problem fact or planning entityfromClass - never nullpublic <A> BiConstraintStream<A,A> fromUniquePair(Class<A> fromClass, BiJoiner<A,A> joiner)
ConstraintFactoryBiConstraintStream for every unique combination of A and another A with a higher PlanningId
for which the BiJoiner is true (for the properties it extracts from both facts).
Important: This is faster and more scalable than not using a ConstraintFactory.fromUniquePair(Class) joiner}
followed by a filter,
because it applies hashing and/or indexing on the properties,
so it doesn't create nor checks almost every combination of A and A.
This method is syntactic sugar for UniConstraintStream.join(Class, BiJoiner).
It automatically adds a lessThan joiner on the PlanningId of A.
This method has overloaded methods with multiple BiJoiner parameters.
fromUniquePair in interface ConstraintFactoryA - the type of the matched problem fact or planning entityfromClass - never nulljoiner - never nullBiJoiner is truepublic ConstraintSessionFactory<Solution_> buildSessionFactory(Constraint[] constraints)
InnerConstraintFactorybuildSessionFactory in interface InnerConstraintFactory<Solution_>constraints - never nullpublic SolutionDescriptor<Solution_> getSolutionDescriptor()
public String getDefaultConstraintPackage()
ConstraintFactoryConstraintConfiguration.constraintPackage() if available,
otherwise the package of the PlanningSolution class.getDefaultConstraintPackage in interface ConstraintFactoryCopyright © 2006–2019 JBoss by Red Hat. All rights reserved.