Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ai.timefold.solver.core.api.domain.lookup;
package ai.timefold.solver.core.api.domain.common;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import ai.timefold.solver.core.api.domain.common.ComparatorFactory;
import ai.timefold.solver.core.api.domain.solution.PlanningSolution;
import ai.timefold.solver.core.api.domain.variable.PlanningVariable;
import ai.timefold.solver.core.impl.heuristic.selector.common.decorator.SelectionSorterWeightFactory;

/**
* Specifies that the class is a planning entity.
Expand Down Expand Up @@ -69,80 +68,4 @@ interface NullComparator<T> extends Comparator<T> {
interface NullComparatorFactory<Solution_, T> extends ComparatorFactory<Solution_, T> {
}

/**
* A pinned planning entity is never changed during planning,
* this is useful in repeated planning use cases (such as continuous planning and real-time planning).
* This applies to all the planning variables of this planning entity.
* <p>
* The method {@link PinningFilter#accept(Object, Object)} returns false if the selection entity is pinned
* and it returns true if the selection entity is movable
*
* @return {@link NullPinningFilter} when it is null (workaround for annotation limitation)
* @deprecated Prefer using {@link PlanningPin}.
*/
@Deprecated(forRemoval = true, since = "1.23.0")
Class<? extends PinningFilter> pinningFilter() default NullPinningFilter.class;

/**
* Workaround for annotation limitation in {@link #pinningFilter()}.
*
* @deprecated Prefer using {@link PlanningPin}.
*/
@Deprecated(forRemoval = true, since = "1.23.0")
interface NullPinningFilter extends PinningFilter {
}

/**
* Allows a collection of planning entities to be sorted by difficulty.
* A difficultyWeight estimates how hard is to plan a certain PlanningEntity.
* Some algorithms benefit from planning on more difficult planning entities first/last or from focusing on them.
* <p>
* The {@link Comparator} should sort in ascending difficulty
* (even though many optimization algorithms will reverse it).
* For example: sorting 3 processes on difficultly based on their RAM usage requirement:
* Process B (1GB RAM), Process A (2GB RAM), Process C (7GB RAM),
* <p>
* Do not use together with {@link #difficultyWeightFactoryClass()}.
*
* @deprecated Deprecated in favor of {@link #comparatorClass()}.
*
* @return {@link NullDifficultyComparator} when it is null (workaround for annotation limitation)
* @see #difficultyWeightFactoryClass()
*/
@Deprecated(forRemoval = true, since = "1.28.0")
Class<? extends Comparator> difficultyComparatorClass() default NullDifficultyComparator.class;

/**
* Workaround for annotation limitation in {@link #difficultyComparatorClass()}.
*
* @deprecated Deprecated in favor of {@link NullComparator}.
*/
@Deprecated(forRemoval = true, since = "1.28.0")
interface NullDifficultyComparator<T> extends NullComparator<T> {
}

/**
* The {@link SelectionSorterWeightFactory} alternative for {@link #difficultyComparatorClass()}.
* <p>
* Do not use together with {@link #difficultyComparatorClass()}.
*
* @deprecated Deprecated in favor of {@link #comparatorFactoryClass()}.
*
* @return {@link NullDifficultyWeightFactory} when it is null (workaround for annotation limitation)
* @see #difficultyComparatorClass()
*/
@Deprecated(forRemoval = true, since = "1.28.0")
Class<? extends SelectionSorterWeightFactory> difficultyWeightFactoryClass() default NullDifficultyWeightFactory.class;

