Skip to content

Commit 64a1115

Browse files
authored
chore: temporally disabling the mixed model
1 parent 0ef89e6 commit 64a1115

5 files changed

Lines changed: 33 additions & 0 deletions

File tree

core/src/main/java/ai/timefold/solver/core/impl/domain/solution/descriptor/SolutionDescriptor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ public static <Solution_> SolutionDescriptor<Solution_> buildSolutionDescriptor(
166166
solutionDescriptor.constraintWeightSupplier.initialize(solutionDescriptor,
167167
descriptorPolicy.getMemberAccessorFactory(), descriptorPolicy.getDomainAccessType());
168168
}
169+
// Temporally disabling the mixed model
170+
if (solutionDescriptor.hasBothBasicAndListVariables()) {
171+
throw new IllegalStateException("Combining list variable and basic variables is currently not supported.");
172+
}
169173
return solutionDescriptor;
170174
}
171175

core/src/test/java/ai/timefold/solver/core/impl/constructionheuristic/DefaultConstructionHeuristicPhaseTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import ai.timefold.solver.core.testutil.AbstractMeterTest;
4848
import ai.timefold.solver.core.testutil.PlannerTestUtils;
4949

50+
import org.junit.jupiter.api.Disabled;
5051
import org.junit.jupiter.api.Test;
5152

5253
import io.micrometer.core.instrument.Metrics;
@@ -348,6 +349,7 @@ void constructionHeuristicAllocateToValueFromQueue() {
348349
.filter(e -> e.getValue() == null)).isEmpty();
349350
}
350351

