diff --git a/core/src/main/java/ai/timefold/solver/core/api/domain/variable/AnchorShadowVariable.java b/core/src/main/java/ai/timefold/solver/core/api/domain/variable/AnchorShadowVariable.java index b234ee9bc2..dc7fa89c3f 100644 --- a/core/src/main/java/ai/timefold/solver/core/api/domain/variable/AnchorShadowVariable.java +++ b/core/src/main/java/ai/timefold/solver/core/api/domain/variable/AnchorShadowVariable.java @@ -15,7 +15,10 @@ * variable. *

* It is specified on a getter of a java bean property (or a field) of a {@link PlanningEntity} class. + * + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ +@Deprecated(forRemoval = true, since = "1.31.0") @Target({ METHOD, FIELD }) @Retention(RUNTIME) public @interface AnchorShadowVariable { diff --git a/core/src/main/java/ai/timefold/solver/core/api/domain/variable/PlanningVariable.java b/core/src/main/java/ai/timefold/solver/core/api/domain/variable/PlanningVariable.java index 7f9967fd22..e3ad09bfde 100644 --- a/core/src/main/java/ai/timefold/solver/core/api/domain/variable/PlanningVariable.java +++ b/core/src/main/java/ai/timefold/solver/core/api/domain/variable/PlanningVariable.java @@ -56,7 +56,9 @@ * as specified by {@link PlanningVariableGraphType}. * * @return never null, defaults to {@link PlanningVariableGraphType#NONE} + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ + @Deprecated(forRemoval = true, since = "1.31.0") PlanningVariableGraphType graphType() default PlanningVariableGraphType.NONE; /** diff --git a/core/src/main/java/ai/timefold/solver/core/api/domain/variable/PlanningVariableGraphType.java b/core/src/main/java/ai/timefold/solver/core/api/domain/variable/PlanningVariableGraphType.java index 0d64354d70..f5b301989b 100644 --- a/core/src/main/java/ai/timefold/solver/core/api/domain/variable/PlanningVariableGraphType.java +++ b/core/src/main/java/ai/timefold/solver/core/api/domain/variable/PlanningVariableGraphType.java @@ -1,5 +1,9 @@ package ai.timefold.solver.core.api.domain.variable; +/** + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. + */ +@Deprecated(forRemoval = true, since = "1.31.0") public enum PlanningVariableGraphType { /** * This is the default. diff --git a/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/KOptMoveSelectorConfig.java b/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/KOptMoveSelectorConfig.java index 299737dd40..62e1f060a3 100644 --- a/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/KOptMoveSelectorConfig.java +++ b/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/KOptMoveSelectorConfig.java @@ -5,6 +5,7 @@ import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlType; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.config.heuristic.selector.entity.EntitySelectorConfig; import ai.timefold.solver.core.config.heuristic.selector.move.MoveSelectorConfig; import ai.timefold.solver.core.config.heuristic.selector.value.ValueSelectorConfig; @@ -17,11 +18,12 @@ * THIS CLASS IS EXPERIMENTAL AND UNSUPPORTED. * Backward compatibility is not guaranteed. * It's NOT DOCUMENTED because we'll only document it when it actually works in more than 1 use case. - * * Do not use. * * @see TailChainSwapMoveSelectorConfig + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ +@Deprecated(forRemoval = true, since = "1.31.0") @XmlType(propOrder = { "entitySelectorConfig", "valueSelectorConfig" diff --git a/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/SubChainChangeMoveSelectorConfig.java b/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/SubChainChangeMoveSelectorConfig.java index 7aebe9b97c..95382caef4 100644 --- a/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/SubChainChangeMoveSelectorConfig.java +++ b/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/SubChainChangeMoveSelectorConfig.java @@ -5,6 +5,7 @@ import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlType; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.config.heuristic.selector.move.MoveSelectorConfig; import ai.timefold.solver.core.config.heuristic.selector.value.ValueSelectorConfig; import ai.timefold.solver.core.config.heuristic.selector.value.chained.SubChainSelectorConfig; @@ -13,6 +14,10 @@ import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; +/** + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. + */ +@Deprecated(forRemoval = true, since = "1.31.0") @XmlType(propOrder = { "entityClass", "subChainSelectorConfig", diff --git a/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/SubChainSwapMoveSelectorConfig.java b/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/SubChainSwapMoveSelectorConfig.java index 61011385fc..bbda8d09fc 100644 --- a/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/SubChainSwapMoveSelectorConfig.java +++ b/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/SubChainSwapMoveSelectorConfig.java @@ -5,6 +5,7 @@ import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlType; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.config.heuristic.selector.move.MoveSelectorConfig; import ai.timefold.solver.core.config.heuristic.selector.value.chained.SubChainSelectorConfig; import ai.timefold.solver.core.config.util.ConfigUtils; @@ -12,6 +13,10 @@ import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; +/** + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. + */ +@Deprecated(forRemoval = true, since = "1.31.0") @XmlType(propOrder = { "entityClass", "subChainSelectorConfig", diff --git a/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/TailChainSwapMoveSelectorConfig.java b/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/TailChainSwapMoveSelectorConfig.java index a0c71dd100..ce248bc8d9 100644 --- a/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/TailChainSwapMoveSelectorConfig.java +++ b/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/TailChainSwapMoveSelectorConfig.java @@ -6,6 +6,7 @@ import jakarta.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlType; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.config.heuristic.selector.entity.EntitySelectorConfig; import ai.timefold.solver.core.config.heuristic.selector.move.MoveSelectorConfig; import ai.timefold.solver.core.config.heuristic.selector.move.NearbyAutoConfigurationEnabled; @@ -19,7 +20,10 @@ /** * Also known as a 2-opt move selector config. + * + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ +@Deprecated(forRemoval = true, since = "1.31.0") @XmlType(propOrder = { "entitySelectorConfig", "valueSelectorConfig" diff --git a/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/package-info.java b/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/package-info.java index 783d2f2d44..91835b3d68 100644 --- a/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/package-info.java +++ b/core/src/main/java/ai/timefold/solver/core/config/heuristic/selector/move/generic/chained/package-info.java @@ -1,3 +1,8 @@ +/** + * @deprecated Chained variable is deprecated. Use {@link ai.timefold.solver.core.api.domain.variable.PlanningListVariable list + * variable} instead. + */ +@Deprecated(forRemoval = true, since = "1.31.0") @XmlSchema( namespace = SolverConfig.XML_NAMESPACE, elementFormDefault = XmlNsForm.QUALIFIED) diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/ChainedChangeMove.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/ChainedChangeMove.java index fa09859033..1bd4e61a2c 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/ChainedChangeMove.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/ChainedChangeMove.java @@ -3,6 +3,7 @@ import java.util.Objects; import ai.timefold.solver.core.api.domain.solution.PlanningSolution; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.api.score.director.ScoreDirector; import ai.timefold.solver.core.impl.domain.variable.descriptor.GenuineVariableDescriptor; import ai.timefold.solver.core.impl.domain.variable.inverserelation.SingletonInverseVariableSupply; @@ -11,7 +12,9 @@ /** * @param the solution type, the class with the {@link PlanningSolution} annotation + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ +@Deprecated(forRemoval = true, since = "1.31.0") public class ChainedChangeMove extends ChangeMove { protected final Object oldTrailingEntity; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/ChainedSwapMove.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/ChainedSwapMove.java index 0861da6c46..f53c85ec06 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/ChainedSwapMove.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/ChainedSwapMove.java @@ -5,6 +5,7 @@ import java.util.Objects; import ai.timefold.solver.core.api.domain.solution.PlanningSolution; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.api.score.director.ScoreDirector; import ai.timefold.solver.core.impl.domain.variable.descriptor.BasicVariableDescriptor; import ai.timefold.solver.core.impl.domain.variable.descriptor.GenuineVariableDescriptor; @@ -14,7 +15,9 @@ /** * @param the solution type, the class with the {@link PlanningSolution} annotation + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ +@Deprecated(forRemoval = true, since = "1.31.0") public class ChainedSwapMove extends SwapMove { protected final List oldLeftTrailingEntityList; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/KOptMove.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/KOptMove.java index c70fd0e67c..f13f32fea4 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/KOptMove.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/KOptMove.java @@ -8,6 +8,7 @@ import java.util.Objects; import ai.timefold.solver.core.api.domain.solution.PlanningSolution; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.api.score.director.ScoreDirector; import ai.timefold.solver.core.impl.domain.variable.anchor.AnchorVariableSupply; import ai.timefold.solver.core.impl.domain.variable.descriptor.GenuineVariableDescriptor; @@ -17,7 +18,9 @@ /** * @param the solution type, the class with the {@link PlanningSolution} annotation + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ +@Deprecated(forRemoval = true, since = "1.31.0") public class KOptMove extends AbstractMove { protected final GenuineVariableDescriptor variableDescriptor; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/KOptMoveSelector.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/KOptMoveSelector.java index e34aec8052..cb8fb64403 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/KOptMoveSelector.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/KOptMoveSelector.java @@ -3,6 +3,7 @@ import java.util.Arrays; import java.util.Iterator; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.impl.domain.variable.anchor.AnchorVariableDemand; import ai.timefold.solver.core.impl.domain.variable.anchor.AnchorVariableSupply; import ai.timefold.solver.core.impl.domain.variable.descriptor.BasicVariableDescriptor; @@ -17,6 +18,10 @@ import ai.timefold.solver.core.impl.heuristic.selector.value.ValueSelector; import ai.timefold.solver.core.impl.solver.scope.SolverScope; +/** + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. + */ +@Deprecated(forRemoval = true, since = "1.31.0") public class KOptMoveSelector extends GenericMoveSelector { protected final EntitySelector entitySelector; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/KOptMoveSelectorFactory.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/KOptMoveSelectorFactory.java index f91b017e34..d85835af17 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/KOptMoveSelectorFactory.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/KOptMoveSelectorFactory.java @@ -2,6 +2,7 @@ import java.util.Objects; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.config.heuristic.selector.common.SelectionCacheType; import ai.timefold.solver.core.config.heuristic.selector.common.SelectionOrder; import ai.timefold.solver.core.config.heuristic.selector.entity.EntitySelectorConfig; @@ -15,6 +16,10 @@ import ai.timefold.solver.core.impl.heuristic.selector.value.ValueSelector; import ai.timefold.solver.core.impl.heuristic.selector.value.ValueSelectorFactory; +/** + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. + */ +@Deprecated(forRemoval = true, since = "1.31.0") public class KOptMoveSelectorFactory extends AbstractMoveSelectorFactory { diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainChangeMove.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainChangeMove.java index 4cabae8650..fbcefa9b2d 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainChangeMove.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainChangeMove.java @@ -4,7 +4,7 @@ import java.util.Collections; import java.util.Objects; -import ai.timefold.solver.core.api.domain.solution.PlanningSolution; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.api.score.director.ScoreDirector; import ai.timefold.solver.core.impl.domain.variable.descriptor.GenuineVariableDescriptor; import ai.timefold.solver.core.impl.domain.variable.inverserelation.SingletonInverseVariableSupply; @@ -13,8 +13,9 @@ import ai.timefold.solver.core.impl.score.director.VariableDescriptorAwareScoreDirector; /** - * @param the solution type, the class with the {@link PlanningSolution} annotation + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ +@Deprecated(forRemoval = true, since = "1.31.0") public class SubChainChangeMove extends AbstractMove { protected final SubChain subChain; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainChangeMoveSelector.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainChangeMoveSelector.java index 0a02313981..29e0fb61db 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainChangeMoveSelector.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainChangeMoveSelector.java @@ -3,6 +3,7 @@ import java.util.Collections; import java.util.Iterator; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.impl.domain.variable.inverserelation.SingletonInverseVariableDemand; import ai.timefold.solver.core.impl.domain.variable.inverserelation.SingletonInverseVariableSupply; import ai.timefold.solver.core.impl.domain.variable.supply.SupplyManager; @@ -14,6 +15,10 @@ import ai.timefold.solver.core.impl.heuristic.selector.value.chained.SubChainSelector; import ai.timefold.solver.core.impl.solver.scope.SolverScope; +/** + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. + */ +@Deprecated(forRemoval = true, since = "1.31.0") public class SubChainChangeMoveSelector extends GenericMoveSelector { protected final SubChainSelector subChainSelector; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainChangeMoveSelectorFactory.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainChangeMoveSelectorFactory.java index 265a2f9ad9..88742ed8c5 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainChangeMoveSelectorFactory.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainChangeMoveSelectorFactory.java @@ -2,6 +2,7 @@ import java.util.Objects; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.config.heuristic.selector.common.SelectionCacheType; import ai.timefold.solver.core.config.heuristic.selector.common.SelectionOrder; import ai.timefold.solver.core.config.heuristic.selector.move.generic.chained.SubChainChangeMoveSelectorConfig; @@ -17,6 +18,10 @@ import ai.timefold.solver.core.impl.heuristic.selector.value.chained.SubChainSelector; import ai.timefold.solver.core.impl.heuristic.selector.value.chained.SubChainSelectorFactory; +/** + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. + */ +@Deprecated(forRemoval = true, since = "1.31.0") public class SubChainChangeMoveSelectorFactory extends AbstractMoveSelectorFactory { diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainReversingChangeMove.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainReversingChangeMove.java index 3625323784..ee5c1d4de2 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainReversingChangeMove.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainReversingChangeMove.java @@ -4,7 +4,7 @@ import java.util.Collections; import java.util.Objects; -import ai.timefold.solver.core.api.domain.solution.PlanningSolution; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.api.score.director.ScoreDirector; import ai.timefold.solver.core.impl.domain.variable.descriptor.GenuineVariableDescriptor; import ai.timefold.solver.core.impl.domain.variable.descriptor.VariableDescriptor; @@ -14,8 +14,9 @@ import ai.timefold.solver.core.impl.score.director.VariableDescriptorAwareScoreDirector; /** - * @param the solution type, the class with the {@link PlanningSolution} annotation + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ +@Deprecated(forRemoval = true, since = "1.31.0") public class SubChainReversingChangeMove extends AbstractMove { protected final SubChain subChain; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainReversingSwapMove.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainReversingSwapMove.java index a0557f35fc..1720b52be7 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainReversingSwapMove.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainReversingSwapMove.java @@ -8,6 +8,7 @@ import java.util.Objects; import ai.timefold.solver.core.api.domain.solution.PlanningSolution; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.api.score.director.ScoreDirector; import ai.timefold.solver.core.impl.domain.variable.descriptor.GenuineVariableDescriptor; import ai.timefold.solver.core.impl.domain.variable.inverserelation.SingletonInverseVariableSupply; @@ -21,7 +22,9 @@ * This {@link Move} is not cacheable. * * @param the solution type, the class with the {@link PlanningSolution} annotation + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ +@Deprecated(forRemoval = true, since = "1.31.0") public class SubChainReversingSwapMove extends AbstractMove { private final GenuineVariableDescriptor variableDescriptor; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMove.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMove.java index 395bb717d8..d6ec9edbf3 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMove.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMove.java @@ -7,6 +7,7 @@ import java.util.Set; import ai.timefold.solver.core.api.domain.solution.PlanningSolution; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.api.score.director.ScoreDirector; import ai.timefold.solver.core.impl.domain.variable.descriptor.GenuineVariableDescriptor; import ai.timefold.solver.core.impl.domain.variable.inverserelation.SingletonInverseVariableSupply; @@ -20,7 +21,9 @@ * This {@link Move} is not cacheable. * * @param the solution type, the class with the {@link PlanningSolution} annotation + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ +@Deprecated(forRemoval = true, since = "1.31.0") public class SubChainSwapMove extends AbstractMove { protected final GenuineVariableDescriptor variableDescriptor; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMoveSelector.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMoveSelector.java index 971a3ed8ed..33e9cddd2e 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMoveSelector.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMoveSelector.java @@ -2,6 +2,7 @@ import java.util.Iterator; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.impl.domain.variable.descriptor.GenuineVariableDescriptor; import ai.timefold.solver.core.impl.domain.variable.inverserelation.SingletonInverseVariableDemand; import ai.timefold.solver.core.impl.domain.variable.inverserelation.SingletonInverseVariableSupply; @@ -14,6 +15,10 @@ import ai.timefold.solver.core.impl.heuristic.selector.value.chained.SubChainSelector; import ai.timefold.solver.core.impl.solver.scope.SolverScope; +/** + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. + */ +@Deprecated(forRemoval = true, since = "1.31.0") public class SubChainSwapMoveSelector extends GenericMoveSelector { protected final SubChainSelector leftSubChainSelector; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMoveSelectorFactory.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMoveSelectorFactory.java index 13a2aa9fbc..153eb4e9d7 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMoveSelectorFactory.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMoveSelectorFactory.java @@ -2,6 +2,7 @@ import java.util.Objects; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.config.heuristic.selector.common.SelectionCacheType; import ai.timefold.solver.core.config.heuristic.selector.common.SelectionOrder; import ai.timefold.solver.core.config.heuristic.selector.move.generic.chained.SubChainSwapMoveSelectorConfig; @@ -13,6 +14,10 @@ import ai.timefold.solver.core.impl.heuristic.selector.value.chained.SubChainSelector; import ai.timefold.solver.core.impl.heuristic.selector.value.chained.SubChainSelectorFactory; +/** + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. + */ +@Deprecated(forRemoval = true, since = "1.31.0") public class SubChainSwapMoveSelectorFactory extends AbstractMoveSelectorFactory { diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/TailChainSwapMove.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/TailChainSwapMove.java index bb452f43e9..d1c45dc8cb 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/TailChainSwapMove.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/TailChainSwapMove.java @@ -6,6 +6,7 @@ import java.util.Objects; import ai.timefold.solver.core.api.domain.solution.PlanningSolution; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.api.score.director.ScoreDirector; import ai.timefold.solver.core.impl.domain.variable.anchor.AnchorVariableSupply; import ai.timefold.solver.core.impl.domain.variable.descriptor.GenuineVariableDescriptor; @@ -17,7 +18,9 @@ * Also known as a 2-opt move. * * @param the solution type, the class with the {@link PlanningSolution} annotation + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ +@Deprecated(forRemoval = true, since = "1.31.0") public class TailChainSwapMove extends AbstractMove { protected final GenuineVariableDescriptor variableDescriptor; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/TailChainSwapMoveSelector.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/TailChainSwapMoveSelector.java index b63bd6b596..32c750e164 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/TailChainSwapMoveSelector.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/TailChainSwapMoveSelector.java @@ -2,6 +2,7 @@ import java.util.Iterator; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.impl.domain.variable.anchor.AnchorVariableDemand; import ai.timefold.solver.core.impl.domain.variable.anchor.AnchorVariableSupply; import ai.timefold.solver.core.impl.domain.variable.descriptor.BasicVariableDescriptor; @@ -20,7 +21,10 @@ /** * Also known as a 2-opt move selector. + * + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. */ +@Deprecated(forRemoval = true, since = "1.31.0") public class TailChainSwapMoveSelector extends GenericMoveSelector { protected final EntitySelector entitySelector; diff --git a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/TailChainSwapMoveSelectorFactory.java b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/TailChainSwapMoveSelectorFactory.java index 4d28bb8272..d0fccbcd5b 100644 --- a/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/TailChainSwapMoveSelectorFactory.java +++ b/core/src/main/java/ai/timefold/solver/core/impl/heuristic/selector/move/generic/chained/TailChainSwapMoveSelectorFactory.java @@ -2,6 +2,7 @@ import java.util.Objects; +import ai.timefold.solver.core.api.domain.variable.PlanningListVariable; import ai.timefold.solver.core.config.heuristic.selector.common.SelectionCacheType; import ai.timefold.solver.core.config.heuristic.selector.common.SelectionOrder; import ai.timefold.solver.core.config.heuristic.selector.entity.EntitySelectorConfig; @@ -15,6 +16,10 @@ import ai.timefold.solver.core.impl.heuristic.selector.value.ValueSelector; import ai.timefold.solver.core.impl.heuristic.selector.value.ValueSelectorFactory; +/** + * @deprecated Chained variable is deprecated. Use {@link PlanningListVariable list variable} instead. + */ +@Deprecated(forRemoval = true, since = "1.31.0") public class TailChainSwapMoveSelectorFactory extends AbstractMoveSelectorFactory { diff --git a/docs/src/modules/ROOT/pages/constraints-and-score/constraint-configuration.adoc b/docs/src/modules/ROOT/pages/constraints-and-score/constraint-configuration.adoc index b2a5e5b9ce..9d25db113c 100644 --- a/docs/src/modules/ROOT/pages/constraints-and-score/constraint-configuration.adoc +++ b/docs/src/modules/ROOT/pages/constraints-and-score/constraint-configuration.adoc @@ -334,7 +334,7 @@ These connect the constraint weight with the constraint implementation. [NOTE] ==== -Constraint packages are optional and have been deprecated. +Constraint packages are optional, have been deprecated and will be removed in Timefold Solver 2.0. We recommend that you don't use them, and instead keep constraint names unique. If constraint package is not provided, the solver will transparently provide a default value. ==== diff --git a/docs/src/modules/ROOT/pages/constraints-and-score/score-calculation.adoc b/docs/src/modules/ROOT/pages/constraints-and-score/score-calculation.adoc index 775a1526dd..063d6e93e3 100644 --- a/docs/src/modules/ROOT/pages/constraints-and-score/score-calculation.adoc +++ b/docs/src/modules/ROOT/pages/constraints-and-score/score-calculation.adoc @@ -315,7 +315,7 @@ As an unwanted consequence, behaves unexpectedly for xref:using-timefold-solver/modeling-planning-problems.adoc#planningVariableAllowingUnassigned[variables with unassigned values]. These are considered initialized even when `null`, and therefore this legacy method could still return entities with `null` variables. -`from()`, `fromUnfiltered()` and `fromUniquePair()` are now deprecated and will be removed in a future major version of Timefold Solver. +`from()`, `fromUnfiltered()` and `fromUniquePair()` are now deprecated and will be removed in Timefold Solver 2.0 ==== [#constraintStreamsPenaltiesRewards] @@ -343,13 +343,6 @@ The default value is `1`. Constraints with zero constraint weight are automatically disabled and do not impose any performance penalty. ==== -[NOTE] -==== -The constraint has another component: a constraint package. -It has no practical impact on the solver and it has been deprecated. -We recommend you don't use constraint packages; the solver will choose a suitable default value. -==== - The Constraint Streams API supports many different types of penalties. Browse the API in your IDE for the full list of method overloads. Here are some examples: diff --git a/docs/src/modules/ROOT/pages/enterprise-edition/enterprise-edition.adoc b/docs/src/modules/ROOT/pages/enterprise-edition/enterprise-edition.adoc index a593a93862..040d4188cf 100644 --- a/docs/src/modules/ROOT/pages/enterprise-edition/enterprise-edition.adoc +++ b/docs/src/modules/ROOT/pages/enterprise-edition/enterprise-edition.adoc @@ -288,6 +288,9 @@ to specify which destination, value, or subList should be nearby the selection. ==== Nearby selection with a chained variable +NOTE: Chained variable is deprecated and will be removed in Timefold Solver 2.0. +Use xref:using-timefold-solver/modeling-planning-problems.adoc#planningListVariable[list variable] instead. + To quickly configure nearby selection with a chained planning variable, add `nearbyDistanceMeterClass` element to your configuration file. The following enables nearby selection with a chained variable diff --git a/docs/src/modules/ROOT/pages/responding-to-change/responding-to-change.adoc b/docs/src/modules/ROOT/pages/responding-to-change/responding-to-change.adoc index ec715da7a6..8d57b098ef 100644 --- a/docs/src/modules/ROOT/pages/responding-to-change/responding-to-change.adoc +++ b/docs/src/modules/ROOT/pages/responding-to-change/responding-to-change.adoc @@ -306,7 +306,7 @@ use xref:responding-to-change/responding-to-change.adoc#problemChange[ProblemCha [#configureAPinningFilter] ==== Configure a `PinningFilter` -WARNING: `PinningFilter` is deprecated for removal in a future version of Timefold Solver. +WARNING: `PinningFilter` is deprecated and will be removed in Timefold Solver 2.0. Use `@PlanningPin` as described above. Alternatively, to pin some planning entities down, diff --git a/docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-to-latest-version.adoc b/docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-to-latest-version.adoc index ed648c73cd..d3ef679236 100644 --- a/docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-to-latest-version.adoc +++ b/docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-to-latest-version.adoc @@ -59,9 +59,28 @@ Every upgrade note indicates how likely your code will be affected by that chang The upgrade recipe often lists the changes as they apply to Java code. We kindly ask Kotlin users to translate the changes accordingly. +=== Upgrade from 1.30.0 to 1.31.0 + +.icon:exclamation-triangle[role=red] Chained shadow variable deprecated for removal +[%collapsible%open] +==== +Many years ago, we have introduced the xref:using-timefold-solver/modeling-planning-problems.adoc#planningListVariable[list variable] as a better alternative to xref:using-timefold-solver/modeling-planning-problems.adoc#chainedPlanningVariable[chained variables], +easier to both understand and implement. +We have maintained both these paradigms since then, +but in the next major version of the solver, +we will be removing support for chained shadow variables entirely. + +The migration from chained variable to list variable requires some effort and it cannot be automated. +We invite you to read the xref:using-timefold-solver/modeling-planning-problems.adoc#planningListVariable[list variable documentation], +study the xref:quickstart/quarkus-vehicle-routing/quarkus-vehicle-routing-quickstart.adoc[Vehicle Routing quickstart] as an example implementation, +and reach out to us for help should you find yourself stuck. +==== + +''' + === Upgrade from 1.27.0 to 1.28.0 -.icon:exclamation-triangle[role=red] `SolverJobBuilder` `with...SolutionConsumer` methods deprecated. +.icon:exclamation-triangle[role=red] `SolverJobBuilder` `with...SolutionConsumer` methods deprecated for removal [%collapsible%open] ==== Some `SolverJobBuilder` 's methods for consuming solution-related events have been deprecated in favor of new methods that provide more context through event objects: diff --git a/docs/src/modules/ROOT/pages/using-timefold-solver/modeling-planning-problems.adoc b/docs/src/modules/ROOT/pages/using-timefold-solver/modeling-planning-problems.adoc index 05cd8b6019..75762b42ba 100644 --- a/docs/src/modules/ROOT/pages/using-timefold-solver/modeling-planning-problems.adoc +++ b/docs/src/modules/ROOT/pages/using-timefold-solver/modeling-planning-problems.adoc @@ -670,15 +670,6 @@ it will add and remove elements to the ``Collection``s of those shadow variables Use the planning list variable to model problems where the goal is to distribute a number of workload elements among limited resources in a specific order. This includes, for example, vehicle routing, traveling salesman, task assigning, and similar problems. -[NOTE] -==== -Use a <> instead of a planning list variable, -if you need any of the following planning techniques: - -- xref:optimization-algorithms/exhaustive-search.adoc#exhaustiveSearch[exhaustive search], -- coexistence with another list variable. -==== - For example, the vehicle routing problem can be modeled as follows: image::quickstart/vehicle-routing/vehicleRoutingClassDiagramAnnotated.png[] @@ -1554,6 +1545,9 @@ For example, none of the `timeslot` variables of any `Lesson` may be used to det [#chainedPlanningVariable] == Chained planning variable (TSP, VRP, ...) +NOTE: Chained variable is deprecated and will be removed in Timefold Solver 2.0. +Use <> instead. + Chained planning variable is one way to implement the xref:design-patterns/design-patterns.adoc#chainedThroughTimePattern[Chained Through Time pattern]. This pattern is used for some use cases, such as TSP and vehicle routing. Only use the chained planning variable to implement this pattern @@ -1680,6 +1674,9 @@ Despite using the same base annotation as <> instead. + When a planning entity uses <>, you can use the following built-in annotations to derive shadow variables from that genuine planning variable. - xref:bidirectionalVariableForChainedVariable[@InverseRelationShadowVariable]: Used to get the planning entity containing the chained planning variable to which a planning value is assigned;