/**
* Workaround for annotation limitation in {@link #difficultyWeightFactoryClass()}.
*
* @deprecated Deprecated in favor of {@link NullComparatorFactory}.
*/
@Deprecated(forRemoval = true, since = "1.28.0")
interface NullDifficultyWeightFactory<Solution_, T>
extends SelectionSorterWeightFactory<Solution_, T>,
NullComparatorFactory<Solution_, T> {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import java.lang.annotation.Target;

import ai.timefold.solver.core.api.domain.autodiscover.AutoDiscoverMemberType;
import ai.timefold.solver.core.api.domain.lookup.LookUpStrategyType;
import ai.timefold.solver.core.api.domain.lookup.PlanningId;
import ai.timefold.solver.core.api.domain.solution.cloner.SolutionCloner;
import ai.timefold.solver.core.api.score.stream.ConstraintProvider;

Expand Down Expand Up @@ -73,11 +71,4 @@
interface NullSolutionCloner extends SolutionCloner {
}

/**
* @deprecated When multi-threaded solving, ensure your domain classes use {@link PlanningId} instead.
*/
@Deprecated(forRemoval = true, since = "1.10.0")
@NonNull
LookUpStrategyType lookUpStrategyType() default LookUpStrategyType.PLANNING_ID_OR_NONE;

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import ai.timefold.solver.core.api.domain.entity.PlanningEntity;
import ai.timefold.solver.core.api.domain.solution.PlanningSolution;
import ai.timefold.solver.core.api.domain.valuerange.ValueRangeProvider;
import ai.timefold.solver.core.impl.heuristic.selector.common.decorator.SelectionSorterWeightFactory;

/**
* Specifies that a bean property (or a field) can be changed and should be optimized by the optimization algorithms.
Expand Down Expand Up @@ -84,63 +83,4 @@ interface NullComparator<T> extends Comparator<T> {
interface NullComparatorFactory<Solution_, T> extends ComparatorFactory<Solution_, T> {
}

/**
* As defined by {@link #allowsUnassigned()}.
*
* @deprecated Use {@link #allowsUnassigned()} instead.
* @return true if null is a valid value for this planning variable
*/
@Deprecated(forRemoval = true, since = "1.8.0")
boolean nullable() default false;

/**
* Allows a collection of planning values for this variable to be sorted by strength.
* A strengthWeight estimates how strong a planning value is.
* Some algorithms benefit from planning on weaker planning values first or from focusing on them.
* <p>
* The {@link Comparator} should sort in ascending strength.
* For example: sorting 3 computers on strength based on their RAM capacity:
* Computer B (1GB RAM), Computer A (2GB RAM), Computer C (7GB RAM),
* <p>
* Do not use together with {@link #strengthWeightFactoryClass()}.
*
* @deprecated Deprecated in favor of {@link #comparatorClass()}.
*
* @return {@link NullStrengthComparator} when it is null (workaround for annotation limitation)
* @see #strengthWeightFactoryClass()
*/
@Deprecated(forRemoval = true, since = "1.28.0")
Class<? extends Comparator> strengthComparatorClass() default NullStrengthComparator.class;

/**
* Workaround for annotation limitation in {@link #strengthComparatorClass()}.
*
* @deprecated Deprecated in favor of {@link NullComparator}.
*/
@Deprecated(forRemoval = true, since = "1.28.0")
interface NullStrengthComparator<T> extends NullComparator<T> {
}

/**
* The {@link SelectionSorterWeightFactory} alternative for {@link #strengthComparatorClass()}.
* <p>
* Do not use together with {@link #strengthComparatorClass()}.
*
* @deprecated Deprecated in favor of {@link #comparatorFactoryClass()}.
*
* @return {@link NullStrengthWeightFactory} when it is null (workaround for annotation limitation)
* @see #strengthComparatorClass()
*/
@Deprecated(forRemoval = true, since = "1.28.0")
Class<? extends SelectionSorterWeightFactory> strengthWeightFactoryClass() default NullStrengthWeightFactory.class;

/**
* Workaround for annotation limitation in {@link #strengthWeightFactoryClass()}.
*
* @deprecated Deprecated in favor of {@link NullComparatorFactory}.
*/
@Deprecated(forRemoval = true, since = "1.28.0")
interface NullStrengthWeightFactory<Solution_, T>
extends SelectionSorterWeightFactory<Solution_, T>, NullComparatorFactory<Solution_, T> {
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package ai.timefold.solver.core.api.score.director;

import ai.timefold.solver.core.api.domain.lookup.LookUpStrategyType;
import ai.timefold.solver.core.api.domain.lookup.PlanningId;
import ai.timefold.solver.core.api.domain.common.PlanningId;
import ai.timefold.solver.core.api.domain.solution.PlanningSolution;
import ai.timefold.solver.core.api.score.Score;
import ai.timefold.solver.core.api.solver.change.ProblemChange;

import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

/**
Expand All @@ -15,6 +14,7 @@
*
* @param <Solution_> the solution type, the class with the {@link PlanningSolution} annotation
*/
@NullMarked
public interface ScoreDirector<Solution_> {

/**
Expand All @@ -23,7 +23,6 @@ public interface ScoreDirector<Solution_> {
* Because a {@link Score} is best calculated incrementally (by deltas),
* the {@link ScoreDirector} needs to be notified when its {@link PlanningSolution working solution} changes.
*/
@NonNull
Solution_ getWorkingSolution();

void beforeVariableChanged(Object entity, String variableName);
Expand All @@ -44,103 +43,12 @@ public interface ScoreDirector<Solution_> {

void triggerVariableListeners();

/**
* @deprecated Calling this method by user code is not recommended and will lead to unforeseen consequences.
* Use {@link ProblemChange} instead.
*/
@Deprecated(forRemoval = true, since = "1.8.0")
default void beforeEntityAdded(Object entity) {
throw new UnsupportedOperationException();
}

/**
* @deprecated Calling this method by user code is not recommended and will lead to unforeseen consequences.
* Use {@link ProblemChange} instead.
*/
@Deprecated(forRemoval = true, since = "1.8.0")
default void afterEntityAdded(Object entity) {
throw new UnsupportedOperationException();
}

/**
* @deprecated Calling this method by user code is not recommended and will lead to unforeseen consequences.
* Use {@link ProblemChange} instead.
*/
@Deprecated(forRemoval = true, since = "1.8.0")
default void beforeEntityRemoved(Object entity) {
throw new UnsupportedOperationException();
}

/**
* @deprecated Calling this method by user code is not recommended and will lead to unforeseen consequences.
* Use {@link ProblemChange} instead.
*/
@Deprecated(forRemoval = true, since = "1.8.0")
default void afterEntityRemoved(Object entity) {
throw new UnsupportedOperationException();
}

/**
* @deprecated Calling this method by user code is not recommended and will lead to unforeseen consequences.
* Use {@link ProblemChange} instead.
*/
@Deprecated(forRemoval = true, since = "1.8.0")
default void beforeProblemFactAdded(Object problemFact) {
throw new UnsupportedOperationException();
}

/**
* @deprecated Calling this method by user code is not recommended and will lead to unforeseen consequences.
* Use {@link ProblemChange} instead.
*/
@Deprecated(forRemoval = true, since = "1.8.0")
default void afterProblemFactAdded(Object problemFact) {
throw new UnsupportedOperationException();
}

/**
* @deprecated Calling this method by user code is not recommended and will lead to unforeseen consequences.
* Use {@link ProblemChange} instead.
*/
@Deprecated(forRemoval = true, since = "1.8.0")
default void beforeProblemPropertyChanged(Object problemFactOrEntity) {
throw new UnsupportedOperationException();
}

/**
* @deprecated Calling this method by user code is not recommended and will lead to unforeseen consequences.
* Use {@link ProblemChange} instead.
*/
@Deprecated(forRemoval = true, since = "1.8.0")
default void afterProblemPropertyChanged(Object problemFactOrEntity) {
throw new UnsupportedOperationException();
}

/**
* @deprecated Calling this method by user code is not recommended and will lead to unforeseen consequences.
* Use {@link ProblemChange} instead.
*/
@Deprecated(forRemoval = true, since = "1.8.0")
default void beforeProblemFactRemoved(Object problemFact) {
throw new UnsupportedOperationException();
}

/**
* @deprecated Calling this method by user code is not recommended and will lead to unforeseen consequences.
* Use {@link ProblemChange} instead.
*/
@Deprecated(forRemoval = true, since = "1.8.0")
default void afterProblemFactRemoved(Object problemFact) {
throw new UnsupportedOperationException();
}

/**
* Translates an entity or fact instance (often from another {@link Thread} or JVM)
* to this {@link ScoreDirector}'s internal working instance.
* Useful for move rebasing and in a {@link ProblemChange}.
* <p>
* Matching is determined by the {@link LookUpStrategyType} on {@link PlanningSolution}.
* Matching uses a {@link PlanningId} by default.
* Matching uses {@link PlanningId}.
*
* @return null if externalObject is null
* @throws IllegalArgumentException if there is no workingObject for externalObject, if it cannot be looked up
Expand All @@ -156,7 +64,7 @@ default void afterProblemFactRemoved(Object problemFact) {
* It's recommended to use {@link #lookUpWorkingObject(Object)} instead,
* especially in move rebasing code.
*
* @return null if externalObject is null or if there is no workingObject for externalObject
* @return null if externalObject is null, or if there is no workingObject for externalObject
* @throws IllegalArgumentException if it cannot be looked up or if the externalObject's class is not supported
* @throws IllegalStateException if it cannot be looked up
* @param <E> the object type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import java.util.function.Function;
import java.util.function.Predicate;

import ai.timefold.solver.core.api.domain.common.PlanningId;
import ai.timefold.solver.core.api.domain.entity.PlanningEntity;
import ai.timefold.solver.core.api.domain.lookup.PlanningId;
import ai.timefold.solver.core.api.domain.solution.ProblemFactCollectionProperty;
import ai.timefold.solver.core.api.domain.variable.InverseRelationShadowVariable;
import ai.timefold.solver.core.api.domain.variable.PlanningListVariable;
Expand Down
Loading
Loading