-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add concat operation to constraint streams #297
Conversation
cbdb6a4
to
25ae30e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I think we can still make the node itself more efficient.
Also, some minor comments. (Please make sure to apply them consistently in all cardinalities of streams.)
...src/main/java/ai/timefold/solver/constraint/streams/bavet/BavetConstraintSessionFactory.java
Outdated
Show resolved
Hide resolved
...ain/java/ai/timefold/solver/constraint/streams/bavet/bi/BavetAbstractBiConstraintStream.java
Outdated
Show resolved
Hide resolved
...-streams/src/main/java/ai/timefold/solver/constraint/streams/bavet/bi/BavetBiConcatNode.java
Show resolved
Hide resolved
...ams/src/main/java/ai/timefold/solver/constraint/streams/bavet/common/AbstractConcatNode.java
Outdated
Show resolved
Hide resolved
...ams/src/main/java/ai/timefold/solver/constraint/streams/bavet/common/AbstractConcatNode.java
Outdated
Show resolved
Hide resolved
...ams/src/main/java/ai/timefold/solver/constraint/streams/bavet/common/AbstractConcatNode.java
Outdated
Show resolved
Hide resolved
854717d
to
d2ddc19
Compare
...ain/java/ai/timefold/solver/constraint/streams/bavet/uni/BavetConcatUniConstraintStream.java
Outdated
Show resolved
Hide resolved
...src/main/java/ai/timefold/solver/constraint/streams/bavet/BavetConstraintSessionFactory.java
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/constraints-and-score/constraints-and-score.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/constraints-and-score/constraints-and-score.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/constraints-and-score/constraints-and-score.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/constraints-and-score/constraints-and-score.adoc
Outdated
Show resolved
Hide resolved
DONE: change text in image to use |
The concat operation acts as an or between two constraint streams, propogating both stream tuples' downstream. It appears update/retract may be called before an insert, meaning the out tuple stored inside the in tuple is not set. As such, for update, if the out tuple is not set, it does an insert instead, and for retract, it simply ignores the operation.
Concat is more similar to UNION ALL than OR.
Co-authored-by: Lukáš Petrovický <lukas@petrovicky.net>
61521ac
to
ce67093
Compare
…ing layer index for binary operations
This also removes the "minimumNumberOfAssignmentsNoAssignments" constraint since "minimumAndMaximumNumberOfAssignments" now handles that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the final set of comments as I re-read the docs.
I'll run my benchmarks overnight to see how it behaves, and then we can merge.
docs/src/modules/ROOT/pages/constraints-and-score/constraints-and-score.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/constraints-and-score/constraints-and-score.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/constraints-and-score/constraints-and-score.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/constraints-and-score/constraints-and-score.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/constraints-and-score/constraints-and-score.adoc
Outdated
Show resolved
Hide resolved
docs/src/modules/ROOT/pages/constraints-and-score/constraints-and-score.adoc
Outdated
Show resolved
Hide resolved
Co-authored-by: Lukáš Petrovický <lukas@petrovicky.net>
Previously, concat did not update the content of the cloned tuples in update. The `groupBy` and `map` building blocks both modify the contents of their tuples instead of creating new ones. As a result, concat was passing stale tuples with incorrect content downstream when placed after a `groupBy` or `map` building block. Now, the contents of the tuples are updated in update to prevent this issue. Co-authored-by: Lukáš Petrovický <lukas@petrovicky.net>
The concat operation acts as an or between two constraint streams, propogating both stream tuples' downstream. It appears update/retract may be called before an insert, meaning the out tuple stored inside the in tuple is not set. As such, for update, if the out tuple is not set, it does an insert instead, and for retract, it simply ignores the operation.