From dd3ba424d77048ccb97f986780dee9028b48fc03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Petrovick=C3=BD?= Date: Mon, 11 Nov 2024 15:31:22 +0100 Subject: [PATCH] WIP --- .../solver/core/api/score/stream/Joiners.java | 18 +- .../core/impl/bavet/AbstractSession.java | 56 ++++++ .../{score/stream => }/bavet/NodeNetwork.java | 27 +-- .../bavet/bi/AbstractGroupBiNode.java | 10 +- .../stream => }/bavet/bi/ConcatBiBiNode.java | 12 +- .../stream => }/bavet/bi/ConcatBiUniNode.java | 14 +- .../stream => }/bavet/bi/ConcatUniBiNode.java | 14 +- .../bavet/bi/ConditionalBiTupleLifecycle.java | 22 +++ .../bavet/bi/FlattenLastBiNode.java | 12 +- .../bi/Group0Mapping1CollectorBiNode.java | 8 +- .../bi/Group0Mapping2CollectorBiNode.java | 8 +- .../bi/Group0Mapping3CollectorBiNode.java | 8 +- .../bi/Group0Mapping4CollectorBiNode.java | 8 +- .../bi/Group1Mapping0CollectorBiNode.java | 10 +- .../bi/Group1Mapping1CollectorBiNode.java | 10 +- .../bi/Group1Mapping2CollectorBiNode.java | 10 +- .../bi/Group1Mapping3CollectorBiNode.java | 12 +- .../bi/Group2Mapping0CollectorBiNode.java | 8 +- .../bi/Group2Mapping1CollectorBiNode.java | 8 +- .../bi/Group2Mapping2CollectorBiNode.java | 8 +- .../bi/Group3Mapping0CollectorBiNode.java | 10 +- .../bi/Group3Mapping1CollectorBiNode.java | 8 +- .../bi/Group4Mapping0CollectorBiNode.java | 10 +- .../bavet/bi/IndexedIfExistsBiNode.java | 20 +- .../bavet/bi/IndexedJoinBiNode.java | 16 +- .../stream => }/bavet/bi/MapBiToBiNode.java | 12 +- .../stream => }/bavet/bi/MapBiToQuadNode.java | 14 +- .../stream => }/bavet/bi/MapBiToTriNode.java | 14 +- .../stream => }/bavet/bi/MapBiToUniNode.java | 14 +- .../bavet/bi/UnindexedIfExistsBiNode.java | 12 +- .../bavet/bi/UnindexedJoinBiNode.java | 12 +- .../bavet/common/AbstractConcatNode.java | 12 +- .../bavet/common/AbstractFlattenLastNode.java | 8 +- .../bavet/common/AbstractGroupNode.java | 8 +- .../bavet/common/AbstractIfExistsNode.java | 16 +- .../common/AbstractIndexedIfExistsNode.java | 16 +- .../bavet/common/AbstractIndexedJoinNode.java | 19 +- .../bavet/common/AbstractJoinNode.java | 14 +- .../bavet/common/AbstractMapNode.java | 8 +- .../bavet/common/AbstractNode.java | 2 +- .../common/AbstractNodeBuildHelper.java} | 92 ++++----- .../AbstractPropagationMetadataCarrier.java | 6 +- .../common/AbstractUnindexedIfExistsNode.java | 12 +- .../common/AbstractUnindexedJoinNode.java | 12 +- .../core/impl/bavet/common/BavetStream.java | 7 + .../common/BavetStreamBinaryOperation.java | 15 ++ .../bavet/common/DynamicPropagationQueue.java | 8 +- .../bavet/common/ExistsCounter.java | 6 +- .../stream => }/bavet/common/Group.java | 6 +- .../bavet/common/GroupNodeConstructor.java | 37 ++-- .../GroupNodeConstructorWithAccumulate.java | 22 +-- ...GroupNodeConstructorWithoutAccumulate.java | 20 +- .../bavet/common/PropagationQueue.java | 4 +- .../stream => }/bavet/common/Propagator.java | 2 +- .../bavet/common/StaticPropagationQueue.java | 8 +- .../core/impl/bavet/common/TupleSource.java | 4 + .../bavet/common/index/ComparisonIndexer.java | 4 +- .../bavet/common/index/EqualsIndexer.java | 2 +- .../bavet/common/index/IndexProperties.java | 2 +- .../bavet/common/index/Indexer.java | 4 +- .../bavet/common/index/IndexerFactory.java | 165 ++++++---------- .../bavet/common/index/IndexerKey.java | 2 +- .../common/index/ManyIndexProperties.java | 2 +- .../common/index/NoneIndexProperties.java | 2 +- .../bavet/common/index/NoneIndexer.java | 2 +- .../common/index/SingleIndexProperties.java | 2 +- .../common/index/ThreeIndexProperties.java | 2 +- .../common/index/TwoIndexProperties.java | 2 +- .../common/index/joiner}/AbstractJoiner.java | 7 +- .../common/index/joiner}/BiJoinerComber.java | 2 +- .../common/index/joiner}/DefaultBiJoiner.java | 4 +- .../index/joiner}/DefaultPentaJoiner.java | 4 +- .../index/joiner}/DefaultQuadJoiner.java | 4 +- .../index/joiner}/DefaultTriJoiner.java | 4 +- .../index/joiner}/FilteringBiJoiner.java | 2 +- .../index/joiner}/FilteringPentaJoiner.java | 2 +- .../index/joiner}/FilteringQuadJoiner.java | 2 +- .../index/joiner}/FilteringTriJoiner.java | 2 +- .../common/index/joiner}/JoinerType.java | 21 +-- .../index/joiner}/PentaJoinerComber.java | 2 +- .../index/joiner}/QuadJoinerComber.java | 2 +- .../common/index/joiner}/TriJoinerComber.java | 2 +- .../impl/bavet/common/index/package-info.java | 6 + .../bavet/common/package-info.java | 2 +- .../AbstractConditionalTupleLifecycle.java | 2 +- .../bavet/common/tuple/AbstractTuple.java | 2 +- .../tuple/AggregatedTupleLifecycle.java | 2 +- .../bavet/common/tuple/BiTuple.java | 2 +- .../common/tuple/LeftTupleLifecycle.java | 2 +- .../common/tuple/LeftTupleLifecycleImpl.java | 2 +- .../bavet/common/tuple/QuadTuple.java | 2 +- .../common/tuple/RightTupleLifecycle.java | 2 +- .../common/tuple/RightTupleLifecycleImpl.java | 2 +- .../bavet/common/tuple/TriTuple.java | 2 +- .../bavet/common/tuple/TupleLifecycle.java | 2 +- .../bavet/common/tuple/TupleState.java | 2 +- .../bavet/common/tuple/UniTuple.java | 2 +- .../bavet/quad/AbstractGroupQuadNode.java | 10 +- .../bavet/quad/ConcatBiQuadNode.java | 14 +- .../bavet/quad/ConcatQuadBiNode.java | 14 +- .../bavet/quad/ConcatQuadQuadNode.java | 12 +- .../bavet/quad/ConcatQuadTriNode.java | 15 +- .../bavet/quad/ConcatQuadUniNode.java | 14 +- .../bavet/quad/ConcatTriQuadNode.java | 15 +- .../bavet/quad/ConcatUniQuadNode.java | 14 +- .../quad/ConditionalQuadTupleLifecycle.java | 10 +- .../bavet/quad/FlattenLastQuadNode.java | 12 +- .../quad/Group0Mapping1CollectorQuadNode.java | 8 +- .../quad/Group0Mapping2CollectorQuadNode.java | 8 +- .../quad/Group0Mapping3CollectorQuadNode.java | 8 +- .../quad/Group0Mapping4CollectorQuadNode.java | 8 +- .../quad/Group1Mapping0CollectorQuadNode.java | 10 +- .../quad/Group1Mapping1CollectorQuadNode.java | 8 +- .../quad/Group1Mapping2CollectorQuadNode.java | 8 +- .../quad/Group1Mapping3CollectorQuadNode.java | 8 +- .../quad/Group2Mapping0CollectorQuadNode.java | 10 +- .../quad/Group2Mapping1CollectorQuadNode.java | 8 +- .../quad/Group2Mapping2CollectorQuadNode.java | 8 +- .../quad/Group3Mapping0CollectorQuadNode.java | 10 +- .../quad/Group3Mapping1CollectorQuadNode.java | 8 +- .../quad/Group4Mapping0CollectorQuadNode.java | 8 +- .../bavet/quad/IndexedIfExistsQuadNode.java | 20 +- .../bavet/quad/IndexedJoinQuadNode.java | 18 +- .../bavet/quad/MapQuadToBiNode.java | 14 +- .../bavet/quad/MapQuadToQuadNode.java | 12 +- .../bavet/quad/MapQuadToTriNode.java | 14 +- .../bavet/quad/MapQuadToUniNode.java | 14 +- .../bavet/quad/UnindexedIfExistsQuadNode.java | 12 +- .../bavet/quad/UnindexedJoinQuadNode.java | 14 +- .../bavet/tri/AbstractGroupTriNode.java | 10 +- .../bavet/tri/ConcatBiTriNode.java | 14 +- .../bavet/tri/ConcatTriBiNode.java | 14 +- .../bavet/tri/ConcatTriTriNode.java | 12 +- .../bavet/tri/ConcatTriUniNode.java | 14 +- .../bavet/tri/ConcatUniTriNode.java | 14 +- .../tri/ConditionalTriTupleLifecycle.java | 10 +- .../bavet/tri/FlattenLastTriNode.java | 12 +- .../tri/Group0Mapping1CollectorTriNode.java | 8 +- .../tri/Group0Mapping2CollectorTriNode.java | 8 +- .../tri/Group0Mapping3CollectorTriNode.java | 8 +- .../tri/Group0Mapping4CollectorTriNode.java | 8 +- .../tri/Group1Mapping0CollectorTriNode.java | 10 +- .../tri/Group1Mapping1CollectorTriNode.java | 8 +- .../tri/Group1Mapping2CollectorTriNode.java | 8 +- .../tri/Group1Mapping3CollectorTriNode.java | 8 +- .../tri/Group2Mapping0CollectorTriNode.java | 10 +- .../tri/Group2Mapping1CollectorTriNode.java | 8 +- .../tri/Group2Mapping2CollectorTriNode.java | 8 +- .../tri/Group3Mapping0CollectorTriNode.java | 8 +- .../tri/Group3Mapping1CollectorTriNode.java | 10 +- .../tri/Group4Mapping0CollectorTriNode.java | 10 +- .../bavet/tri/IndexedIfExistsTriNode.java | 20 +- .../bavet/tri/IndexedJoinTriNode.java | 18 +- .../stream => }/bavet/tri/MapTriToBiNode.java | 15 +- .../bavet/tri/MapTriToQuadNode.java | 14 +- .../bavet/tri/MapTriToTriNode.java | 13 +- .../bavet/tri/MapTriToUniNode.java | 14 +- .../bavet/tri/UnindexedIfExistsTriNode.java | 12 +- .../bavet/tri/UnindexedJoinTriNode.java | 14 +- .../bavet/uni/AbstractForEachUniNode.java | 40 ++-- .../bavet/uni/AbstractGroupUniNode.java | 10 +- .../bavet/uni/ConcatUniUniNode.java | 12 +- .../uni/ConditionalUniTupleLifecycle.java | 21 +++ .../bavet/uni/FlattenLastUniNode.java | 12 +- .../ForEachExcludingUnassignedUniNode.java | 19 +- .../bavet/uni/ForEachFromSolutionUniNode.java | 68 +++++++ .../impl/bavet/uni/ForEachStaticUniNode.java | 44 +++++ .../core/impl/bavet/uni/ForEachUniNode.java | 23 +++ .../uni/Group0Mapping1CollectorUniNode.java | 8 +- .../uni/Group0Mapping2CollectorUniNode.java | 8 +- .../uni/Group0Mapping3CollectorUniNode.java | 8 +- .../uni/Group0Mapping4CollectorUniNode.java | 8 +- .../uni/Group1Mapping0CollectorUniNode.java | 8 +- .../uni/Group1Mapping1CollectorUniNode.java | 10 +- .../uni/Group1Mapping2CollectorUniNode.java | 8 +- .../uni/Group1Mapping3CollectorUniNode.java | 10 +- .../uni/Group2Mapping0CollectorUniNode.java | 10 +- .../uni/Group2Mapping1CollectorUniNode.java | 10 +- .../uni/Group2Mapping2CollectorUniNode.java | 10 +- .../uni/Group3Mapping0CollectorUniNode.java | 10 +- .../uni/Group3Mapping1CollectorUniNode.java | 10 +- .../uni/Group4Mapping0CollectorUniNode.java | 10 +- .../bavet/uni/IndexedIfExistsUniNode.java | 16 +- .../stream => }/bavet/uni/MapUniToBiNode.java | 14 +- .../bavet/uni/MapUniToQuadNode.java | 14 +- .../bavet/uni/MapUniToTriNode.java | 14 +- .../bavet/uni/MapUniToUniNode.java | 12 +- .../bavet/uni/UnindexedIfExistsUniNode.java | 10 +- .../descriptor/ListVariableDescriptor.java | 21 ++- .../impl/move/dataset/AbstractDataStream.java | 76 ++++++++ .../move/dataset/AbstractUniDataStream.java | 85 +++++++++ .../core/impl/move/dataset/Dataset.java | 23 +++ .../impl/move/dataset/DatasetSession.java | 58 ++++++ .../move/dataset/DatasetSessionFactory.java | 13 ++ .../move/dataset/DefaultDatasetFactory.java | 134 +++++++++++++ .../move/dataset/FilterUniDataStream.java | 52 +++++ .../impl/move/dataset/ForEachDataStream.java | 113 +++++++++++ .../move/dataset/IfExistsUniDataStream.java | 117 ++++++++++++ .../core/impl/move/dataset/IndexedList.java | 81 ++++++++ .../BavetDataStreamBinaryOperation.java | 9 + .../common/BavetIfExistsDataStream.java | 5 + .../dataset/common/DataNodeBuildHelper.java | 14 ++ .../common/bridge/AftBridgeUniDataStream.java | 46 +++++ .../bridge/ForeBridgeUniDataStream.java | 28 +++ .../dataset/common/bridge/package-info.java | 14 ++ .../core/impl/move/director/MoveDirector.java | 36 +++- .../core/impl/move/generic/AbstractMove.java | 89 +++++++++ .../impl/move/generic/ChainedChangeMove.java | 56 ++++++ .../core/impl/move/generic/ChangeMove.java | 89 +++++++++ .../impl/move/generic/ListAssignMove.java | 63 +++++++ .../impl/move/generic/ListChangeMove.java | 178 ++++++++++++++++++ .../impl/move/generic/ListUnassignMove.java | 79 ++++++++ .../stream/bavet/BavetConstraintSession.java | 47 +---- .../bavet/BavetConstraintSessionFactory.java | 44 ++--- .../bi/BavetAbstractBiConstraintStream.java | 26 ++- .../bi/BavetBiConcatBiConstraintStream.java | 11 +- .../bi/BavetBiGroupBiConstraintStream.java | 12 +- .../bi/BavetBiMapBiConstraintStream.java | 5 +- .../bi/BavetFilterBiConstraintStream.java | 7 +- .../BavetFlattenLastBiConstraintStream.java | 9 +- .../bi/BavetIfExistsBiConstraintStream.java | 14 +- .../bavet/bi/BavetJoinBiConstraintStream.java | 14 +- .../bi/BavetQuadGroupBiConstraintStream.java | 12 +- .../bi/BavetQuadMapBiConstraintStream.java | 5 +- .../bi/BavetScoringBiConstraintStream.java | 4 +- .../bi/BavetTriGroupBiConstraintStream.java | 12 +- .../bi/BavetTriMapBiConstraintStream.java | 5 +- .../bi/BavetUniConcatBiConstraintStream.java | 12 +- .../bi/BavetUniGroupBiConstraintStream.java | 12 +- .../bi/BavetUniMapBiConstraintStream.java | 5 +- .../impl/score/stream/bavet/bi/BiScorer.java | 2 +- .../bavet/bi/ConditionalBiTupleLifecycle.java | 22 --- .../stream/bavet/common/AbstractScorer.java | 4 +- .../common/BavetAbstractConstraintStream.java | 4 +- .../common/BavetConcatConstraintStream.java | 4 +- .../BavetConstraintStreamBinaryOperation.java | 8 + .../common/BavetIfExistsConstraintStream.java | 2 +- .../common/BavetJoinConstraintStream.java | 16 +- .../common/BavetStreamBinaryOperation.java | 16 -- .../common/ConstraintNodeBuildHelper.java | 24 +++ .../stream/bavet/common/TupleSource.java | 4 - .../BavetAftBridgeBiConstraintStream.java | 6 +- .../BavetAftBridgeQuadConstraintStream.java | 6 +- .../BavetAftBridgeTriConstraintStream.java | 6 +- .../BavetAftBridgeUniConstraintStream.java | 6 +- .../BavetForeBridgeBiConstraintStream.java | 4 +- .../BavetForeBridgeQuadConstraintStream.java | 4 +- .../BavetForeBridgeTriConstraintStream.java | 4 +- .../BavetForeBridgeUniConstraintStream.java | 4 +- .../bavet/common/index/package-info.java | 6 - .../BavetAbstractQuadConstraintStream.java | 26 ++- .../BavetBiConcatQuadConstraintStream.java | 12 +- .../BavetBiGroupQuadConstraintStream.java | 12 +- .../quad/BavetBiMapQuadConstraintStream.java | 5 +- .../quad/BavetFilterQuadConstraintStream.java | 7 +- .../BavetFlattenLastQuadConstraintStream.java | 5 +- .../BavetIfExistsQuadConstraintStream.java | 14 +- .../quad/BavetJoinQuadConstraintStream.java | 14 +- .../BavetQuadConcatQuadConstraintStream.java | 11 +- .../BavetQuadGroupQuadConstraintStream.java | 12 +- .../BavetQuadMapQuadConstraintStream.java | 5 +- .../BavetScoringQuadConstraintStream.java | 4 +- .../BavetTriConcatQuadConstraintStream.java | 12 +- .../BavetTriGroupQuadConstraintStream.java | 12 +- .../quad/BavetTriMapQuadConstraintStream.java | 5 +- .../BavetUniConcatQuadConstraintStream.java | 12 +- .../BavetUniGroupQuadConstraintStream.java | 12 +- .../quad/BavetUniMapQuadConstraintStream.java | 5 +- .../score/stream/bavet/quad/QuadScorer.java | 2 +- .../tri/BavetAbstractTriConstraintStream.java | 36 ++-- .../tri/BavetBiConcatTriConstraintStream.java | 12 +- .../tri/BavetBiGroupTriConstraintStream.java | 12 +- .../tri/BavetBiMapTriConstraintStream.java | 5 +- .../tri/BavetFilterTriConstraintStream.java | 7 +- .../BavetFlattenLastTriConstraintStream.java | 5 +- .../tri/BavetIfExistsTriConstraintStream.java | 14 +- .../tri/BavetJoinTriConstraintStream.java | 14 +- .../BavetQuadGroupTriConstraintStream.java | 12 +- .../tri/BavetQuadMapTriConstraintStream.java | 5 +- .../tri/BavetScoringTriConstraintStream.java | 4 +- .../BavetTriConcatTriConstraintStream.java | 11 +- .../tri/BavetTriGroupTriConstraintStream.java | 12 +- .../tri/BavetTriMapTriConstraintStream.java | 5 +- .../BavetUniConcatTriConstraintStream.java | 12 +- .../tri/BavetUniGroupTriConstraintStream.java | 12 +- .../tri/BavetUniMapTriConstraintStream.java | 5 +- .../score/stream/bavet/tri/TriScorer.java | 2 +- .../uni/BavetAbstractUniConstraintStream.java | 36 ++-- .../uni/BavetBiGroupUniConstraintStream.java | 12 +- .../uni/BavetBiMapUniConstraintStream.java | 5 +- .../uni/BavetFilterUniConstraintStream.java | 7 +- .../BavetFlattenLastUniConstraintStream.java | 5 +- .../uni/BavetForEachUniConstraintStream.java | 14 +- .../uni/BavetIfExistsUniConstraintStream.java | 14 +- .../BavetQuadGroupUniConstraintStream.java | 12 +- .../uni/BavetQuadMapUniConstraintStream.java | 5 +- .../uni/BavetScoringUniConstraintStream.java | 4 +- .../uni/BavetTriGroupUniConstraintStream.java | 12 +- .../uni/BavetTriMapUniConstraintStream.java | 5 +- .../BavetUniConcatUniConstraintStream.java | 9 +- .../uni/BavetUniGroupUniConstraintStream.java | 12 +- .../uni/BavetUniMapUniConstraintStream.java | 5 +- .../uni/ConditionalUniTupleLifecycle.java | 21 --- .../ForEachIncludingUnassignedUniNode.java | 22 --- .../score/stream/bavet/uni/UniScorer.java | 2 +- .../common/AbstractConstraintStream.java | 3 +- .../stream/common/InnerConstraintFactory.java | 4 +- .../common/uni/InnerUniConstraintStream.java | 2 +- .../preview/api/move/BiMoveConstructor.java | 9 + .../core/preview/api/move/DataStream.java | 7 + .../solver/core/preview/api/move/Dataset.java | 4 + .../core/preview/api/move/DatasetFactory.java | 40 ++++ .../preview/api/move/MoveConstructor.java | 5 + .../core/preview/api/move/MoveProvider.java | 8 + .../preview/api/move/MutableSolutionView.java | 78 +++++++- .../solver/core/preview/api/move/Picker.java | 5 + .../preview/api/move/SolutionExtractor.java | 9 + .../core/preview/api/move/SolutionView.java | 4 +- .../core/preview/api/move/UniDataStream.java | 171 +++++++++++++++++ .../common/index/AbstractIndexerTest.java | 2 +- .../index/EqualsAndComparisonIndexerTest.java | 6 +- .../bavet/common/index/EqualsIndexerTest.java | 6 +- .../bavet/common/index/NoneIndexerTest.java | 4 +- .../common/index/joiner}/JoinerTypeTest.java | 18 +- .../common/index/joiner}/JoinersTest.java | 6 +- .../bavet/uni/FlattenLastUniNodeTest.java | 10 +- .../move/generic/list/ListChangeMoveTest.java | 2 +- .../impl/move/dataset/IndexedListTest.java | 110 +++++++++++ 328 files changed, 3640 insertions(+), 1571 deletions(-) create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/bavet/AbstractSession.java rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/NodeNetwork.java (73%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/AbstractGroupBiNode.java (82%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/ConcatBiBiNode.java (72%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/ConcatBiUniNode.java (70%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/ConcatUniBiNode.java (70%) create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConditionalBiTupleLifecycle.java rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/FlattenLastBiNode.java (57%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group0Mapping1CollectorBiNode.java (76%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group0Mapping2CollectorBiNode.java (84%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group0Mapping3CollectorBiNode.java (85%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group0Mapping4CollectorBiNode.java (86%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group1Mapping0CollectorBiNode.java (76%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group1Mapping1CollectorBiNode.java (73%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group1Mapping2CollectorBiNode.java (76%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group1Mapping3CollectorBiNode.java (73%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group2Mapping0CollectorBiNode.java (84%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group2Mapping1CollectorBiNode.java (81%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group2Mapping2CollectorBiNode.java (83%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group3Mapping0CollectorBiNode.java (82%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group3Mapping1CollectorBiNode.java (83%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/Group4Mapping0CollectorBiNode.java (84%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/IndexedIfExistsBiNode.java (76%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/IndexedJoinBiNode.java (76%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/MapBiToBiNode.java (69%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/MapBiToQuadNode.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/MapBiToTriNode.java (71%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/MapBiToUniNode.java (61%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/UnindexedIfExistsBiNode.java (72%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/bi/UnindexedJoinBiNode.java (79%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/AbstractConcatNode.java (92%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/AbstractFlattenLastNode.java (95%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/AbstractGroupNode.java (97%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/AbstractIfExistsNode.java (93%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/AbstractIndexedIfExistsNode.java (94%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/AbstractIndexedJoinNode.java (92%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/AbstractJoinNode.java (93%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/AbstractMapNode.java (89%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/AbstractNode.java (96%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/bavet/common/NodeBuildHelper.java => bavet/common/AbstractNodeBuildHelper.java} (55%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/AbstractPropagationMetadataCarrier.java (69%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/AbstractUnindexedIfExistsNode.java (93%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/AbstractUnindexedJoinNode.java (91%) create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/bavet/common/BavetStream.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/bavet/common/BavetStreamBinaryOperation.java rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/DynamicPropagationQueue.java (96%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/ExistsCounter.java (75%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/Group.java (92%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/GroupNodeConstructor.java (90%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/GroupNodeConstructorWithAccumulate.java (61%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/GroupNodeConstructorWithoutAccumulate.java (62%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/PropagationQueue.java (91%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/Propagator.java (98%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/StaticPropagationQueue.java (93%) create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/bavet/common/TupleSource.java rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/ComparisonIndexer.java (98%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/EqualsIndexer.java (97%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/IndexProperties.java (92%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/Indexer.java (90%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/IndexerFactory.java (74%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/IndexerKey.java (91%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/ManyIndexProperties.java (89%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/NoneIndexProperties.java (82%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/NoneIndexer.java (93%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/SingleIndexProperties.java (80%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/ThreeIndexProperties.java (85%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/TwoIndexProperties.java (84%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common => bavet/common/index/joiner}/AbstractJoiner.java (82%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common/bi => bavet/common/index/joiner}/BiJoinerComber.java (98%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common/bi => bavet/common/index/joiner}/DefaultBiJoiner.java (94%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common/penta => bavet/common/index/joiner}/DefaultPentaJoiner.java (94%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common/quad => bavet/common/index/joiner}/DefaultQuadJoiner.java (94%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common/tri => bavet/common/index/joiner}/DefaultTriJoiner.java (94%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common/bi => bavet/common/index/joiner}/FilteringBiJoiner.java (94%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common/penta => bavet/common/index/joiner}/FilteringPentaJoiner.java (95%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common/quad => bavet/common/index/joiner}/FilteringQuadJoiner.java (95%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common/tri => bavet/common/index/joiner}/FilteringTriJoiner.java (94%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => bavet/common/index/joiner}/JoinerType.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common/penta => bavet/common/index/joiner}/PentaJoinerComber.java (98%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common/quad => bavet/common/index/joiner}/QuadJoinerComber.java (98%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream/common/tri => bavet/common/index/joiner}/TriJoinerComber.java (98%) create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/package-info.java rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/package-info.java (87%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/AbstractConditionalTupleLifecycle.java (93%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/AbstractTuple.java (96%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/AggregatedTupleLifecycle.java (92%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/BiTuple.java (85%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/LeftTupleLifecycle.java (72%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/LeftTupleLifecycleImpl.java (91%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/QuadTuple.java (88%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/RightTupleLifecycle.java (72%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/RightTupleLifecycleImpl.java (91%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/TriTuple.java (87%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/TupleLifecycle.java (91%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/TupleState.java (91%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/tuple/UniTuple.java (82%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/AbstractGroupQuadNode.java (83%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/ConcatBiQuadNode.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/ConcatQuadBiNode.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/ConcatQuadQuadNode.java (76%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/ConcatQuadTriNode.java (75%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/ConcatQuadUniNode.java (76%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/ConcatTriQuadNode.java (75%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/ConcatUniQuadNode.java (76%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/ConditionalQuadTupleLifecycle.java (52%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/FlattenLastQuadNode.java (66%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group0Mapping1CollectorQuadNode.java (76%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group0Mapping2CollectorQuadNode.java (85%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group0Mapping3CollectorQuadNode.java (86%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group0Mapping4CollectorQuadNode.java (87%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group1Mapping0CollectorQuadNode.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group1Mapping1CollectorQuadNode.java (79%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group1Mapping2CollectorQuadNode.java (81%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group1Mapping3CollectorQuadNode.java (82%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group2Mapping0CollectorQuadNode.java (82%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group2Mapping1CollectorQuadNode.java (81%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group2Mapping2CollectorQuadNode.java (83%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group3Mapping0CollectorQuadNode.java (84%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group3Mapping1CollectorQuadNode.java (83%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/Group4Mapping0CollectorQuadNode.java (88%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/IndexedIfExistsQuadNode.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/IndexedJoinQuadNode.java (79%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/MapQuadToBiNode.java (71%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/MapQuadToQuadNode.java (83%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/MapQuadToTriNode.java (78%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/MapQuadToUniNode.java (64%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/UnindexedIfExistsQuadNode.java (73%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/quad/UnindexedJoinQuadNode.java (78%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/AbstractGroupTriNode.java (82%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/ConcatBiTriNode.java (75%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/ConcatTriBiNode.java (75%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/ConcatTriTriNode.java (72%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/ConcatTriUniNode.java (75%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/ConcatUniTriNode.java (75%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/ConditionalTriTupleLifecycle.java (51%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/FlattenLastTriNode.java (65%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group0Mapping1CollectorTriNode.java (76%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group0Mapping2CollectorTriNode.java (85%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group0Mapping3CollectorTriNode.java (86%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group0Mapping4CollectorTriNode.java (87%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group1Mapping0CollectorTriNode.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group1Mapping1CollectorTriNode.java (79%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group1Mapping2CollectorTriNode.java (81%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group1Mapping3CollectorTriNode.java (82%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group2Mapping0CollectorTriNode.java (81%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group2Mapping1CollectorTriNode.java (82%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group2Mapping2CollectorTriNode.java (83%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group3Mapping0CollectorTriNode.java (86%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group3Mapping1CollectorTriNode.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/Group4Mapping0CollectorTriNode.java (85%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/IndexedIfExistsTriNode.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/IndexedJoinTriNode.java (78%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/MapTriToBiNode.java (67%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/MapTriToQuadNode.java (80%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/MapTriToTriNode.java (78%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/MapTriToUniNode.java (63%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/UnindexedIfExistsTriNode.java (72%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/tri/UnindexedJoinTriNode.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/AbstractForEachUniNode.java (69%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/AbstractGroupUniNode.java (81%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/ConcatUniUniNode.java (70%) create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/bavet/uni/ConditionalUniTupleLifecycle.java rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/FlattenLastUniNode.java (57%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/ForEachExcludingUnassignedUniNode.java (65%) create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/bavet/uni/ForEachFromSolutionUniNode.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/bavet/uni/ForEachStaticUniNode.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/bavet/uni/ForEachUniNode.java rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group0Mapping1CollectorUniNode.java (76%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group0Mapping2CollectorUniNode.java (84%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group0Mapping3CollectorUniNode.java (85%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group0Mapping4CollectorUniNode.java (86%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group1Mapping0CollectorUniNode.java (79%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group1Mapping1CollectorUniNode.java (73%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group1Mapping2CollectorUniNode.java (81%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group1Mapping3CollectorUniNode.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group2Mapping0CollectorUniNode.java (80%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group2Mapping1CollectorUniNode.java (75%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group2Mapping2CollectorUniNode.java (78%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group3Mapping0CollectorUniNode.java (81%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group3Mapping1CollectorUniNode.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/Group4Mapping0CollectorUniNode.java (83%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/IndexedIfExistsUniNode.java (77%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/MapUniToBiNode.java (64%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/MapUniToQuadNode.java (76%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/MapUniToTriNode.java (69%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/MapUniToUniNode.java (62%) rename core/src/main/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/UnindexedIfExistsUniNode.java (75%) create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/AbstractDataStream.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/AbstractUniDataStream.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/Dataset.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/DatasetSession.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/DatasetSessionFactory.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/DefaultDatasetFactory.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/FilterUniDataStream.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/ForEachDataStream.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/IfExistsUniDataStream.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/IndexedList.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/common/BavetDataStreamBinaryOperation.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/common/BavetIfExistsDataStream.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/common/DataNodeBuildHelper.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/common/bridge/AftBridgeUniDataStream.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/common/bridge/ForeBridgeUniDataStream.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/dataset/common/bridge/package-info.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/generic/AbstractMove.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/generic/ChainedChangeMove.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/generic/ChangeMove.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/generic/ListAssignMove.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/generic/ListChangeMove.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/move/generic/ListUnassignMove.java delete mode 100644 core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/ConditionalBiTupleLifecycle.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/BavetConstraintStreamBinaryOperation.java delete mode 100644 core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/BavetStreamBinaryOperation.java create mode 100644 core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/ConstraintNodeBuildHelper.java delete mode 100644 core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/TupleSource.java delete mode 100644 core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/package-info.java delete mode 100644 core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/uni/ConditionalUniTupleLifecycle.java delete mode 100644 core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/uni/ForEachIncludingUnassignedUniNode.java create mode 100644 core/src/main/java/ai/timefold/solver/core/preview/api/move/BiMoveConstructor.java create mode 100644 core/src/main/java/ai/timefold/solver/core/preview/api/move/DataStream.java create mode 100644 core/src/main/java/ai/timefold/solver/core/preview/api/move/Dataset.java create mode 100644 core/src/main/java/ai/timefold/solver/core/preview/api/move/DatasetFactory.java create mode 100644 core/src/main/java/ai/timefold/solver/core/preview/api/move/MoveConstructor.java create mode 100644 core/src/main/java/ai/timefold/solver/core/preview/api/move/MoveProvider.java create mode 100644 core/src/main/java/ai/timefold/solver/core/preview/api/move/Picker.java create mode 100644 core/src/main/java/ai/timefold/solver/core/preview/api/move/SolutionExtractor.java create mode 100644 core/src/main/java/ai/timefold/solver/core/preview/api/move/UniDataStream.java rename core/src/test/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/AbstractIndexerTest.java (93%) rename core/src/test/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/EqualsAndComparisonIndexerTest.java (92%) rename core/src/test/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/EqualsIndexerTest.java (92%) rename core/src/test/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/common/index/NoneIndexerTest.java (94%) rename core/src/test/java/ai/timefold/solver/core/impl/{score/stream/common => bavet/common/index/joiner}/JoinerTypeTest.java (76%) rename core/src/test/java/ai/timefold/solver/core/impl/{score/stream/common => bavet/common/index/joiner}/JoinersTest.java (99%) rename core/src/test/java/ai/timefold/solver/core/impl/{score/stream => }/bavet/uni/FlattenLastUniNodeTest.java (94%) create mode 100644 core/src/test/java/ai/timefold/solver/core/impl/move/dataset/IndexedListTest.java diff --git a/core/src/main/java/ai/timefold/solver/core/api/score/stream/Joiners.java b/core/src/main/java/ai/timefold/solver/core/api/score/stream/Joiners.java index 72b737efbf..6f7183ef3d 100644 --- a/core/src/main/java/ai/timefold/solver/core/api/score/stream/Joiners.java +++ b/core/src/main/java/ai/timefold/solver/core/api/score/stream/Joiners.java @@ -15,15 +15,15 @@ import ai.timefold.solver.core.api.score.stream.quad.QuadJoiner; import ai.timefold.solver.core.api.score.stream.tri.TriJoiner; import ai.timefold.solver.core.api.score.stream.uni.UniConstraintStream; -import ai.timefold.solver.core.impl.score.stream.JoinerType; -import ai.timefold.solver.core.impl.score.stream.common.bi.DefaultBiJoiner; -import ai.timefold.solver.core.impl.score.stream.common.bi.FilteringBiJoiner; -import ai.timefold.solver.core.impl.score.stream.common.penta.DefaultPentaJoiner; -import ai.timefold.solver.core.impl.score.stream.common.penta.FilteringPentaJoiner; -import ai.timefold.solver.core.impl.score.stream.common.quad.DefaultQuadJoiner; -import ai.timefold.solver.core.impl.score.stream.common.quad.FilteringQuadJoiner; -import ai.timefold.solver.core.impl.score.stream.common.tri.DefaultTriJoiner; -import ai.timefold.solver.core.impl.score.stream.common.tri.FilteringTriJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.DefaultBiJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.DefaultPentaJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.DefaultQuadJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.DefaultTriJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.FilteringBiJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.FilteringPentaJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.FilteringQuadJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.FilteringTriJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.JoinerType; import ai.timefold.solver.core.impl.util.ConstantLambdaUtils; import org.jspecify.annotations.NonNull; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/bavet/AbstractSession.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/AbstractSession.java new file mode 100644 index 0000000000..a0eac1c62a --- /dev/null +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/AbstractSession.java @@ -0,0 +1,56 @@ +package ai.timefold.solver.core.impl.bavet; + +import java.util.IdentityHashMap; +import java.util.Map; + +import ai.timefold.solver.core.impl.bavet.uni.AbstractForEachUniNode; + +public abstract class AbstractSession { + + private final NodeNetwork nodeNetwork; + private final Map, AbstractForEachUniNode[]> effectiveClassToNodeArrayMap; + + protected AbstractSession(NodeNetwork nodeNetwork) { + this.nodeNetwork = nodeNetwork; + this.effectiveClassToNodeArrayMap = new IdentityHashMap<>(nodeNetwork.forEachNodeCount()); + } + + public final void insert(Object fact) { + var factClass = fact.getClass(); + for (var node : findNodes(factClass)) { + node.insert(fact); + } + } + + @SuppressWarnings("unchecked") + private AbstractForEachUniNode[] findNodes(Class factClass) { + // Map.computeIfAbsent() would have created lambdas on the hot path, this will not. + var nodeArray = effectiveClassToNodeArrayMap.get(factClass); + if (nodeArray == null) { + nodeArray = nodeNetwork.getForEachNodes(factClass) + .filter(AbstractForEachUniNode::supportsIndividualUpdates) + .toArray(AbstractForEachUniNode[]::new); + effectiveClassToNodeArrayMap.put(factClass, nodeArray); + } + return nodeArray; + } + + public final void update(Object fact) { + var factClass = fact.getClass(); + for (var node : findNodes(factClass)) { + node.update(fact); + } + } + + public final void retract(Object fact) { + var factClass = fact.getClass(); + for (var node : findNodes(factClass)) { + node.retract(fact); + } + } + + protected void settle() { + nodeNetwork.settle(); + } + +} diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/NodeNetwork.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/NodeNetwork.java similarity index 73% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/NodeNetwork.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/NodeNetwork.java index 83511b5ecf..63fec53a90 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/NodeNetwork.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/NodeNetwork.java @@ -1,12 +1,13 @@ -package ai.timefold.solver.core.impl.score.stream.bavet; +package ai.timefold.solver.core.impl.bavet; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.stream.Stream; -import ai.timefold.solver.core.impl.score.stream.bavet.common.Propagator; -import ai.timefold.solver.core.impl.score.stream.bavet.uni.AbstractForEachUniNode; +import ai.timefold.solver.core.impl.bavet.common.Propagator; +import ai.timefold.solver.core.impl.bavet.uni.AbstractForEachUniNode; /** * Represents Bavet's network of nodes, specific to a particular session. @@ -17,7 +18,7 @@ * @param layeredNodes nodes grouped first by their layer, then by their index within the layer; * propagation needs to happen in this order. */ -record NodeNetwork(Map, List>> declaredClassToNodeMap, Propagator[][] layeredNodes) { +public record NodeNetwork(Map, List>> declaredClassToNodeMap, Propagator[][] layeredNodes) { public static final NodeNetwork EMPTY = new NodeNetwork(Map.of(), new Propagator[0][0]); @@ -29,23 +30,27 @@ public int layerCount() { return layeredNodes.length; } - @SuppressWarnings("unchecked") - public AbstractForEachUniNode[] getApplicableForEachNodes(Class factClass) { + public Stream> getForEachNodes() { + return declaredClassToNodeMap.values() + .stream() + .flatMap(List::stream); + } + + public Stream> getForEachNodes(Class factClass) { return declaredClassToNodeMap.entrySet() .stream() .filter(entry -> entry.getKey().isAssignableFrom(factClass)) .map(Map.Entry::getValue) - .flatMap(List::stream) - .toArray(AbstractForEachUniNode[]::new); + .flatMap(List::stream); } - public void propagate() { + public void settle() { for (var layerIndex = 0; layerIndex < layerCount(); layerIndex++) { - propagateInLayer(layeredNodes[layerIndex]); + settleLayer(layeredNodes[layerIndex]); } } - private static void propagateInLayer(Propagator[] nodesInLayer) { + private static void settleLayer(Propagator[] nodesInLayer) { var nodeCount = nodesInLayer.length; if (nodeCount == 1) { nodesInLayer[0].propagateEverything(); diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/AbstractGroupBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/AbstractGroupBiNode.java similarity index 82% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/AbstractGroupBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/AbstractGroupBiNode.java index 974e4959ac..425fba808c 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/AbstractGroupBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/AbstractGroupBiNode.java @@ -1,14 +1,14 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.Function; import ai.timefold.solver.core.api.function.TriFunction; import ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractGroupNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.AbstractGroupNode; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; abstract class AbstractGroupBiNode extends AbstractGroupNode, OutTuple_, GroupKey_, ResultContainer_, Result_> { diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/ConcatBiBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConcatBiBiNode.java similarity index 72% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/ConcatBiBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConcatBiBiNode.java index d885bc9bbe..27dcbaf79a 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/ConcatBiBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConcatBiBiNode.java @@ -1,13 +1,13 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractConcatNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.AbstractConcatNode; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; -final class ConcatBiBiNode +public final class ConcatBiBiNode extends AbstractConcatNode, BiTuple, BiTuple> { - ConcatBiBiNode(TupleLifecycle> nextNodesTupleLifecycle, + public ConcatBiBiNode(TupleLifecycle> nextNodesTupleLifecycle, int inputStoreIndexLeftOutTupleList, int inputStoreIndexRightOutTupleList, int outputStoreSize) { super(nextNodesTupleLifecycle, inputStoreIndexLeftOutTupleList, inputStoreIndexRightOutTupleList, outputStoreSize); diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/ConcatBiUniNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConcatBiUniNode.java similarity index 70% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/ConcatBiUniNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConcatBiUniNode.java index ced700f1f7..02e37019c0 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/ConcatBiUniNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConcatBiUniNode.java @@ -1,18 +1,18 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.Function; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractConcatNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.AbstractConcatNode; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; -final class ConcatBiUniNode +public final class ConcatBiUniNode extends AbstractConcatNode, UniTuple, BiTuple> { private final Function paddingFunction; - ConcatBiUniNode(Function paddingFunction, TupleLifecycle> nextNodesTupleLifecycle, + public ConcatBiUniNode(Function paddingFunction, TupleLifecycle> nextNodesTupleLifecycle, int inputStoreIndexLeftOutTupleList, int inputStoreIndexRightOutTupleList, int outputStoreSize) { super(nextNodesTupleLifecycle, inputStoreIndexLeftOutTupleList, inputStoreIndexRightOutTupleList, outputStoreSize); diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/ConcatUniBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConcatUniBiNode.java similarity index 70% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/ConcatUniBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConcatUniBiNode.java index b36377bf25..700ad1c2cc 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/ConcatUniBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConcatUniBiNode.java @@ -1,18 +1,18 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.Function; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractConcatNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.AbstractConcatNode; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; -final class ConcatUniBiNode +public final class ConcatUniBiNode extends AbstractConcatNode, BiTuple, BiTuple> { private final Function paddingFunction; - ConcatUniBiNode(Function paddingFunction, TupleLifecycle> nextNodesTupleLifecycle, + public ConcatUniBiNode(Function paddingFunction, TupleLifecycle> nextNodesTupleLifecycle, int inputStoreIndexLeftOutTupleList, int inputStoreIndexRightOutTupleList, int outputStoreSize) { super(nextNodesTupleLifecycle, inputStoreIndexLeftOutTupleList, inputStoreIndexRightOutTupleList, diff --git a/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConditionalBiTupleLifecycle.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConditionalBiTupleLifecycle.java new file mode 100644 index 0000000000..0c29475c44 --- /dev/null +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/ConditionalBiTupleLifecycle.java @@ -0,0 +1,22 @@ +package ai.timefold.solver.core.impl.bavet.bi; + +import java.util.function.BiPredicate; + +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractConditionalTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; + +public final class ConditionalBiTupleLifecycle extends AbstractConditionalTupleLifecycle> { + private final BiPredicate predicate; + + public ConditionalBiTupleLifecycle(BiPredicate predicate, TupleLifecycle> tupleLifecycle) { + super(tupleLifecycle); + this.predicate = predicate; + } + + @Override + protected boolean test(BiTuple tuple) { + return predicate.test(tuple.factA, tuple.factB); + } + +} diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/FlattenLastBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/FlattenLastBiNode.java similarity index 57% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/FlattenLastBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/FlattenLastBiNode.java index 412fa6ed17..a6a18c6667 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/FlattenLastBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/FlattenLastBiNode.java @@ -1,16 +1,16 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.Function; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractFlattenLastNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.AbstractFlattenLastNode; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; -final class FlattenLastBiNode extends AbstractFlattenLastNode, BiTuple, B, NewB> { +public final class FlattenLastBiNode extends AbstractFlattenLastNode, BiTuple, B, NewB> { private final int outputStoreSize; - FlattenLastBiNode(int flattenLastStoreIndex, Function> mappingFunction, + public FlattenLastBiNode(int flattenLastStoreIndex, Function> mappingFunction, TupleLifecycle> nextNodesTupleLifecycle, int outputStoreSize) { super(flattenLastStoreIndex, mappingFunction, nextNodesTupleLifecycle); this.outputStoreSize = outputStoreSize; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group0Mapping1CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group0Mapping1CollectorBiNode.java similarity index 76% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group0Mapping1CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group0Mapping1CollectorBiNode.java index dcfb799ddf..2fff40a8e1 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group0Mapping1CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group0Mapping1CollectorBiNode.java @@ -1,11 +1,11 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; -final class Group0Mapping1CollectorBiNode +public final class Group0Mapping1CollectorBiNode extends AbstractGroupBiNode, Void, ResultContainer_, A> { private final int outputStoreSize; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group0Mapping2CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group0Mapping2CollectorBiNode.java similarity index 84% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group0Mapping2CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group0Mapping2CollectorBiNode.java index fd9a12fea7..28493700fa 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group0Mapping2CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group0Mapping2CollectorBiNode.java @@ -1,13 +1,13 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import ai.timefold.solver.core.api.score.stream.ConstraintCollectors; import ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; import ai.timefold.solver.core.impl.util.Pair; -final class Group0Mapping2CollectorBiNode +public final class Group0Mapping2CollectorBiNode extends AbstractGroupBiNode, Void, Object, Pair> { private final int outputStoreSize; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group0Mapping3CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group0Mapping3CollectorBiNode.java similarity index 85% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group0Mapping3CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group0Mapping3CollectorBiNode.java index d0f6ea2cce..4c2e3d86fd 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group0Mapping3CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group0Mapping3CollectorBiNode.java @@ -1,13 +1,13 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import ai.timefold.solver.core.api.score.stream.ConstraintCollectors; import ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TriTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TriTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; import ai.timefold.solver.core.impl.util.Triple; -final class Group0Mapping3CollectorBiNode +public final class Group0Mapping3CollectorBiNode extends AbstractGroupBiNode, Void, Object, Triple> { private final int outputStoreSize; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group0Mapping4CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group0Mapping4CollectorBiNode.java similarity index 86% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group0Mapping4CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group0Mapping4CollectorBiNode.java index a4dcea39dd..8d369e2f6c 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group0Mapping4CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group0Mapping4CollectorBiNode.java @@ -1,13 +1,13 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import ai.timefold.solver.core.api.score.stream.ConstraintCollectors; import ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.QuadTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.QuadTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; import ai.timefold.solver.core.impl.util.Quadruple; -final class Group0Mapping4CollectorBiNode +public final class Group0Mapping4CollectorBiNode extends AbstractGroupBiNode, Void, Object, Quadruple> { diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group1Mapping0CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group1Mapping0CollectorBiNode.java similarity index 76% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group1Mapping0CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group1Mapping0CollectorBiNode.java index 2aebf6017a..8da5045ac1 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group1Mapping0CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group1Mapping0CollectorBiNode.java @@ -1,13 +1,13 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.BiFunction; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; -final class Group1Mapping0CollectorBiNode +public final class Group1Mapping0CollectorBiNode extends AbstractGroupBiNode, A, Void, Void> { private final int outputStoreSize; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group1Mapping1CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group1Mapping1CollectorBiNode.java similarity index 73% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group1Mapping1CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group1Mapping1CollectorBiNode.java index 181471360f..17f13c6e3c 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group1Mapping1CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group1Mapping1CollectorBiNode.java @@ -1,15 +1,15 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; -import static ai.timefold.solver.core.impl.score.stream.bavet.bi.Group1Mapping0CollectorBiNode.createGroupKey; +import static ai.timefold.solver.core.impl.bavet.bi.Group1Mapping0CollectorBiNode.createGroupKey; import java.util.function.BiFunction; import ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; -final class Group1Mapping1CollectorBiNode +public final class Group1Mapping1CollectorBiNode extends AbstractGroupBiNode, A, ResultContainer_, B> { private final int outputStoreSize; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group1Mapping2CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group1Mapping2CollectorBiNode.java similarity index 76% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group1Mapping2CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group1Mapping2CollectorBiNode.java index 0f7a558993..8a95f69eb2 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group1Mapping2CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group1Mapping2CollectorBiNode.java @@ -1,16 +1,16 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; -import static ai.timefold.solver.core.impl.score.stream.bavet.bi.Group1Mapping0CollectorBiNode.createGroupKey; +import static ai.timefold.solver.core.impl.bavet.bi.Group1Mapping0CollectorBiNode.createGroupKey; import java.util.function.BiFunction; import ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TriTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TriTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; import ai.timefold.solver.core.impl.util.Pair; -final class Group1Mapping2CollectorBiNode +public final class Group1Mapping2CollectorBiNode extends AbstractGroupBiNode, A, Object, Pair> { private final int outputStoreSize; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group1Mapping3CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group1Mapping3CollectorBiNode.java similarity index 73% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group1Mapping3CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group1Mapping3CollectorBiNode.java index 3850eae451..62f5ae9b64 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group1Mapping3CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group1Mapping3CollectorBiNode.java @@ -1,17 +1,17 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; -import static ai.timefold.solver.core.impl.score.stream.bavet.bi.Group0Mapping3CollectorBiNode.mergeCollectors; -import static ai.timefold.solver.core.impl.score.stream.bavet.bi.Group1Mapping0CollectorBiNode.createGroupKey; +import static ai.timefold.solver.core.impl.bavet.bi.Group0Mapping3CollectorBiNode.mergeCollectors; +import static ai.timefold.solver.core.impl.bavet.bi.Group1Mapping0CollectorBiNode.createGroupKey; import java.util.function.BiFunction; import ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.QuadTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.QuadTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; import ai.timefold.solver.core.impl.util.Triple; -final class Group1Mapping3CollectorBiNode +public final class Group1Mapping3CollectorBiNode extends AbstractGroupBiNode, A, Object, Triple> { private final int outputStoreSize; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group2Mapping0CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group2Mapping0CollectorBiNode.java similarity index 84% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group2Mapping0CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group2Mapping0CollectorBiNode.java index 8ee27566f2..f567f84639 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group2Mapping0CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group2Mapping0CollectorBiNode.java @@ -1,13 +1,13 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.BiFunction; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; import ai.timefold.solver.core.impl.util.Pair; -final class Group2Mapping0CollectorBiNode +public final class Group2Mapping0CollectorBiNode extends AbstractGroupBiNode, Pair, Void, Void> { private final int outputStoreSize; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group2Mapping1CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group2Mapping1CollectorBiNode.java similarity index 81% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group2Mapping1CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group2Mapping1CollectorBiNode.java index d47d6819c7..d18b55c937 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group2Mapping1CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group2Mapping1CollectorBiNode.java @@ -1,14 +1,14 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.BiFunction; import ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TriTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TriTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; import ai.timefold.solver.core.impl.util.Pair; -final class Group2Mapping1CollectorBiNode +public final class Group2Mapping1CollectorBiNode extends AbstractGroupBiNode, Pair, ResultContainer_, C> { private final int outputStoreSize; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group2Mapping2CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group2Mapping2CollectorBiNode.java similarity index 83% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group2Mapping2CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group2Mapping2CollectorBiNode.java index 5ee56b9925..0d07488ce4 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group2Mapping2CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group2Mapping2CollectorBiNode.java @@ -1,14 +1,14 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.BiFunction; import ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.QuadTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.QuadTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; import ai.timefold.solver.core.impl.util.Pair; -final class Group2Mapping2CollectorBiNode +public final class Group2Mapping2CollectorBiNode extends AbstractGroupBiNode, Pair, Object, Pair> { diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group3Mapping0CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group3Mapping0CollectorBiNode.java similarity index 82% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group3Mapping0CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group3Mapping0CollectorBiNode.java index 306cfc077e..ea313a7dd0 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group3Mapping0CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group3Mapping0CollectorBiNode.java @@ -1,14 +1,14 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.BiFunction; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TriTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TriTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; import ai.timefold.solver.core.impl.util.Triple; -final class Group3Mapping0CollectorBiNode +public final class Group3Mapping0CollectorBiNode extends AbstractGroupBiNode, Triple, Void, Void> { private final int outputStoreSize; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group3Mapping1CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group3Mapping1CollectorBiNode.java similarity index 83% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group3Mapping1CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group3Mapping1CollectorBiNode.java index e5fbf370dc..3d768ee557 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group3Mapping1CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group3Mapping1CollectorBiNode.java @@ -1,14 +1,14 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.BiFunction; import ai.timefold.solver.core.api.score.stream.bi.BiConstraintCollector; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.QuadTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.QuadTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; import ai.timefold.solver.core.impl.util.Triple; -final class Group3Mapping1CollectorBiNode +public final class Group3Mapping1CollectorBiNode extends AbstractGroupBiNode, Triple, ResultContainer_, D> { diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group4Mapping0CollectorBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group4Mapping0CollectorBiNode.java similarity index 84% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group4Mapping0CollectorBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group4Mapping0CollectorBiNode.java index 76dafa42b2..7220bdacd9 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/Group4Mapping0CollectorBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/Group4Mapping0CollectorBiNode.java @@ -1,14 +1,14 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.BiFunction; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.QuadTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.QuadTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; import ai.timefold.solver.core.impl.util.Quadruple; -final class Group4Mapping0CollectorBiNode +public final class Group4Mapping0CollectorBiNode extends AbstractGroupBiNode, Quadruple, Void, Void> { diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/IndexedIfExistsBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/IndexedIfExistsBiNode.java similarity index 76% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/IndexedIfExistsBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/IndexedIfExistsBiNode.java index 5a6fcff1d2..1cdcc2a14f 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/IndexedIfExistsBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/IndexedIfExistsBiNode.java @@ -1,18 +1,18 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.BiFunction; import java.util.function.Function; import ai.timefold.solver.core.api.function.TriPredicate; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractIndexedIfExistsNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.ExistsCounter; -import ai.timefold.solver.core.impl.score.stream.bavet.common.index.IndexProperties; -import ai.timefold.solver.core.impl.score.stream.bavet.common.index.Indexer; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; - -final class IndexedIfExistsBiNode extends AbstractIndexedIfExistsNode, C> { +import ai.timefold.solver.core.impl.bavet.common.AbstractIndexedIfExistsNode; +import ai.timefold.solver.core.impl.bavet.common.ExistsCounter; +import ai.timefold.solver.core.impl.bavet.common.index.IndexProperties; +import ai.timefold.solver.core.impl.bavet.common.index.Indexer; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; + +public final class IndexedIfExistsBiNode extends AbstractIndexedIfExistsNode, C> { private final BiFunction mappingAB; private final TriPredicate filtering; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/IndexedJoinBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/IndexedJoinBiNode.java similarity index 76% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/IndexedJoinBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/IndexedJoinBiNode.java index c3916cbfe8..7050b0a182 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/IndexedJoinBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/IndexedJoinBiNode.java @@ -1,16 +1,16 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.BiPredicate; import java.util.function.Function; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractIndexedJoinNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.index.IndexProperties; -import ai.timefold.solver.core.impl.score.stream.bavet.common.index.Indexer; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.AbstractIndexedJoinNode; +import ai.timefold.solver.core.impl.bavet.common.index.IndexProperties; +import ai.timefold.solver.core.impl.bavet.common.index.Indexer; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; -final class IndexedJoinBiNode extends AbstractIndexedJoinNode, B, BiTuple> { +public final class IndexedJoinBiNode extends AbstractIndexedJoinNode, B, BiTuple> { private final Function mappingA; private final BiPredicate filtering; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/MapBiToBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/MapBiToBiNode.java similarity index 69% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/MapBiToBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/MapBiToBiNode.java index afb24481f1..63bf37bfc6 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/MapBiToBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/MapBiToBiNode.java @@ -1,18 +1,18 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.Objects; import java.util.function.BiFunction; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractMapNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.AbstractMapNode; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; -final class MapBiToBiNode extends AbstractMapNode, BiTuple> { +public final class MapBiToBiNode extends AbstractMapNode, BiTuple> { private final BiFunction mappingFunctionA; private final BiFunction mappingFunctionB; - MapBiToBiNode(int mapStoreIndex, BiFunction mappingFunctionA, BiFunction mappingFunctionB, + public MapBiToBiNode(int mapStoreIndex, BiFunction mappingFunctionA, BiFunction mappingFunctionB, TupleLifecycle> nextNodesTupleLifecycle, int outputStoreSize) { super(mapStoreIndex, nextNodesTupleLifecycle, outputStoreSize); this.mappingFunctionA = Objects.requireNonNull(mappingFunctionA); diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/MapBiToQuadNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/MapBiToQuadNode.java similarity index 77% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/MapBiToQuadNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/MapBiToQuadNode.java index 28d12ab08a..42e314f411 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/MapBiToQuadNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/MapBiToQuadNode.java @@ -1,14 +1,14 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.Objects; import java.util.function.BiFunction; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractMapNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.QuadTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.AbstractMapNode; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.QuadTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; -final class MapBiToQuadNode +public final class MapBiToQuadNode extends AbstractMapNode, QuadTuple> { private final BiFunction mappingFunctionA; @@ -16,7 +16,7 @@ final class MapBiToQuadNode private final BiFunction mappingFunctionC; private final BiFunction mappingFunctionD; - MapBiToQuadNode(int mapStoreIndex, BiFunction mappingFunctionA, BiFunction mappingFunctionB, + public MapBiToQuadNode(int mapStoreIndex, BiFunction mappingFunctionA, BiFunction mappingFunctionB, BiFunction mappingFunctionC, BiFunction mappingFunctionD, TupleLifecycle> nextNodesTupleLifecycle, int outputStoreSize) { super(mapStoreIndex, nextNodesTupleLifecycle, outputStoreSize); diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/MapBiToTriNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/MapBiToTriNode.java similarity index 71% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/MapBiToTriNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/MapBiToTriNode.java index 01519f102f..e745fd8338 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/MapBiToTriNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/MapBiToTriNode.java @@ -1,20 +1,20 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.Objects; import java.util.function.BiFunction; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractMapNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TriTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.AbstractMapNode; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TriTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; -final class MapBiToTriNode extends AbstractMapNode, TriTuple> { +public final class MapBiToTriNode extends AbstractMapNode, TriTuple> { private final BiFunction mappingFunctionA; private final BiFunction mappingFunctionB; private final BiFunction mappingFunctionC; - MapBiToTriNode(int mapStoreIndex, BiFunction mappingFunctionA, BiFunction mappingFunctionB, + public MapBiToTriNode(int mapStoreIndex, BiFunction mappingFunctionA, BiFunction mappingFunctionB, BiFunction mappingFunctionC, TupleLifecycle> nextNodesTupleLifecycle, int outputStoreSize) { super(mapStoreIndex, nextNodesTupleLifecycle, outputStoreSize); diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/MapBiToUniNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/MapBiToUniNode.java similarity index 61% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/MapBiToUniNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/MapBiToUniNode.java index 7254443bd6..1462b7ce36 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/MapBiToUniNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/MapBiToUniNode.java @@ -1,18 +1,18 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.Objects; import java.util.function.BiFunction; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractMapNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.AbstractMapNode; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; -final class MapBiToUniNode extends AbstractMapNode, UniTuple> { +public final class MapBiToUniNode extends AbstractMapNode, UniTuple> { private final BiFunction mappingFunction; - MapBiToUniNode(int mapStoreIndex, BiFunction mappingFunction, + public MapBiToUniNode(int mapStoreIndex, BiFunction mappingFunction, TupleLifecycle> nextNodesTupleLifecycle, int outputStoreSize) { super(mapStoreIndex, nextNodesTupleLifecycle, outputStoreSize); this.mappingFunction = Objects.requireNonNull(mappingFunction); diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/UnindexedIfExistsBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/UnindexedIfExistsBiNode.java similarity index 72% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/UnindexedIfExistsBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/UnindexedIfExistsBiNode.java index 56266da801..7316766738 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/UnindexedIfExistsBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/UnindexedIfExistsBiNode.java @@ -1,12 +1,12 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import ai.timefold.solver.core.api.function.TriPredicate; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractUnindexedIfExistsNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.AbstractUnindexedIfExistsNode; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; -final class UnindexedIfExistsBiNode extends AbstractUnindexedIfExistsNode, C> { +public final class UnindexedIfExistsBiNode extends AbstractUnindexedIfExistsNode, C> { private final TriPredicate filtering; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/UnindexedJoinBiNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/UnindexedJoinBiNode.java similarity index 79% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/UnindexedJoinBiNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/UnindexedJoinBiNode.java index 1e572325d6..ebd0cd9c72 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/bi/UnindexedJoinBiNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/bi/UnindexedJoinBiNode.java @@ -1,13 +1,13 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.bi; +package ai.timefold.solver.core.impl.bavet.bi; import java.util.function.BiPredicate; -import ai.timefold.solver.core.impl.score.stream.bavet.common.AbstractUnindexedJoinNode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.BiTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.AbstractUnindexedJoinNode; +import ai.timefold.solver.core.impl.bavet.common.tuple.BiTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; -final class UnindexedJoinBiNode +public final class UnindexedJoinBiNode extends AbstractUnindexedJoinNode, B, BiTuple> { private final BiPredicate filtering; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractConcatNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractConcatNode.java similarity index 92% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractConcatNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractConcatNode.java index f6307c5b23..3f470f8759 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractConcatNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractConcatNode.java @@ -1,10 +1,10 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.LeftTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.RightTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.LeftTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.RightTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; /** * Implements the concat operation. Concat cannot be implemented as a pass-through operation because of two caveats: diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractFlattenLastNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractFlattenLastNode.java similarity index 95% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractFlattenLastNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractFlattenLastNode.java index a6e47a4833..f9b1e7310c 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractFlattenLastNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractFlattenLastNode.java @@ -1,4 +1,4 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import java.util.ArrayList; import java.util.Collection; @@ -8,9 +8,9 @@ import java.util.Objects; import java.util.function.Function; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; public abstract class AbstractFlattenLastNode extends AbstractNode diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractGroupNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractGroupNode.java similarity index 97% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractGroupNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractGroupNode.java index 84084f97bb..70683f359e 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractGroupNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractGroupNode.java @@ -1,4 +1,4 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import java.util.HashMap; import java.util.Map; @@ -7,9 +7,9 @@ import java.util.function.Supplier; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; public abstract class AbstractGroupNode extends AbstractNode diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractIfExistsNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractIfExistsNode.java similarity index 93% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractIfExistsNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractIfExistsNode.java index 775055c78f..37b4b73700 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractIfExistsNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractIfExistsNode.java @@ -1,11 +1,11 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; - -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.LeftTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.RightTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +package ai.timefold.solver.core.impl.bavet.common; + +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.LeftTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.RightTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; import ai.timefold.solver.core.impl.util.ElementAwareList; import ai.timefold.solver.core.impl.util.ElementAwareListEntry; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractIndexedIfExistsNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractIndexedIfExistsNode.java similarity index 94% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractIndexedIfExistsNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractIndexedIfExistsNode.java index a6830ab0d8..a4f93e1ff9 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractIndexedIfExistsNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractIndexedIfExistsNode.java @@ -1,14 +1,14 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import java.util.function.Function; -import ai.timefold.solver.core.impl.score.stream.bavet.common.index.IndexProperties; -import ai.timefold.solver.core.impl.score.stream.bavet.common.index.Indexer; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.LeftTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.RightTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.index.IndexProperties; +import ai.timefold.solver.core.impl.bavet.common.index.Indexer; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.LeftTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.RightTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; import ai.timefold.solver.core.impl.util.ElementAwareList; import ai.timefold.solver.core.impl.util.ElementAwareListEntry; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractIndexedJoinNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractIndexedJoinNode.java similarity index 92% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractIndexedJoinNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractIndexedJoinNode.java index cfa1ccc8c1..0d21a6d0d8 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractIndexedJoinNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractIndexedJoinNode.java @@ -1,14 +1,14 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import java.util.function.Function; -import ai.timefold.solver.core.impl.score.stream.bavet.common.index.IndexProperties; -import ai.timefold.solver.core.impl.score.stream.bavet.common.index.Indexer; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.LeftTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.RightTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.index.IndexProperties; +import ai.timefold.solver.core.impl.bavet.common.index.Indexer; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.LeftTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.RightTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; import ai.timefold.solver.core.impl.util.ElementAwareList; import ai.timefold.solver.core.impl.util.ElementAwareListEntry; @@ -28,9 +28,6 @@ public abstract class AbstractIndexedJoinNode indexerLeft; private final Indexer> indexerRight; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractJoinNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractJoinNode.java similarity index 93% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractJoinNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractJoinNode.java index 2c9baabe9d..e4a73b837a 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractJoinNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractJoinNode.java @@ -1,13 +1,13 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import java.util.function.Consumer; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.LeftTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.RightTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.LeftTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.RightTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; import ai.timefold.solver.core.impl.util.ElementAwareList; import ai.timefold.solver.core.impl.util.ElementAwareListEntry; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractMapNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractMapNode.java similarity index 89% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractMapNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractMapNode.java index eb45063319..16e0cbfde7 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractMapNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractMapNode.java @@ -1,8 +1,8 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; public abstract class AbstractMapNode extends AbstractNode diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractNode.java similarity index 96% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractNode.java index 3fb7a0b759..f218a22520 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractNode.java @@ -1,4 +1,4 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import ai.timefold.solver.core.impl.score.stream.bavet.BavetConstraintSession; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/NodeBuildHelper.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractNodeBuildHelper.java similarity index 55% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/NodeBuildHelper.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractNodeBuildHelper.java index b4663acab6..141c0f5e27 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/NodeBuildHelper.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractNodeBuildHelper.java @@ -1,4 +1,4 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import java.util.ArrayList; import java.util.Collections; @@ -8,30 +8,24 @@ import java.util.Set; import java.util.function.Function; -import ai.timefold.solver.core.api.score.Score; -import ai.timefold.solver.core.api.score.stream.ConstraintStream; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractConditionalTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.LeftTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.RightTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.uni.AbstractForEachUniNode; -import ai.timefold.solver.core.impl.score.stream.common.AbstractConstraintStream; -import ai.timefold.solver.core.impl.score.stream.common.inliner.AbstractScoreInliner; - -public final class NodeBuildHelper> { - - private final Set activeStreamSet; - private final AbstractScoreInliner scoreInliner; - private final Map> nodeCreatorMap; - private final Map> tupleLifecycleMap; - private final Map storeIndexMap; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractConditionalTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.LeftTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.RightTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.uni.AbstractForEachUniNode; + +public abstract class AbstractNodeBuildHelper { + + private final Set activeStreamSet; + private final Map nodeCreatorMap; + private final Map> tupleLifecycleMap; + private final Map storeIndexMap; private List reversedNodeList; - public NodeBuildHelper(Set activeStreamSet, AbstractScoreInliner scoreInliner) { + public AbstractNodeBuildHelper(Set activeStreamSet) { this.activeStreamSet = activeStreamSet; - this.scoreInliner = scoreInliner; int activeStreamSetSize = activeStreamSet.size(); this.nodeCreatorMap = new HashMap<>(Math.max(16, activeStreamSetSize)); this.tupleLifecycleMap = new HashMap<>(Math.max(16, activeStreamSetSize)); @@ -39,19 +33,15 @@ public NodeBuildHelper(Set activeStreamSet, Abstract this.reversedNodeList = new ArrayList<>(activeStreamSetSize); } - public boolean isStreamActive(ConstraintStream stream) { + public boolean isStreamActive(Stream_ stream) { return activeStreamSet.contains(stream); } - public AbstractScoreInliner getScoreInliner() { - return scoreInliner; - } - - public void addNode(AbstractNode node, BavetAbstractConstraintStream creator) { + public void addNode(AbstractNode node, Stream_ creator) { addNode(node, creator, creator); } - public void addNode(AbstractNode node, BavetAbstractConstraintStream creator, BavetAbstractConstraintStream parent) { + public void addNode(AbstractNode node, Stream_ creator, Stream_ parent) { reversedNodeList.add(node); nodeCreatorMap.put(node, creator); if (!(node instanceof AbstractForEachUniNode)) { @@ -62,54 +52,50 @@ public void addNode(AbstractNode node, BavetAbstractConstraintStream creator, } } - public void addNode(AbstractNode node, BavetAbstractConstraintStream creator, - BavetAbstractConstraintStream leftParent, - BavetAbstractConstraintStream rightParent) { + public void addNode(AbstractNode node, Stream_ creator, Stream_ leftParent, Stream_ rightParent) { reversedNodeList.add(node); nodeCreatorMap.put(node, creator); putInsertUpdateRetract(leftParent, TupleLifecycle.ofLeft((LeftTupleLifecycle) node)); putInsertUpdateRetract(rightParent, TupleLifecycle.ofRight((RightTupleLifecycle) node)); } - public void putInsertUpdateRetract(ConstraintStream stream, + public void putInsertUpdateRetract(Stream_ stream, TupleLifecycle tupleLifecycle) { tupleLifecycleMap.put(stream, tupleLifecycle); } - public void putInsertUpdateRetract(ConstraintStream stream, - List> childStreamList, + public void putInsertUpdateRetract(Stream_ stream, List childStreamList, Function, AbstractConditionalTupleLifecycle> tupleLifecycleFunction) { TupleLifecycle tupleLifecycle = getAggregatedTupleLifecycle(childStreamList); putInsertUpdateRetract(stream, tupleLifecycleFunction.apply(tupleLifecycle)); } + @SuppressWarnings("unchecked") public TupleLifecycle getAggregatedTupleLifecycle( - List streamList) { - TupleLifecycle[] tupleLifecycles = streamList.stream() + List streamList) { + var tupleLifecycles = streamList.stream() .filter(this::isStreamActive) .map(s -> getTupleLifecycle(s, tupleLifecycleMap)) .toArray(TupleLifecycle[]::new); - switch (tupleLifecycles.length) { - case 0: - throw new IllegalStateException("Impossible state: None of the streamList (" + streamList - + ") are active."); - case 1: - return tupleLifecycles[0]; - default: - return TupleLifecycle.of(tupleLifecycles); - } + return switch (tupleLifecycles.length) { + case 0 -> + throw new IllegalStateException("Impossible state: None of the streamList (" + streamList + ") are active."); + case 1 -> tupleLifecycles[0]; + default -> TupleLifecycle.of(tupleLifecycles); + }; } - private static TupleLifecycle getTupleLifecycle(ConstraintStream stream, - Map> tupleLifecycleMap) { - TupleLifecycle tupleLifecycle = (TupleLifecycle) tupleLifecycleMap.get(stream); + @SuppressWarnings("unchecked") + private static TupleLifecycle getTupleLifecycle(Stream_ stream, + Map> tupleLifecycleMap) { + var tupleLifecycle = (TupleLifecycle) tupleLifecycleMap.get(stream); if (tupleLifecycle == null) { throw new IllegalStateException("Impossible state: the stream (" + stream + ") hasn't built a node yet."); } return tupleLifecycle; } - public int reserveTupleStoreIndex(ConstraintStream tupleSourceStream) { + public int reserveTupleStoreIndex(Stream_ tupleSourceStream) { return storeIndexMap.compute(tupleSourceStream, (k, index) -> { if (index == null) { return 0; @@ -122,7 +108,7 @@ public int reserveTupleStoreIndex(ConstraintStream tupleSourceStream) { }); } - public int extractTupleStoreSize(ConstraintStream tupleSourceStream) { + public int extractTupleStoreSize(Stream_ tupleSourceStream) { Integer lastIndex = storeIndexMap.put(tupleSourceStream, Integer.MIN_VALUE); return (lastIndex == null) ? 0 : lastIndex + 1; } @@ -134,17 +120,17 @@ public List destroyAndGetNodeList() { return nodeList; } - public BavetAbstractConstraintStream getNodeCreatingStream(AbstractNode node) { + public Stream_ getNodeCreatingStream(AbstractNode node) { return nodeCreatorMap.get(node); } - public AbstractNode findParentNode(BavetAbstractConstraintStream childNodeCreator) { + public AbstractNode findParentNode(Stream_ childNodeCreator) { if (childNodeCreator == null) { // We've recursed to the bottom without finding a parent node. throw new IllegalStateException( "Impossible state: node-creating stream (" + childNodeCreator + ") has no parent node."); } // Look the stream up among node creators and if found, the node is the parent node. - for (Map.Entry> entry : this.nodeCreatorMap.entrySet()) { + for (Map.Entry entry : this.nodeCreatorMap.entrySet()) { if (entry.getValue() == childNodeCreator) { return entry.getKey(); } diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractPropagationMetadataCarrier.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractPropagationMetadataCarrier.java similarity index 69% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractPropagationMetadataCarrier.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractPropagationMetadataCarrier.java index ce7d115c9a..32b0116738 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractPropagationMetadataCarrier.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractPropagationMetadataCarrier.java @@ -1,7 +1,7 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; /** * {@link DynamicPropagationQueue} requires the items it carries to extend this class, diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractUnindexedIfExistsNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractUnindexedIfExistsNode.java similarity index 93% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractUnindexedIfExistsNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractUnindexedIfExistsNode.java index da48361acb..05c00744bd 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractUnindexedIfExistsNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractUnindexedIfExistsNode.java @@ -1,10 +1,10 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.LeftTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.RightTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.LeftTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.RightTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; import ai.timefold.solver.core.impl.util.ElementAwareList; import ai.timefold.solver.core.impl.util.ElementAwareListEntry; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractUnindexedJoinNode.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractUnindexedJoinNode.java similarity index 91% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractUnindexedJoinNode.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractUnindexedJoinNode.java index c2e447e066..29970a1e69 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/AbstractUnindexedJoinNode.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractUnindexedJoinNode.java @@ -1,10 +1,10 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.LeftTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.RightTupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.UniTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.LeftTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.RightTupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.UniTuple; import ai.timefold.solver.core.impl.util.ElementAwareList; import ai.timefold.solver.core.impl.util.ElementAwareListEntry; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/BavetStream.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/BavetStream.java new file mode 100644 index 0000000000..5866eefdb8 --- /dev/null +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/BavetStream.java @@ -0,0 +1,7 @@ +package ai.timefold.solver.core.impl.bavet.common; + +public interface BavetStream { + + Stream_ getParent(); + +} diff --git a/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/BavetStreamBinaryOperation.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/BavetStreamBinaryOperation.java new file mode 100644 index 0000000000..592af1c7bc --- /dev/null +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/BavetStreamBinaryOperation.java @@ -0,0 +1,15 @@ +package ai.timefold.solver.core.impl.bavet.common; + +public interface BavetStreamBinaryOperation { + + /** + * @return An instance of fore bridge. + */ + Stream_ getLeftParent(); + + /** + * @return An instance of fore bridge. + */ + Stream_ getRightParent(); + +} diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/DynamicPropagationQueue.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/DynamicPropagationQueue.java similarity index 96% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/DynamicPropagationQueue.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/DynamicPropagationQueue.java index ed08103e81..2554b4e5cb 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/DynamicPropagationQueue.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/DynamicPropagationQueue.java @@ -1,13 +1,13 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import java.util.ArrayList; import java.util.BitSet; import java.util.List; import java.util.function.Consumer; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; /** * This implementation has the capability to move tuples between the individual propagation queues. diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/ExistsCounter.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/ExistsCounter.java similarity index 75% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/ExistsCounter.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/ExistsCounter.java index 43ff7f0f6c..a47bdd2910 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/ExistsCounter.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/ExistsCounter.java @@ -1,7 +1,7 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; public final class ExistsCounter extends AbstractPropagationMetadataCarrier { diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/Group.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/Group.java similarity index 92% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/Group.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/Group.java index cbe02c73bd..dd2c33affa 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/Group.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/Group.java @@ -1,7 +1,7 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; final class Group extends AbstractPropagationMetadataCarrier { diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/GroupNodeConstructor.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/GroupNodeConstructor.java similarity index 90% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/GroupNodeConstructor.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/GroupNodeConstructor.java index 3722e6f613..bbe8b66f35 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/GroupNodeConstructor.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/GroupNodeConstructor.java @@ -1,17 +1,16 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import java.util.List; -import ai.timefold.solver.core.api.score.Score; -import ai.timefold.solver.core.api.score.stream.ConstraintStream; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; import ai.timefold.solver.core.impl.util.Pair; import ai.timefold.solver.core.impl.util.Quadruple; import ai.timefold.solver.core.impl.util.Triple; -public interface GroupNodeConstructor { +public sealed interface GroupNodeConstructor + permits GroupNodeConstructorWithAccumulate, GroupNodeConstructorWithoutAccumulate { // Although Tuple_ is unused in GroupNodeConstructor, // it is used in its two implementations: GroupNodeConstructorWithAccumulate // and GroupNodeConstructorWithoutAccumulate. The Tuple_ here serves as a type hint @@ -57,7 +56,7 @@ public interface GroupNodeConstructor { zeroKeysGroupBy(CollectorA_ collectorA, CollectorB_ collectorB, CollectorC_ collectorC, GroupBy0Mapping3CollectorNodeBuilder builder) { return new GroupNodeConstructorWithAccumulate<>( - new Triple(collectorA, collectorB, collectorC), + new Triple<>(collectorA, collectorB, collectorC), (groupStoreIndex, undoStoreIndex, nextNodesTupleLifecycle, outputStoreSize, environmentMode) -> builder.build( groupStoreIndex, undoStoreIndex, collectorA, collectorB, collectorC, nextNodesTupleLifecycle, outputStoreSize, environmentMode)); @@ -67,7 +66,7 @@ public interface GroupNodeConstructor { zeroKeysGroupBy(CollectorA_ collectorA, CollectorB_ collectorB, CollectorC_ collectorC, CollectorD_ collectorD, GroupBy0Mapping4CollectorNodeBuilder builder) { return new GroupNodeConstructorWithAccumulate<>( - new Quadruple(collectorA, collectorB, collectorC, + new Quadruple<>(collectorA, collectorB, collectorC, collectorD), (groupStoreIndex, undoStoreIndex, nextNodesTupleLifecycle, outputStoreSize, environmentMode) -> builder.build( groupStoreIndex, undoStoreIndex, collectorA, collectorB, collectorC, collectorD, @@ -94,7 +93,7 @@ public interface GroupNodeConstructor { oneKeyGroupBy(KeyA_ keyMappingA, CollectorB_ collectorB, CollectorC_ collectorC, GroupBy1Mapping2CollectorNodeBuilder builder) { return new GroupNodeConstructorWithAccumulate<>( - new Triple(keyMappingA, collectorB, collectorC), + new Triple<>(keyMappingA, collectorB, collectorC), (groupStoreIndex, undoStoreIndex, nextNodesTupleLifecycle, outputStoreSize, environmentMode) -> builder.build( keyMappingA, groupStoreIndex, undoStoreIndex, collectorB, collectorC, nextNodesTupleLifecycle, @@ -105,7 +104,7 @@ public interface GroupNodeConstructor { oneKeyGroupBy(KeyA_ keyMappingA, CollectorB_ collectorB, CollectorC_ collectorC, CollectorD_ collectorD, GroupBy1Mapping3CollectorNodeBuilder builder) { return new GroupNodeConstructorWithAccumulate<>( - new Quadruple(keyMappingA, collectorB, collectorC, collectorD), + new Quadruple<>(keyMappingA, collectorB, collectorC, collectorD), (groupStoreIndex, undoStoreIndex, nextNodesTupleLifecycle, outputStoreSize, environmentMode) -> builder.build( keyMappingA, groupStoreIndex, undoStoreIndex, collectorB, collectorC, collectorD, nextNodesTupleLifecycle, @@ -125,7 +124,7 @@ public interface GroupNodeConstructor { twoKeysGroupBy(KeyA_ keyMappingA, KeyB_ keyMappingB, CollectorC_ collectorC, GroupBy2Mapping1CollectorNodeBuilder builder) { return new GroupNodeConstructorWithAccumulate<>( - new Triple(keyMappingA, keyMappingB, collectorC), + new Triple<>(keyMappingA, keyMappingB, collectorC), (groupStoreIndex, undoStoreIndex, nextNodesTupleLifecycle, outputStoreSize, environmentMode) -> builder.build( keyMappingA, keyMappingB, groupStoreIndex, undoStoreIndex, collectorC, nextNodesTupleLifecycle, @@ -136,7 +135,7 @@ public interface GroupNodeConstructor { twoKeysGroupBy(KeyA_ keyMappingA, KeyB_ keyMappingB, CollectorC_ collectorC, CollectorD_ collectorD, GroupBy2Mapping2CollectorNodeBuilder builder) { return new GroupNodeConstructorWithAccumulate<>( - new Quadruple(keyMappingA, keyMappingB, collectorC, collectorD), + new Quadruple<>(keyMappingA, keyMappingB, collectorC, collectorD), (groupStoreIndex, undoStoreIndex, nextNodesTupleLifecycle, outputStoreSize, environmentMode) -> builder.build( keyMappingA, keyMappingB, groupStoreIndex, undoStoreIndex, collectorC, collectorD, nextNodesTupleLifecycle, @@ -147,7 +146,7 @@ public interface GroupNodeConstructor { threeKeysGroupBy(KeyA_ keyMappingA, KeyB_ keyMappingB, KeyC_ keyMappingC, GroupBy3Mapping0CollectorNodeBuilder builder) { return new GroupNodeConstructorWithoutAccumulate<>( - new Triple(keyMappingA, keyMappingB, keyMappingC), + new Triple<>(keyMappingA, keyMappingB, keyMappingC), (groupStoreIndex, nextNodesTupleLifecycle, outputStoreSize, environmentMode) -> builder.build(keyMappingA, keyMappingB, keyMappingC, groupStoreIndex, nextNodesTupleLifecycle, outputStoreSize, environmentMode)); @@ -157,7 +156,7 @@ public interface GroupNodeConstructor { threeKeysGroupBy(KeyA_ keyMappingA, KeyB_ keyMappingB, KeyC_ keyMappingC, CollectorD_ collectorD, GroupBy3Mapping1CollectorNodeBuilder builder) { return new GroupNodeConstructorWithAccumulate<>( - new Quadruple(keyMappingA, keyMappingB, keyMappingC, collectorD), + new Quadruple<>(keyMappingA, keyMappingB, keyMappingC, collectorD), (groupStoreIndex, undoStoreIndex, nextNodesTupleLifecycle, outputStoreSize, environmentMode) -> builder.build( keyMappingA, keyMappingB, keyMappingC, groupStoreIndex, undoStoreIndex, collectorD, nextNodesTupleLifecycle, @@ -168,7 +167,7 @@ public interface GroupNodeConstructor { fourKeysGroupBy(KeyA_ keyMappingA, KeyB_ keyMappingB, KeyC_ keyMappingC, KeyD_ keyMappingD, GroupBy4Mapping0CollectorNodeBuilder builder) { return new GroupNodeConstructorWithoutAccumulate<>( - new Quadruple(keyMappingA, keyMappingB, keyMappingC, keyMappingD), + new Quadruple<>(keyMappingA, keyMappingB, keyMappingC, keyMappingD), (groupStoreIndex, nextNodesTupleLifecycle, outputStoreSize, environmentMode) -> builder.build(keyMappingA, keyMappingB, keyMappingC, keyMappingD, groupStoreIndex, nextNodesTupleLifecycle, outputStoreSize, environmentMode)); @@ -312,10 +311,8 @@ AbstractNode build(KeyA_ keyMappingA, TupleLifecycle nextNodesTupleLifecycle, int outputStoreSize, EnvironmentMode environmentMode); } - > void build(NodeBuildHelper buildHelper, - BavetAbstractConstraintStream parentTupleSource, - BavetAbstractConstraintStream aftStream, List aftStreamChildList, - BavetAbstractConstraintStream thisStream, - List thisStreamChildList, EnvironmentMode environmentMode); + void build(AbstractNodeBuildHelper buildHelper, Stream_ parentTupleSource, + Stream_ aftStream, List aftStreamChildList, Stream_ thisStream, List thisStreamChildList, + EnvironmentMode environmentMode); } diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/GroupNodeConstructorWithAccumulate.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/GroupNodeConstructorWithAccumulate.java similarity index 61% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/GroupNodeConstructorWithAccumulate.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/GroupNodeConstructorWithAccumulate.java index 79529d91d9..8ea0e87de2 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/GroupNodeConstructorWithAccumulate.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/GroupNodeConstructorWithAccumulate.java @@ -1,13 +1,11 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import java.util.List; import java.util.Objects; -import ai.timefold.solver.core.api.score.Score; -import ai.timefold.solver.core.api.score.stream.ConstraintStream; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; final class GroupNodeConstructorWithAccumulate implements GroupNodeConstructor { @@ -21,19 +19,17 @@ public GroupNodeConstructorWithAccumulate(Object equalityKey, } @Override - public > void build(NodeBuildHelper buildHelper, - BavetAbstractConstraintStream parentTupleSource, - BavetAbstractConstraintStream aftStream, List aftStreamChildList, - BavetAbstractConstraintStream bridgeStream, List bridgeStreamChildList, + public void build(AbstractNodeBuildHelper buildHelper, Stream_ parentTupleSource, + Stream_ aftStream, List aftStreamChildList, Stream_ bridgeStream, List bridgeStreamChildList, EnvironmentMode environmentMode) { if (!bridgeStreamChildList.isEmpty()) { throw new IllegalStateException("Impossible state: the stream (" + bridgeStream + ") has an non-empty childStreamList (" + bridgeStreamChildList + ") but it's a groupBy bridge."); } - int groupStoreIndex = buildHelper.reserveTupleStoreIndex(parentTupleSource); - int undoStoreIndex = buildHelper.reserveTupleStoreIndex(parentTupleSource); + var groupStoreIndex = buildHelper.reserveTupleStoreIndex(parentTupleSource); + var undoStoreIndex = buildHelper.reserveTupleStoreIndex(parentTupleSource); TupleLifecycle tupleLifecycle = buildHelper.getAggregatedTupleLifecycle(aftStreamChildList); - int outputStoreSize = buildHelper.extractTupleStoreSize(aftStream); + var outputStoreSize = buildHelper.extractTupleStoreSize(aftStream); var node = nodeConstructorFunction.apply(groupStoreIndex, undoStoreIndex, tupleLifecycle, outputStoreSize, environmentMode); buildHelper.addNode(node, bridgeStream); @@ -45,7 +41,7 @@ public boolean equals(Object object) { return true; if (object == null || getClass() != object.getClass()) return false; - GroupNodeConstructorWithAccumulate that = (GroupNodeConstructorWithAccumulate) object; + var that = (GroupNodeConstructorWithAccumulate) object; return Objects.equals(equalityKey, that.equalityKey); } diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/GroupNodeConstructorWithoutAccumulate.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/GroupNodeConstructorWithoutAccumulate.java similarity index 62% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/GroupNodeConstructorWithoutAccumulate.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/GroupNodeConstructorWithoutAccumulate.java index b2f5783f72..4a462d0715 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/GroupNodeConstructorWithoutAccumulate.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/GroupNodeConstructorWithoutAccumulate.java @@ -1,13 +1,11 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import java.util.List; import java.util.Objects; -import ai.timefold.solver.core.api.score.Score; -import ai.timefold.solver.core.api.score.stream.ConstraintStream; import ai.timefold.solver.core.config.solver.EnvironmentMode; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; final class GroupNodeConstructorWithoutAccumulate implements GroupNodeConstructor { @@ -21,18 +19,16 @@ public GroupNodeConstructorWithoutAccumulate(Object equalityKey, } @Override - public > void build(NodeBuildHelper buildHelper, - BavetAbstractConstraintStream parentTupleSource, - BavetAbstractConstraintStream aftStream, List aftStreamChildList, - BavetAbstractConstraintStream bridgeStream, List bridgeStreamChildList, + public void build(AbstractNodeBuildHelper buildHelper, Stream_ parentTupleSource, + Stream_ aftStream, List aftStreamChildList, Stream_ bridgeStream, List bridgeStreamChildList, EnvironmentMode environmentMode) { if (!bridgeStreamChildList.isEmpty()) { throw new IllegalStateException("Impossible state: the stream (" + bridgeStream + ") has an non-empty childStreamList (" + bridgeStreamChildList + ") but it's a groupBy bridge."); } - int groupStoreIndex = buildHelper.reserveTupleStoreIndex(parentTupleSource); + var groupStoreIndex = buildHelper.reserveTupleStoreIndex(parentTupleSource); TupleLifecycle tupleLifecycle = buildHelper.getAggregatedTupleLifecycle(aftStreamChildList); - int outputStoreSize = buildHelper.extractTupleStoreSize(aftStream); + var outputStoreSize = buildHelper.extractTupleStoreSize(aftStream); var node = nodeConstructorFunction.apply(groupStoreIndex, tupleLifecycle, outputStoreSize, environmentMode); buildHelper.addNode(node, bridgeStream); } @@ -43,7 +39,7 @@ public boolean equals(Object object) { return true; if (object == null || getClass() != object.getClass()) return false; - GroupNodeConstructorWithoutAccumulate that = (GroupNodeConstructorWithoutAccumulate) object; + var that = (GroupNodeConstructorWithoutAccumulate) object; return Objects.equals(equalityKey, that.equalityKey); } diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/PropagationQueue.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/PropagationQueue.java similarity index 91% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/PropagationQueue.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/PropagationQueue.java index 4d0d38d998..695661e0ac 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/PropagationQueue.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/PropagationQueue.java @@ -1,6 +1,6 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; /** * A propagation queue is an ordered collection of items that need to be sent to the next node. diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/Propagator.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/Propagator.java similarity index 98% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/Propagator.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/Propagator.java index b18d1d92b4..ba0dfd9fe7 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/Propagator.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/Propagator.java @@ -1,4 +1,4 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import ai.timefold.solver.core.impl.score.stream.bavet.BavetConstraintSession; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/StaticPropagationQueue.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/StaticPropagationQueue.java similarity index 93% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/StaticPropagationQueue.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/StaticPropagationQueue.java index 05012d74ef..f43ed6a96c 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/StaticPropagationQueue.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/StaticPropagationQueue.java @@ -1,12 +1,12 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common; +package ai.timefold.solver.core.impl.bavet.common; import java.util.ArrayDeque; import java.util.Deque; import java.util.function.Consumer; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleLifecycle; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleLifecycle; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; /** * The implementation moves tuples directly into an either retract, update or insert queue, diff --git a/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/TupleSource.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/TupleSource.java new file mode 100644 index 0000000000..b2324c5f26 --- /dev/null +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/TupleSource.java @@ -0,0 +1,4 @@ +package ai.timefold.solver.core.impl.bavet.common; + +public interface TupleSource { +} diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/ComparisonIndexer.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/ComparisonIndexer.java similarity index 98% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/ComparisonIndexer.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/ComparisonIndexer.java index f5db0db071..1706a39b9d 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/ComparisonIndexer.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/ComparisonIndexer.java @@ -1,4 +1,4 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common.index; +package ai.timefold.solver.core.impl.bavet.common.index; import java.util.Comparator; import java.util.Map; @@ -8,7 +8,7 @@ import java.util.function.Consumer; import java.util.function.Supplier; -import ai.timefold.solver.core.impl.score.stream.JoinerType; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.JoinerType; import ai.timefold.solver.core.impl.util.ElementAwareListEntry; final class ComparisonIndexer> diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/EqualsIndexer.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/EqualsIndexer.java similarity index 97% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/EqualsIndexer.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/EqualsIndexer.java index d9e9bc20d1..df1b2d9332 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/EqualsIndexer.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/EqualsIndexer.java @@ -1,4 +1,4 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common.index; +package ai.timefold.solver.core.impl.bavet.common.index; import java.util.HashMap; import java.util.Map; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/IndexProperties.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/IndexProperties.java similarity index 92% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/IndexProperties.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/IndexProperties.java index 2da212869c..fab4c43fc1 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/IndexProperties.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/IndexProperties.java @@ -1,4 +1,4 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common.index; +package ai.timefold.solver.core.impl.bavet.common.index; /** * Cached in tuples; each tuple carries its unique instance. diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/Indexer.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/Indexer.java similarity index 90% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/Indexer.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/Indexer.java index 1c90af0781..97932d6a82 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/Indexer.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/Indexer.java @@ -1,8 +1,8 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common.index; +package ai.timefold.solver.core.impl.bavet.common.index; import java.util.function.Consumer; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TupleState; +import ai.timefold.solver.core.impl.bavet.common.tuple.TupleState; import ai.timefold.solver.core.impl.util.ElementAwareListEntry; /** diff --git a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/IndexerFactory.java b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/IndexerFactory.java similarity index 74% rename from core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/IndexerFactory.java rename to core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/IndexerFactory.java index 31b18a762f..67a5b5cfcd 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/score/stream/bavet/common/index/IndexerFactory.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/bavet/common/index/IndexerFactory.java @@ -1,4 +1,4 @@ -package ai.timefold.solver.core.impl.score.stream.bavet.common.index; +package ai.timefold.solver.core.impl.bavet.common.index; import java.util.ArrayList; import java.util.NavigableMap; @@ -9,14 +9,14 @@ import ai.timefold.solver.core.api.function.QuadFunction; import ai.timefold.solver.core.api.function.TriFunction; -import ai.timefold.solver.core.impl.score.stream.JoinerType; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.AbstractTuple; -import ai.timefold.solver.core.impl.score.stream.bavet.common.tuple.TriTuple; -import ai.timefold.solver.core.impl.score.stream.common.AbstractJoiner; -import ai.timefold.solver.core.impl.score.stream.common.bi.DefaultBiJoiner; -import ai.timefold.solver.core.impl.score.stream.common.penta.DefaultPentaJoiner; -import ai.timefold.solver.core.impl.score.stream.common.quad.DefaultQuadJoiner; -import ai.timefold.solver.core.impl.score.stream.common.tri.DefaultTriJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.AbstractJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.DefaultBiJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.DefaultPentaJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.DefaultQuadJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.DefaultTriJoiner; +import ai.timefold.solver.core.impl.bavet.common.index.joiner.JoinerType; +import ai.timefold.solver.core.impl.bavet.common.tuple.AbstractTuple; +import ai.timefold.solver.core.impl.bavet.common.tuple.TriTuple; import ai.timefold.solver.core.impl.util.Pair; import ai.timefold.solver.core.impl.util.Quadruple; import ai.timefold.solver.core.impl.util.Triple; @@ -24,32 +24,27 @@ /** * {@link Indexer Indexers} form a parent-child hierarchy, * each child has exactly one parent. - * {@link ai.timefold.solver.core.impl.score.stream.bavet.common.index.NoneIndexer} is always at the bottom of the hierarchy, + * {@link NoneIndexer} is always at the bottom of the hierarchy, * never a parent unless it is the only indexer. * Parent indexers delegate to their children, - * until they reach the ultimate {@link ai.timefold.solver.core.impl.score.stream.bavet.common.index.NoneIndexer}. + * until they reach the ultimate {@link NoneIndexer}. *

* Example 1: EQUAL+LESS_THAN joiner will become EqualsIndexer -> ComparisonIndexer -> NoneIndexer. *

* Indexers have an id, which is the position of the indexer in the chain. * Top-most indexer has id 0, and the id increases as we go down the hierarchy. - * Each {@link AbstractTuple tuple} is assigned an - * {@link ai.timefold.solver.core.impl.score.stream.bavet.common.index.IndexProperties} instance, + * Each {@link AbstractTuple tuple} is assigned an {@link IndexProperties} instance, * which determines its location in the index. - * {@link ai.timefold.solver.core.impl.score.stream.bavet.common.index.IndexProperties} instances are built from - * {@link AbstractJoiner joiners} + * {@link IndexProperties} instances are built from {@link AbstractJoiner joiners} * using methods such as {@link #buildUniLeftMapping()} and {@link #buildRightMapping()}. - * Each {@link ai.timefold.solver.core.impl.score.stream.bavet.common.index.IndexProperties#toKey(int) index keyFunction} has an - * id, + * Each {@link IndexProperties#toKey(int) index keyFunction} has an id, * and this id matches the id of the indexer; - * each keyFunction in {@link ai.timefold.solver.core.impl.score.stream.bavet.common.index.IndexProperties} is associated with a - * single indexer. + * each keyFunction in {@link IndexProperties} is associated with a single indexer. *

* Comparison joiners result in a single indexer each, * whereas equal joiners will be merged into a single indexer if they are consecutive. * In the latter case, - * a composite keyFunction is created of type {@link Pair}, {@link TriTuple}, - * {@link Quadruple} or {@link ai.timefold.solver.core.impl.score.stream.bavet.common.index.IndexerKey}, + * a composite keyFunction is created of type {@link Pair}, {@link TriTuple}, {@link Quadruple} or {@link IndexerKey}, * based on the length of the composite keyFunction (number of equals joiners in sequence). * *