352+
@Disabled("The mixed model is currently unavailable for general use")
351353
@Test
352354
void failMixedModelDefaultConfiguration() {
353355
var solverConfig = PlannerTestUtils

core/src/test/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/list/SubListChangeMoveSelectorFactoryTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import ai.timefold.solver.core.testdomain.list.TestdataListSolution;
2121
import ai.timefold.solver.core.testdomain.mixed.multientity.TestdataMixedMultiEntitySolution;
2222

23+
import org.junit.jupiter.api.Disabled;
2324
import org.junit.jupiter.api.Test;
2425
import org.junit.jupiter.params.ParameterizedTest;
2526
import org.junit.jupiter.params.provider.Arguments;
@@ -43,6 +44,7 @@ void buildMoveSelector() {
4344
assertThat(selector.isSelectReversingMoveToo()).isTrue();
4445
}
4546

47+
@Disabled("The mixed model is currently unavailable for general use")
4648
@Test
4749
void buildMoveSelectorMultiEntity() {
4850
var config = new SubListChangeMoveSelectorConfig();

core/src/test/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/list/SubListSwapMoveSelectorFactoryTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import ai.timefold.solver.core.testdomain.list.TestdataListSolution;
1717
import ai.timefold.solver.core.testdomain.mixed.multientity.TestdataMixedMultiEntitySolution;
1818

19+
import org.junit.jupiter.api.Disabled;
1920
import org.junit.jupiter.api.Test;
2021
import org.junit.jupiter.params.ParameterizedTest;
2122
import org.junit.jupiter.params.provider.Arguments;
@@ -40,6 +41,7 @@ void buildBaseMoveSelector() {
4041
assertThat(selector.isSelectReversingMoveToo()).isTrue();
4142
}
4243

44+
@Disabled("The mixed model is currently unavailable for general use")
4345
@Test
4446
void buildMoveSelectorMultiEntity() {
4547
var config = new SubListSwapMoveSelectorConfig();

core/src/test/java/ai/timefold/solver/core/impl/solver/DefaultSolverTest.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
import org.assertj.core.api.junit.jupiter.SoftAssertionsExtension;
147147
import org.jspecify.annotations.NonNull;
148148
import org.jspecify.annotations.Nullable;
149+
import org.junit.jupiter.api.Disabled;
149150
import org.junit.jupiter.api.Test;
150151
import org.junit.jupiter.api.Timeout;
151152
import org.junit.jupiter.api.extension.ExtendWith;
@@ -1656,6 +1657,19 @@ private static List<MoveSelectorConfig> generateMovesForMultiEntity() {
16561657
return allMoveSelectionConfigList;
16571658
}
16581659

1660+
@Test
1661+
void failMixedModel() {
1662+
var solverConfig = PlannerTestUtils
1663+
.buildSolverConfig(TestdataMixedSolution.class, TestdataMixedEntity.class, TestdataMixedValue.class,
1664+
TestdataMixedOtherValue.class)
1665+
.withPreviewFeature(DECLARATIVE_SHADOW_VARIABLES);
1666+
1667+
assertThatCode(() -> PlannerTestUtils.solve(solverConfig, new TestdataSolution("s1")))
1668+
.hasMessageContaining(
1669+
"Combining list variable and basic variables is currently not supported");
1670+
}
1671+
1672+
@Disabled("The mixed model is currently unavailable for general use")
16591673
@Test
16601674
void solveMixedModel() {
16611675
// Same size for both list and basic variables
@@ -1667,6 +1681,7 @@ void solveMixedModel() {
16671681
executeSolveMixedModel(3, 2, 2);
16681682
}
16691683

1684+
@Disabled("The mixed model is currently unavailable for general use")
16701685
@Test
16711686
void solveMultiEntityMixedModel() {
16721687
// Same size for both list and basic variables
@@ -1749,6 +1764,7 @@ void executeSolveMultiEntityMixedModel(int entitySize, int valueSize, int otherV
17491764
}
17501765
}
17511766

1767+
@Disabled("The mixed model is currently unavailable for general use")
17521768
@Test
17531769
void solveMixedModelCustomMove() {
17541770
var solverConfig = PlannerTestUtils.buildSolverConfig(
@@ -1773,6 +1789,7 @@ void solveMixedModelCustomMove() {
17731789
.isEmpty();
17741790
}
17751791

1792+
@Disabled("The mixed model is currently unavailable for general use")
17761793
@Test
17771794
void solveMixedModelCustomPhase() {
17781795
var solverConfig = PlannerTestUtils.buildSolverConfig(
@@ -1805,6 +1822,7 @@ private static List<Pair<EntitySorterManner, ValueSorterManner>> getSortMannerLi
18051822
return sortMannerList;
18061823
}
18071824

1825+
@Disabled("The mixed model is currently unavailable for general use")
18081826
@ParameterizedTest
18091827
@MethodSource("getSortMannerList")
18101828
void solveMixedModelWithSortManner(Pair<EntitySorterManner, ValueSorterManner> sorterManner) {
@@ -1838,6 +1856,7 @@ void solveMixedModelWithSortManner(Pair<EntitySorterManner, ValueSorterManner> s
18381856
.isEmpty();
18391857
}
18401858

1859+
@Disabled("The mixed model is currently unavailable for general use")
18411860
@Test
18421861
void solvePinnedMixedModel() {
18431862
// We don't enable the LS because we want to ensure the pinned entity remains uninitialized
@@ -1861,6 +1880,7 @@ void solvePinnedMixedModel() {
18611880
assertThat(solution.getEntityList().get(0).getValueList()).isEmpty();
18621881
}
18631882

1883+
@Disabled("The mixed model is currently unavailable for general use")
18641884
@Test
18651885
void solveUnassignedMixedModel() {
18661886
var solverConfig = PlannerTestUtils.buildSolverConfig(
@@ -1887,6 +1907,7 @@ void solveUnassignedMixedModel() {
18871907
.hasSize(2);
18881908
}
18891909

1910+
@Disabled("The mixed model is currently unavailable for general use")
18901911
@Test
18911912
void solvePinnedAndUnassignedMixedModel() {
18921913
var solverConfig = PlannerTestUtils.buildSolverConfig(
@@ -1974,6 +1995,7 @@ private static List<MoveSelectorConfig> generateMovesForMixedModel() {
19741995
return allMoveSelectionConfigList;
19751996
}
19761997

1998+
@Disabled("The mixed model is currently unavailable for general use")
19771999
@ParameterizedTest
19782000
@MethodSource("generateMovesForMixedModel")
19792001
void solveMoveConfigMixedModel(MoveSelectorConfig moveSelectionConfig) {
@@ -2036,6 +2058,7 @@ private static List<MoveSelectorConfig> generateMovesForMultiEntityMixedModel()
20362058
return allMoveSelectionConfigList;
20372059
}
20382060

2061+
@Disabled("The mixed model is currently unavailable for general use")
20392062
@ParameterizedTest
20402063
@MethodSource("generateMovesForMultiEntityMixedModel")
20412064
void solveMultiEntityMoveConfigMixedModel(MoveSelectorConfig moveSelectionConfig) {

0 commit comments

Comments
 (0)