public interface InnerConstraintFactory<Solution_> extends ConstraintFactory
Modifier and Type | Method and Description |
---|---|
ConstraintSessionFactory<Solution_> |
buildSessionFactory(Constraint[] constraints)
This method is thread-safe.
|
default <A> UniConstraintStream<A> |
from(Class<A> fromClass)
Start a
ConstraintStream of all instances of the fromClass
that are known as problem facts or planning entities . |
default <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). |
SolutionDescriptor<Solution_> |
getSolutionDescriptor() |
fromUnfiltered, fromUniquePair, fromUniquePair, fromUniquePair, fromUniquePair, fromUniquePair, getDefaultConstraintPackage
default <A> UniConstraintStream<A> from(Class<A> fromClass)
ConstraintFactory
ConstraintStream
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 ConstraintFactory
A
- the type of the matched problem fact or planning entity
fromClass
- never nulldefault <A> BiConstraintStream<A,A> fromUniquePair(Class<A> fromClass, BiJoiner<A,A> joiner)
ConstraintFactory
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).
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 ConstraintFactory
A
- the type of the matched problem fact or planning entity
fromClass
- never nulljoiner
- never nullBiJoiner
is trueConstraintSessionFactory<Solution_> buildSessionFactory(Constraint[] constraints)
constraints
- never nullSolutionDescriptor<Solution_> getSolutionDescriptor()
Copyright © 2006–2021 JBoss by Red Hat. All rights reserved.