repo_name stringlengths 1 62 | dataset stringclasses 1
value | lang stringclasses 11
values | pr_id int64 1 20.1k | owner stringlengths 2 34 | reviewer stringlengths 2 39 | diff_hunk stringlengths 15 262k | code_review_comment stringlengths 1 99.6k |
|---|---|---|---|---|---|---|---|
timefold-solver | github_2023 | java | 1,422 | TimefoldAI | zepfred | @@ -0,0 +1,78 @@
+package ai.timefold.solver.core.impl.phase.custom;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.time.Duration;
+import java.util.function.BooleanSupplier;
+
+import ai.timefold.solver.core.api.score.director.ScoreDirector;
+import ai.timefold.solver.core.api.solver.Solve... | The name implies it never ends. Perhaps we could use a different name, such as `PhaseEndingCheckPhaseCommand` or something similar. |
timefold-solver | github_2023 | others | 1,422 | TimefoldAI | zepfred | @@ -839,37 +839,38 @@ For example, to implement a custom Construction Heuristic without implementing a
[NOTE]
====
-Most of the time, a custom solver phase is not worth the development time investment.
-xref:optimization-algorithms/construction-heuristics.adoc#constructionHeuristics[Construction Heuristics] are con... | ```suggestion
and end it when it returns true.
``` |
timefold-solver | github_2023 | others | 1,422 | TimefoldAI | zepfred | @@ -93,6 +93,48 @@ var solverConfig = new SolverConfig()
----
====
+''' | Should we provide a recipe for that? |
timefold-solver | github_2023 | others | 1,422 | TimefoldAI | zepfred | @@ -914,23 +908,6 @@ add the `customProperties` element and use xref:using-timefold-solver/configurat
----
-[#noChangeSolverPhase] | I'm curious. Which rare cases would it be? |
timefold-solver | github_2023 | java | 1,411 | TimefoldAI | zepfred | @@ -316,10 +316,11 @@ public List<String> getWarningList() {
+ " Maybe reduce the parallelBenchmarkCount.");
}
EnvironmentMode environmentMode = plannerBenchmarkResult.getEnvironmentMode();
- if (environmentMode != null && environmentMode.isAsserted()) {
+ if (enviro... | Maybe `NO_ASSERT`? |
timefold-solver | github_2023 | java | 1,411 | TimefoldAI | zepfred | @@ -106,22 +130,46 @@ public enum EnvironmentMode {
this.asserted = asserted;
}
+ public boolean isStepAssertOrMore() {
+ return switch (this) {
+ case NON_REPRODUCIBLE, NO_ASSERT, PHASE_ASSERT, STEP_ASSERT, NON_INTRUSIVE_FULL_ASSERT, FULL_ASSERT,
+ TRACKED_FULL_A... | Should it be `NO_ASSERT.isAsserted()` instead? |
timefold-solver | github_2023 | java | 1,411 | TimefoldAI | zepfred | @@ -106,22 +130,46 @@ public enum EnvironmentMode {
this.asserted = asserted;
}
+ public boolean isStepAssertOrMore() {
+ return switch (this) {
+ case NON_REPRODUCIBLE, NO_ASSERT, PHASE_ASSERT, STEP_ASSERT, NON_INTRUSIVE_FULL_ASSERT, FULL_ASSERT,
+ TRACKED_FULL_A... | Same as before |
timefold-solver | github_2023 | java | 1,411 | TimefoldAI | zepfred | @@ -106,22 +130,46 @@ public enum EnvironmentMode {
this.asserted = asserted;
}
+ public boolean isStepAssertOrMore() {
+ return switch (this) {
+ case NON_REPRODUCIBLE, NO_ASSERT, PHASE_ASSERT, STEP_ASSERT, NON_INTRUSIVE_FULL_ASSERT, FULL_ASSERT,
+ TRACKED_FULL_A... | Same as before |
timefold-solver | github_2023 | java | 1,411 | TimefoldAI | zepfred | @@ -106,22 +130,46 @@ public enum EnvironmentMode {
this.asserted = asserted;
}
+ public boolean isStepAssertOrMore() { | Do we have unit tests for this? |
timefold-solver | github_2023 | java | 1,411 | TimefoldAI | zepfred | @@ -106,22 +130,46 @@ public enum EnvironmentMode {
this.asserted = asserted;
}
+ public boolean isStepAssertOrMore() {
+ return switch (this) {
+ case NON_REPRODUCIBLE, NO_ASSERT, PHASE_ASSERT, STEP_ASSERT, NON_INTRUSIVE_FULL_ASSERT, FULL_ASSERT,
+ TRACKED_FULL_A... | Do we have unit tests for this? |
timefold-solver | github_2023 | java | 1,411 | TimefoldAI | zepfred | @@ -106,22 +130,46 @@ public enum EnvironmentMode {
this.asserted = asserted;
}
+ public boolean isStepAssertOrMore() {
+ return switch (this) {
+ case NON_REPRODUCIBLE, NO_ASSERT, PHASE_ASSERT, STEP_ASSERT, NON_INTRUSIVE_FULL_ASSERT, FULL_ASSERT,
+ TRACKED_FULL_A... | Do we have unit tests for this? |
timefold-solver | github_2023 | java | 1,411 | TimefoldAI | zepfred | @@ -69,18 +69,10 @@ protected DefaultConstructionHeuristicPhaseBuilder<Solution_> createBuilder(
HeuristicConfigPolicy<Solution_> phaseConfigPolicy, Termination<Solution_> solverTermination, int phaseIndex,
boolean lastInitializingPhase, EntityPlacer<Solution_> entityPlacer) {
var pha... | Nice! |
timefold-solver | github_2023 | java | 1,411 | TimefoldAI | zepfred | @@ -106,22 +130,46 @@ public enum EnvironmentMode {
this.asserted = asserted;
}
+ public boolean isStepAssertOrMore() {
+ return switch (this) {
+ case NON_REPRODUCIBLE, NO_ASSERT, PHASE_ASSERT, STEP_ASSERT, NON_INTRUSIVE_FULL_ASSERT, FULL_ASSERT,
+ TRACKED_FULL_A... | Do we want to check if it is equal to `NON_INTRUSIVE_FULL_ASSERT`? |
timefold-solver | github_2023 | java | 1,411 | TimefoldAI | zepfred | @@ -106,22 +130,46 @@ public enum EnvironmentMode {
this.asserted = asserted;
}
+ public boolean isStepAssertOrMore() {
+ return switch (this) {
+ case NON_REPRODUCIBLE, NO_ASSERT, PHASE_ASSERT, STEP_ASSERT, NON_INTRUSIVE_FULL_ASSERT, FULL_ASSERT,
+ TRACKED_FULL_A... | ```suggestion
yield this != STEP_ASSERT && this != NON_INTRUSIVE_FULL_ASSERT;
``` |
timefold-solver | github_2023 | java | 1,411 | TimefoldAI | zepfred | @@ -557,38 +559,37 @@ public void afterProblemFactRemoved(Object problemFact) {
public void assertExpectedWorkingScore(Score_ expectedWorkingScore, Object completedAction) {
Score_ workingScore = calculateScore();
if (!expectedWorkingScore.equals(workingScore)) {
- throw new IllegalSta... | ```suggestion
after all %s were triggered without changes to the genuine variables after completedAction (%s).
``` |
timefold-solver | github_2023 | java | 1,411 | TimefoldAI | zepfred | @@ -178,7 +179,7 @@ private SolutionDescriptor<Solution_> buildSolutionDescriptor() {
solverConfig.getGizmoSolutionClonerMap(),
solverConfig.getEntityClassList());
EnvironmentMode environmentMode = solverConfig.determineEnvironmentMode();
- if (environme... | We are not asserting this by default anymore. Is that correct? |
timefold-solver | github_2023 | others | 1,407 | TimefoldAI | TomCools | @@ -269,6 +269,12 @@ public class Lesson {
this.studentGroup = studentGroup;
}
+ public Lesson(String id, String subject, String teacher, String studentGroup, Timeslot timeslot, Room room) { | I would add a comment this constructor is only for tests and make the constructor "package private" (no access modifier). |
timefold-solver | github_2023 | python | 1,037 | TimefoldAI | Christopher-Chianelli | @@ -276,6 +277,23 @@ def apply(self, module_name, globals_map, locals_map, from_list, level):
)
+class InvalidJVMVersionError(Exception):
+ pass
+
+
+def ensure_valid_jvm(runtime=None):
+ if runtime is None:
+ import java.lang.Runtime as runtime
+ try:
+ version = runtime.version().f... | Use `f` strings:
`f"Timefold Solver for Python requires JVM (java) version 17 or later. Your JVM version {version} is not supported. Maybe use sdkman (https://sdkman.io) to install a more modern version of Java."` |
timefold-solver | github_2023 | python | 1,037 | TimefoldAI | Christopher-Chianelli | @@ -80,20 +80,30 @@ def init(*args, path: list[str] = None, include_timefold_jars: bool = True) -> N
if jpype.isJVMStarted(): # noqa
raise RuntimeError('JVM already started. Maybe call init before timefold.solver.types imports?')
+
if path is None:
include_timefold_jars = True
pa... | Can use `path_supplier=jpype.getDefaultJVMPath` as a parameter to make it unit testable, and do `path_supplier()` in the `try` block. |
timefold-solver | github_2023 | java | 1,039 | TimefoldAI | triceo | @@ -74,6 +78,10 @@ public void stepEnded(CustomStepScope<Solution_> stepScope) {
public void phaseEnded(CustomPhaseScope<Solution_> phaseScope) {
super.phaseEnded(phaseScope);
+ // Only update the best solution if the custom phase first initializes the solution and made any change.
+ if (t... | If the score is improved, shouldn't it _always_ give the better solution?
What would be a situation where the best solution should be ignored?
What happens if the custom phase is in between two local search phases? Is this behavior still correct? |
timefold-solver | github_2023 | others | 1,139 | TimefoldAI | triceo | @@ -118,4 +142,13 @@ jobs:
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- if: ${{ github.event.inputs.dryRun == 'false' }}
\ No newline at end of file
+ if: ${{ github.event.inputs.dryRun == 'false' }}
+
+ - name: Put back the 999-SNAPSHOT versio... | Does this work? You can't push directly to a .x branch, they're protected.
Also, this can only happen _after_ we published the tag (release), otherwise the tag will point to 999-SNAPSHOT. |
timefold-solver | github_2023 | others | 1,139 | TimefoldAI | triceo | @@ -48,7 +48,7 @@ jobs:
fetch-depth: 0
ref: ${{ github.event.inputs.sourceBranch }}
- - name: Init release branch
+ - name: Delete existing release branch | ```suggestion
- name: Delete release branch (if exists)
``` |
timefold-solver | github_2023 | others | 1,332 | TimefoldAI | triceo | @@ -39,7 +39,7 @@ jobs:
cache: 'maven'
- name: Build and test timefold-solver
- run: mvn -B verify
+ run: mvn -Dfull -B verify | The reason we don't do this is because it makes the jobs considerably longer.
Arguably, we want to do this once, not in every combination. |
timefold-solver | github_2023 | java | 1,395 | TimefoldAI | Christopher-Chianelli | @@ -1111,6 +1111,10 @@ public long getMaximumValueRangeSize(Solution_ solution) {
*/
public double getProblemScale(Solution_ solution) {
long logBase = getMaximumValueRangeSize(solution);
+ if (logBase == 1 && getListVariableDescriptor() != null && getListVariableDescriptor().allowsUnassigned... | Comment incorrect; scale would be NaN, since `log(1) = 0`; as for what `logBase` actually does, it is the base of the logarithm used in calculations (which is converted back to base 10 after all the calculations are done).
It defaults to the maximum value range size, since for basic planning variables, usually each en... |
timefold-solver | github_2023 | java | 1,395 | TimefoldAI | Christopher-Chianelli | @@ -1110,7 +1110,11 @@ public long getMaximumValueRangeSize(Solution_ solution) {
* @return {@code >= 0}
*/
public double getProblemScale(Solution_ solution) {
- long logBase = getMaximumValueRangeSize(solution);
+ long logBase = Math.max(2, getMaximumValueRangeSize(solution));
+ i... | This `if` should be removed; it will never trigger (logBase is at least 2).
```suggestion
``` |
timefold-solver | github_2023 | java | 1,320 | TimefoldAI | triceo | @@ -28,4 +40,26 @@ public String getPhaseTypeString() {
return "Ruin & Recreate Construction Heuristics";
}
+ @Override
+ protected void doStep(ConstructionHeuristicStepScope<Solution_> stepScope) {
+ if (elementsToRuinSet != null) {
+ var listVariableDescriptor = stepScope.getPh... | ```suggestion
// Sometimes, the list of elements to be ruined does not include new destinations selected by the CH.
// In these cases, we need to record the element list before making any move changes
// so that it can be referenced to restore the solution to its origi... |
timefold-solver | github_2023 | java | 1,320 | TimefoldAI | triceo | @@ -24,29 +26,73 @@ public static <Solution_> RuinRecreateConstructionHeuristicPhaseBuilder<Solution
HeuristicConfigPolicy<Solution_> solverConfigPolicy, ConstructionHeuristicPhaseConfig constructionHeuristicConfig) {
var constructionHeuristicPhaseFactory =
new RuinRecreateConstru... | `multithreaded` |
timefold-solver | github_2023 | java | 1,320 | TimefoldAI | triceo | @@ -24,29 +26,73 @@ public static <Solution_> RuinRecreateConstructionHeuristicPhaseBuilder<Solution
HeuristicConfigPolicy<Solution_> solverConfigPolicy, ConstructionHeuristicPhaseConfig constructionHeuristicConfig) {
var constructionHeuristicPhaseFactory =
new RuinRecreateConstru... | Shouldn't this be called `withMultithreaded`? |
timefold-solver | github_2023 | java | 1,320 | TimefoldAI | triceo | @@ -143,10 +173,23 @@ public SolutionDescriptor<Solution_> getSolutionDescriptor() {
return delegate.getSolutionDescriptor();
}
+ /**
+ * Returns the score director to which events are delegated.
+ */
public InnerScoreDirector<Solution_, ?> getDelegate() {
return delegate;
... | ```suggestion
public InnerScoreDirector<Solution_, ?> getBacking() {
return backingScoreDirector;
}
``` |
timefold-solver | github_2023 | java | 1,320 | TimefoldAI | triceo | @@ -143,10 +173,23 @@ public SolutionDescriptor<Solution_> getSolutionDescriptor() {
return delegate.getSolutionDescriptor();
}
+ /**
+ * Returns the score director to which events are delegated.
+ */
public InnerScoreDirector<Solution_, ?> getDelegate() {
return delegate;
... | For safety, shouldn't `delegate` be `null` here instead?
That way, you can possibly also avoid the boolean - if the delegate is null, do not delegate. |
timefold-solver | github_2023 | java | 1,320 | TimefoldAI | triceo | @@ -0,0 +1,48 @@
+package ai.timefold.solver.core.impl.heuristic.selector.move.generic;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import ai.timefold.solver.core.config.constructionheuristic.ConstructionHeuristicPhase... | ```suggestion
void buildMultiThreaded() {
``` |
timefold-solver | github_2023 | java | 1,320 | TimefoldAI | triceo | @@ -0,0 +1,48 @@
+package ai.timefold.solver.core.impl.heuristic.selector.move.generic;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import ai.timefold.solver.core.config.constructionheuristic.ConstructionHeuristicPhase... | ```suggestion
void buildSingleThreaded() {
``` |
timefold-solver | github_2023 | java | 1,309 | TimefoldAI | triceo | @@ -203,4 +203,20 @@ public void recordListAssignment(ListVariableDescriptor<Solution_> variableDescr
variableChanges.add(new ListVariableAfterAssignmentAction<>(element, variableDescriptor));
}
}
+
+ /**
+ * Record a before list assigment.
+ * Used when moves with nested phases cr... | Two questions:
1. If this is `recordBeforeListVariableChanged`, does it mean that `recordListAssignment()` should instead be `recordAfterListVariableChanged`?
2. We typically call the usual before/after methods on the score director, except in this case, where we have a whole new bunch of methods. It is confusin... |
timefold-solver | github_2023 | java | 1,309 | TimefoldAI | triceo | @@ -95,6 +95,19 @@ protected void doMoveOnGenuineVariables(ScoreDirector<Solution_> scoreDirector)
}
for (var entry : entityToInsertedValuesMap.entrySet()) {
+ if (!entityToOriginalPositionMap.containsKey(entry.getKey())) {
+ // The entity has not been evaluated while creat... | This is strange, and probably inefficient.
Why put the null entries into the list, only to remove them later?
Copying the list will be a big perf bottleneck. |
timefold-solver | github_2023 | java | 1,309 | TimefoldAI | triceo | @@ -95,7 +98,32 @@ protected void doMoveOnGenuineVariables(ScoreDirector<Solution_> scoreDirector)
}
for (var entry : entityToInsertedValuesMap.entrySet()) {
- recordingScoreDirector.recordListAssignment(listVariableDescriptor, entry.getKey(), entry.getValue());
+ if (!entityTo... | I'm wondering if this recorder type isn't overkill. Effectively what you need to do is:
- Have before/after events that are delegated to the underlying score director.
- Have before/after events that are not delegated.
So why not create duplicates of the before/after methods, which clearly say they will not be delegat... |
timefold-solver | github_2023 | java | 1,258 | TimefoldAI | triceo | @@ -341,4 +344,36 @@ void constructionHeuristicAllocateToValueFromQueue() {
assertThat(solution.getScore().isSolutionInitialized()).isTrue();
}
+ @Test
+ void constructionHeuristicWithDifficultyWeight() {
+ // Default configuration
+ var solverConfig = PlannerTestUtils.buildSolverCon... | I'll be honest - I don't like this. We can't be testing everything by running the solver. It takes too much time, and the tests get bloated.
I'd verify that this was detected on the Entity Descriptor, and that's that. |
timefold-solver | github_2023 | java | 1,258 | TimefoldAI | triceo | @@ -0,0 +1,61 @@
+package ai.timefold.solver.core.impl.testdata.domain.difficultyweight;
+
+import ai.timefold.solver.core.api.domain.entity.PlanningEntity;
+import ai.timefold.solver.core.api.domain.variable.PlanningVariable;
+import ai.timefold.solver.core.impl.domain.entity.descriptor.EntityDescriptor;
+import ai.ti... | This is no longer necessary, some methods possibly too. Please simplify. |
timefold-solver | github_2023 | others | 1,236 | TimefoldAI | triceo | @@ -307,7 +307,7 @@ jobs:
sed -i "s/\${maven\.compiler\.release}/$(find build/build-parent/ -name pom.xml -exec grep '<maven.compiler.release>' {} \;|tail -n 1|cut -d\> -f1 --complement|cut -d\< -f1)/g" docs/src/antora.yml
sed -i "s/\${maven\.min\.version}/$(find build/build-parent/ -name pom.xml ... | Shouldn't this be:
```suggestion
sed -i "s/\${version\.org\.springframework\.boot}/$(find build/build-parent/ -name pom.xml -exec grep '<version.org.springframework.boot>' {} \;|tail -n 1|cut -d\> -f1 --complement|cut -d\< -f1)/g" docs/src/antora.yml
``` |
timefold-solver | github_2023 | others | 1,236 | TimefoldAI | triceo | @@ -307,7 +307,7 @@ jobs:
sed -i "s/\${maven\.compiler\.release}/$(find build/build-parent/ -name pom.xml -exec grep '<maven.compiler.release>' {} \;|tail -n 1|cut -d\> -f1 --complement|cut -d\< -f1)/g" docs/src/antora.yml
sed -i "s/\${maven\.min\.version}/$(find build/build-parent/ -name pom.xml ... | Also, I think this needs a fix as well. It reads the Maven version, not the Quarkus version. |
timefold-solver | github_2023 | others | 1,232 | TimefoldAI | triceo | @@ -287,13 +281,60 @@ jobs:
node-version-file: .nvmrc
cache: npm
+ - name: Checkout timefold-solver
+ uses: actions/checkout@v4
+ with:
+ repository: "${{ github.event.pull_request.head.repo.owner.login || 'TimefoldAI' }}/timefold-solver"
+ ref: ${{ github.ev... | I'm thinking maybe we do the `sed` right here, instead of first sending the information to env and then reading it from there?
It's a lot of boilerplate already, and I don't think the extra script makes it easier to read or maintain. |
timefold-solver | github_2023 | others | 1,140 | TimefoldAI | triceo | @@ -259,6 +259,53 @@ jobs:
env:
PIP_FIND_LINKS: ${{ github.workspace }}/timefold-solver/dist
run: tox
+
+ build_documentation:
+ runs-on: ubuntu-latest
+ needs: approval_required
+ env:
+ BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
+ steps:
+ - name: Checko... | No deploy? |
timefold-solver | github_2023 | others | 1,140 | TimefoldAI | pieterdeschepper | @@ -259,6 +259,61 @@ jobs:
env:
PIP_FIND_LINKS: ${{ github.workspace }}/timefold-solver/dist
run: tox
+
+ build_documentation:
+ runs-on: ubuntu-latest
+ needs: approval_required
+ name: Build Documentation
+ env:
+ BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
+ ... | Instead of all these `sed` replaces, I'd prefer something like the below for a couple of reasons:
- It's independent of any changes made to the original file (right now, making changes in the sources of the original file, might break your sed-replace
- It doesn't give any insights into our private repo / setup
The f... |
timefold-solver | github_2023 | others | 1,394 | TimefoldAI | triceo | @@ -13,10 +13,11 @@ You are allowed to use Timefold Solver Enterprise Edition for evaluation and dev
Please contact https://timefold.ai/contact[contact Timefold]
to obtain the credentials necessary to start your evaluation.
+TIP: All our https://docs.timefold.ai/field-service-routing/latest/introduction[pre-built P... | Does the "TIP" actually highlight in AsciiDoc?
I think you have to jump through some hoops. |
timefold-solver | github_2023 | others | 1,394 | TimefoldAI | triceo | @@ -14,6 +14,13 @@ that offers xref:enterprise-edition/enterprise-edition.adoc#enterpriseEditionFea
to scale out to very large datasets.
To find out more, see xref:enterprise-edition/enterprise-edition.adoc[Enterprise Edition section] of this documentation.
+== Does Timefold offer pre-built models to speed up devel... | Throughout the docs, we say "Timefold Solver Enterprise Edition". It's a mouthful, I know - but I guess consistency wins? |
timefold-solver | github_2023 | others | 1,394 | TimefoldAI | triceo | @@ -14,6 +14,13 @@ that offers xref:enterprise-edition/enterprise-edition.adoc#enterpriseEditionFea
to scale out to very large datasets.
To find out more, see xref:enterprise-edition/enterprise-edition.adoc[Enterprise Edition section] of this documentation.
+== Does Timefold offer pre-built models to speed up devel... | I'd rephrase to something like "See all available models at ...", which will let you hide the link there. |
timefold-solver | github_2023 | others | 1,394 | TimefoldAI | triceo | @@ -10,7 +10,13 @@
Every organization faces planning problems: providing products or services with a limited set of _constrained_ resources (employees, assets, time, and money).
Timefold Solver’s xref:planning-ai-concepts.adoc[PlanningAI] optimizes these problems to do more business with fewer resources using Constra... | Sometimes you just leave the URL, just like here.
Other times, it seems you actually describe it, as below.
Is this intentional? |
timefold-solver | github_2023 | others | 1,394 | TimefoldAI | triceo | @@ -23,6 +26,9 @@ Pick one that aligns with your requirements:
All three quick starts use Timefold Solver to optimize a school timetable for student and teachers:
+IMPORTANT: The https://github.com/TimefoldAI/timefold-quickstarts[timefold-quickstarts] repository
+contains the source code for all these guides and m... | Won't highlight. |
timefold-solver | github_2023 | others | 1,394 | TimefoldAI | triceo | @@ -15,6 +15,8 @@ include::../../_attributes.adoc[]
This guide walks you through the process of creating a Vehicle Routing application
with https://quarkus.io/[Quarkus] and https://timefold.ai[Timefold]'s constraint solving Artificial Intelligence (AI).
+TIP: https://docs.timefold.ai/field-service-routing/latest/in... | Dtto. |
timefold-solver | github_2023 | others | 1,394 | TimefoldAI | triceo | @@ -5,6 +5,14 @@
:sectnums:
:icons: font
+[TIP]
+====
+While we've simplified model creation with our constraint solver, it can still be complex and time-consuming.
+If rapid deployment is crucial, consider our pre-built models.
+Designed to tackle common optimization challenges, they integrate seamlessly through o... | Another instance. |
timefold-solver | github_2023 | others | 1,394 | TimefoldAI | lee-carlon | @@ -14,6 +14,13 @@ that offers xref:enterprise-edition/enterprise-edition.adoc#enterpriseEditionFea
to scale out to very large datasets.
To find out more, see xref:enterprise-edition/enterprise-edition.adoc[Enterprise Edition section] of this documentation.
+== Does Timefold offer pre-built models to speed up devel... | PP: I'm not a fan of rhetorical questions in docs.
Perhaps: Timefold's pre-built models speed up development. |
timefold-solver | github_2023 | others | 1,394 | TimefoldAI | lee-carlon | @@ -6,8 +6,11 @@
overview-quickstarts.adoc
:imagesdir: ../..
-IMPORTANT: The https://github.com/TimefoldAI/timefold-quickstarts[timefold-quickstarts] repository
-contains the source code for all these guides and more.
+[TIP]
+====
+This documentation covers our Open Source solver and is meant in case you want t... | ```suggestion
This documentation covers our Open Source solver to build a model from scratch.
``` |
timefold-solver | github_2023 | others | 1,372 | TimefoldAI | Christopher-Chianelli | @@ -1316,13 +1317,12 @@ Python::
[source,python,options="nowrap"]
----
def do_not_over_assign_equipment(factory: ConstraintFactory) -> Constraint:
- return (factory.for_each(Equipment)
- .join(Job, Joiners.equal(lambda equipment: equipment.id, lambda job: job.required_equipment_id))
- ... | Use snake case for Python names
```suggestion
lambda job: job.start_time,
lambda job: job.end_time)
``` |
timefold-solver | github_2023 | others | 1,372 | TimefoldAI | Christopher-Chianelli | @@ -1260,8 +1259,8 @@ Python::
+
[source,python,options="nowrap"]
----
-.group_by(lambda match, team: team,
- ConstraintCollectors.toConsecutiveSequences(lambda match, team: match.round, lambda match_round: match_round.index))
+.group_by(lambda match,
+ ConstraintCollectors.to_consecutive_sequences(la... | ```suggestion
ConstraintCollectors.to_consecutive_sequences(lambda match: match.home_team, lambda match: match.round_id))
``` |
timefold-solver | github_2023 | others | 1,372 | TimefoldAI | Christopher-Chianelli | @@ -1230,10 +1229,8 @@ Python::
----
def multiple_consecutive_home_matches(factory: ConstraintFactory) -> Constraint:
return (factory.for_each(Match)
- .join(Team,
- Joiners.equal(lambda match: match.home_team, lambda team: team))
- .group_by(lambda mat... | ```suggestion
ConstraintCollectors.to_consecutive_sequences(lambda match: match.home_team, lambda match: match.round_id))
``` |
timefold-solver | github_2023 | others | 1,372 | TimefoldAI | Christopher-Chianelli | @@ -1339,23 +1341,26 @@ Java::
+
[source,java,options="nowrap"]
----
- .groupBy((equipment, job) -> equipment, ConstraintCollectors.toConnectedRanges((equipment, job) -> job,
- Job::getStart,
- Job::getEnd,
- (a, b) -> b - a))
- ... | ```suggestion
lambda job: job.start_time,
lambda job: job.end_time
``` |
timefold-solver | github_2023 | others | 1,372 | TimefoldAI | Christopher-Chianelli | @@ -1371,6 +1376,36 @@ Finally, we use <<constraintStreamsMappingTuples,mapping>> to calculate the viol
For example, if the equipment has a `capacity` of `3`, and the `maximumOverlap` of the `resource` is `5`, then `violationAmount` will be `2`.
If the amount is `0`, then the equipment is not being used over its capa... | Inline comments should be seperated by code by at least 2 spaces, and have a space before text.
https://peps.python.org/pep-0008/#inline-comments
```suggestion
lambda a, b: b - a) # Difference calculator
``` |
timefold-solver | github_2023 | java | 1,375 | TimefoldAI | zepfred | @@ -381,22 +383,32 @@ public interface SolverManager<Solution_, ProblemId_> extends AutoCloseable {
@NonNull
SolverStatus getSolverStatus(@NonNull ProblemId_ problemId);
- // TODO Future features
- // void reloadProblem(ProblemId_ problemId, Function<? super ProblemId_, Solution_> problemFinder);
+... | Two different interfaces utilize these methods. Perhaps we should create a separate contract for the problem change operations and allow SolverJob and SolverManager to extend it. |
timefold-solver | github_2023 | java | 1,375 | TimefoldAI | zepfred | @@ -158,14 +159,18 @@ private void solvingTerminated() {
}
@Override
- public @NonNull CompletableFuture<Void> addProblemChange(@NonNull ProblemChange<Solution_> problemChange) {
- Objects.requireNonNull(problemChange, () -> "A problem change (%s) must not be null.".formatted(problemId));
- ... | “listfor” missing space |
timefold-solver | github_2023 | java | 1,370 | TimefoldAI | zepfred | @@ -3,54 +3,104 @@
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
-import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.a... | I understand the goal of this block, but I'm uncertain about setting `lastProcessedVersion` here. It seems we identify a more recent change, but we revert it to the earlier version. Should we keep the new version? |
timefold-solver | github_2023 | java | 1,370 | TimefoldAI | zepfred | @@ -3,54 +3,104 @@
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
-import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.a... | Maybe we can update `lastProcessedVersion` before returning the changes. |
timefold-solver | github_2023 | java | 1,370 | TimefoldAI | zepfred | @@ -61,77 +113,56 @@ BestSolutionContainingProblemChanges<Solution_> take() {
* @param isEveryProblemChangeProcessed a supplier that tells if all problem changes have been processed
*/
void set(Solution_ bestSolution, BooleanSupplier isEveryProblemChangeProcessed) {
- problemChangesLock.lock();
... | Nice! |
timefold-solver | github_2023 | java | 1,370 | TimefoldAI | rsynek | @@ -2,30 +2,42 @@
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.variable.VariableListener;
import ai.timefold.solver.core.api.score.Score;
import ai.timefold.solver.core.api.solver.So... | Valuable info for users, thanks! |
timefold-solver | github_2023 | java | 1,362 | TimefoldAI | zepfred | @@ -122,4 +138,31 @@ public interface SolverJobBuilder<Solution_, ProblemId_> {
*/
@NonNull
SolverJob<Solution_, ProblemId_> run();
+
+ /**
+ * A consumer that accepts the first initialized solution.
+ *
+ * @param <Solution_> the solution type, the class with the {@link PlanningSolution}... | ```suggestion
* Therefore, the solution captured with {@link SolverJobBuilder#withBestSolutionConsumer(Consumer)}
``` |
timefold-solver | github_2023 | java | 1,362 | TimefoldAI | zepfred | @@ -83,17 +103,24 @@ public void solve(SolverScope<Solution_> solverScope) {
+ ") has selected move count (" + stepScope.getSelectedMoveCount()
+ ") but failed to pick a nextStep (" + stepScope.getStep() + ").");
}
- // Although s... | Why are we using a static method? |
timefold-solver | github_2023 | java | 1,362 | TimefoldAI | zepfred | @@ -1,27 +1,48 @@
package ai.timefold.solver.core.impl.phase.custom;
+import java.util.Iterator;
import java.util.List;
import ai.timefold.solver.core.api.domain.solution.PlanningSolution;
import ai.timefold.solver.core.impl.phase.AbstractPhase;
+import ai.timefold.solver.core.impl.phase.PossiblyInitializingPha... | This class shares a logic similar to that of the construction phase. We can consider adding a new abstract phase, `AbstractPossiblyInitializingPhase`, that extends `AbstractPhase` and implements `PossiblyInitializingPhase`. The new class can specify the relevant attributes and implement the related phase events. |
timefold-solver | github_2023 | java | 1,362 | TimefoldAI | zepfred | @@ -32,21 +32,23 @@ public abstract class AbstractPhase<Solution_> implements Phase<Solution_> {
protected final boolean assertStepScoreFromScratch;
protected final boolean assertExpectedStepScore;
protected final boolean assertShadowVariablesAreNotStaleAfterStep;
- protected final boolean triggerFirs... | Adding a new abstract class won't require casting here. |
timefold-solver | github_2023 | others | 1,362 | TimefoldAI | zepfred | @@ -57,6 +57,35 @@ 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 and Python users to translate the changes accordingly.
+=== Upgrade from 1.18.0 to 1.19.0 | Why are we not adding a recipe for that? |
timefold-solver | github_2023 | others | 1,362 | TimefoldAI | zepfred | @@ -57,6 +57,35 @@ 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 and Python users to translate the changes accordingly.
+=== Upgrade from 1.18.0 to 1.19.0
+
+.icon:info-circle[role=yellow] ... | ```suggestion
`SolverJob`'s `FirstInitializedSolutionConsumer` gets an additional argument
``` |
timefold-solver | github_2023 | java | 1,362 | TimefoldAI | zepfred | @@ -0,0 +1,83 @@
+package ai.timefold.solver.core.impl.phase;
+
+import ai.timefold.solver.core.api.domain.solution.PlanningSolution;
+import ai.timefold.solver.core.impl.constructionheuristic.ConstructionHeuristicPhase;
+import ai.timefold.solver.core.impl.localsearch.LocalSearchPhase;
+import ai.timefold.solver.core.... | Do we need to duplicate this comment? |
timefold-solver | github_2023 | java | 1,362 | TimefoldAI | zepfred | @@ -0,0 +1,83 @@
+package ai.timefold.solver.core.impl.phase;
+
+import ai.timefold.solver.core.api.domain.solution.PlanningSolution;
+import ai.timefold.solver.core.impl.constructionheuristic.ConstructionHeuristicPhase;
+import ai.timefold.solver.core.impl.localsearch.LocalSearchPhase;
+import ai.timefold.solver.core.... | There was a validation at `AbstractPhase`:
```
if (builder.isLastInitializingPhase() && !(this instanceof PossiblyInitializingPhase)) {
...
```
Is it no longer necessary? |
timefold-solver | github_2023 | java | 1,343 | TimefoldAI | triceo | @@ -15,7 +15,7 @@ public final class SolverConfigBuildItem extends SimpleBuildItem {
* Constructor for multiple solver configurations.
*/
public SolverConfigBuildItem(Map<String, SolverConfig> solverConfig, GeneratedGizmoClasses generatedGizmoClasses) {
- this.solverConfigurations = solverConfig... | Please add a comment explaining why this is necessary. |
timefold-solver | github_2023 | java | 1,343 | TimefoldAI | triceo | @@ -573,6 +577,43 @@ private SolverConfig loadSolverConfig(IndexView indexView,
return solverConfig;
}
+ @BuildStep
+ void buildConstraintMetaModel(SolverConfigBuildItem solverConfigBuildItem, | This is new code? I don't understand. Didn't we already have support for this, and therefore the code should have been either reused, or moved from elsewhere? |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,171 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import java.util.NavigableMap;
+import java.util.TreeMap;
+
+import ai.timefold.solver.core.api.score.Score;
+import ai.timefold.solver.core.impl.phase.scope.AbstractPhaseScope;
+import ai.timefold.solver.core.impl.phase.scope.AbstractStepSc... | I was skeptical of this approach, as fast-stepping algorithms will easily put tens of thousands of entries to this map per second, and I was expecting that to be both CPU-intensive and memory-intensive.
However, in the experiments I ran, this did not materialize. Impact of the termination is barely visible in the da... |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,171 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import java.util.NavigableMap;
+import java.util.TreeMap;
+
+import ai.timefold.solver.core.api.score.Score;
+import ai.timefold.solver.core.impl.phase.scope.AbstractPhaseScope;
+import ai.timefold.solver.core.impl.phase.scope.AbstractStepSc... | Typically, I would be all for a carrier type like this. In this case, and on the hot path, I'd rather store the two variables individually and avoid allocating instances of the wrapper.
In fact, this is the only thing that actually made a measurable impact in my experiments - `LevelScoreDiff` was ~10th most allocat... |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,171 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import java.util.NavigableMap;
+import java.util.TreeMap;
+
+import ai.timefold.solver.core.api.score.Score;
+import ai.timefold.solver.core.impl.phase.scope.AbstractPhaseScope;
+import ai.timefold.solver.core.impl.phase.scope.AbstractStepSc... | I wonder if we should use nanotime instead, and truncate it to millis.
The precision of `currentTimeMillis` is questionable, see Javadoc:
> Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, m... |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,171 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import java.util.NavigableMap;
+import java.util.TreeMap;
+
+import ai.timefold.solver.core.api.score.Score;
+import ai.timefold.solver.core.impl.phase.scope.AbstractPhaseScope;
+import ai.timefold.solver.core.impl.phase.scope.AbstractStepSc... | I wonder if there's a way to estimate this based on how close we are to the minimum necessary improvement. |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,171 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import java.util.NavigableMap;
+import java.util.TreeMap;
+
+import ai.timefold.solver.core.api.score.Score;
+import ai.timefold.solver.core.impl.phase.scope.AbstractPhaseScope;
+import ai.timefold.solver.core.impl.phase.scope.AbstractStepSc... | Arguably, you can save yourself some of this work. `compareTo()` the two scores; if no better, no need to do anything anymore. The comparison works directly on the underlying data types, so no need to convert them to doubles and create a new array of them. |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,171 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import java.util.NavigableMap;
+import java.util.TreeMap;
+
+import ai.timefold.solver.core.api.score.Score;
+import ai.timefold.solver.core.impl.phase.scope.AbstractPhaseScope;
+import ai.timefold.solver.core.impl.phase.scope.AbstractStepSc... | You can use `@NullMarked` on the class, which means that everything is `@NonNull` unless marked as `@Nullable`. In my experience, this saves a lot of hassle. |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -1,57 +1,71 @@
package ai.timefold.solver.core.impl.solver.termination;
-import java.util.NavigableMap;
-import java.util.TreeMap;
-
import ai.timefold.solver.core.api.score.Score;
import ai.timefold.solver.core.impl.phase.scope.AbstractPhaseScope;
import ai.timefold.solver.core.impl.phase.scope.AbstractStepSc... | May I suggest we return an impossible value instead of using exceptions for control flow? Perhaps [NaN](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html#NaN)? |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -1,57 +1,71 @@
package ai.timefold.solver.core.impl.solver.termination;
-import java.util.NavigableMap;
-import java.util.TreeMap;
-
import ai.timefold.solver.core.api.score.Score;
import ai.timefold.solver.core.impl.phase.scope.AbstractPhaseScope;
import ai.timefold.solver.core.impl.phase.scope.AbstractStepSc... | Can the score be _worse_ here? Arguably, it can - sometimes the solver picks a deteriorating move to try to get out of a local optima. |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,203 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import java.util.Arrays;
+import java.util.Objects;
+
+import ai.timefold.solver.core.api.score.Score;
+
+import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
+
+final class AdaptiveScoreRingBuffer<Score_ exten... | Is there a way to refactor the ring buffer to make it a general-purpose collection?
I can see it being useful to the Solver for more than this. |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,210 @@
+package ai.timefold.solver.core.config.solver.termination;
+
+import static ai.timefold.solver.core.config.solver.termination.TerminationConfig.requireNonNegative;
+
+import java.time.Duration;
+import java.util.function.Consumer;
+
+import jakarta.xml.bind.annotation.XmlType;
+import jakarta.xml.bin... | Is this how the other terminations deal with durations? It would make more sense to me to merge all of those data points into `Duration` - as that is the one data type that brings semantics (as opposed to `long`).
But if this is how the other terminations do this, then so be it. |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,224 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import java.util.Arrays;
+import java.util.NavigableMap;
+import java.util.Objects;
+
+import ai.timefold.solver.core.api.score.Score;
+
+import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * A heavil... | Maybe use `@see` for the link? |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,224 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import java.util.Arrays;
+import java.util.NavigableMap;
+import java.util.Objects;
+
+import ai.timefold.solver.core.api.score.Score;
+
+import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * A heavil... | Where did this number come from?
It's generally a good idea to explain in a comment what you used to determine the value. Even if it just says "Arbitrary.", it gives future us an insight into your mind. |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,224 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import java.util.Arrays;
+import java.util.NavigableMap;
+import java.util.Objects;
+
+import ai.timefold.solver.core.api.score.Score;
+
+import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * A heavil... | I wonder if:
- Throwing away the array and re-allocating it would be faster than clearing it. (Maybe not.)
- We should allocate the array using the original size, not using whatever size it is now. |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,224 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import java.util.Arrays;
+import java.util.NavigableMap;
+import java.util.Objects;
+
+import ai.timefold.solver.core.api.score.Score;
+
+import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * A heavil... | Since the array starts as empty, this should not be annotated as `@NonNull`, because `null` is entirely possible. |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,224 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import java.util.Arrays;
+import java.util.NavigableMap;
+import java.util.Objects;
+
+import ai.timefold.solver.core.api.score.Score;
+
+import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * A heavil... | Do you want to treat this as an exception? I see two options here:
- Either this is an exceptional state which must not happen, because the algorithm would not be correct. Then the message should start with "Impossible state: ", and I'm going to argue it should be thrown by the code calling this method, not by this ... |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,179 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import ai.timefold.solver.core.api.score.Score;
+import ai.timefold.solver.core.impl.phase.scope.AbstractPhaseScope;
+import ai.timefold.solver.core.impl.phase.scope.AbstractStepScope;
+import ai.timefold.solver.core.impl.solver.scope.Solver... | If the length of the window was a `Duration` (see my comment on the termination config), then you could avoid this and just call `slidingWindowDuration.toMillis()`. |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,179 @@
+package ai.timefold.solver.core.impl.solver.termination;
+
+import ai.timefold.solver.core.api.score.Score;
+import ai.timefold.solver.core.impl.phase.scope.AbstractPhaseScope;
+import ai.timefold.solver.core.impl.phase.scope.AbstractStepScope;
+import ai.timefold.solver.core.impl.solver.scope.Solver... | ```suggestion
throw new IllegalStateException("Impossible state: The score deteriorated from (%s) to (%s) during the grace period."
``` |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -122,6 +122,19 @@ The termination with bestScoreFeasible (%s) can only be used with a score type \
+ unimprovedTimeMillisSpentLimit + ") is used too.");
}
+ if (terminationConfig.getDiminishedReturnsConfig() != null) {
+ var adaptiveTerminationConfig = terminationCon... | See Slack thread on the "correct" default value. |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -48,6 +48,9 @@ private static String getRequiredProperty(String name) {
.overrideConfigKey("quarkus.timefold.solver.termination.best-score-limit", "0")
.overrideConfigKey("quarkus.timefold.solver.move-thread-count", "4")
.overrideConfigKey("quarkus.timefold.solver-manager.paral... | Arguably this is not necessary, if either of the other two properties is present? |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,24 @@
+package ai.timefold.solver.quarkus;
+
+class TimefoldProcessorXMLDiminishedReturnsTest { | Delete or finish? |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,44 @@
+package ai.timefold.solver.quarkus.config;
+
+import java.time.Duration;
+import java.util.Optional;
+
+import io.quarkus.runtime.annotations.ConfigGroup;
+
+@ConfigGroup
+public interface DiminishedReturnsRuntimeConfig {
+ /**
+ * If set to true, adds a termination to the local search
+ * ... | `OptionalDouble` exists.
(For some reason, `OptionalBoolean` does not.) |
timefold-solver | github_2023 | java | 1,313 | TimefoldAI | triceo | @@ -0,0 +1,44 @@
+package ai.timefold.solver.quarkus.config;
+
+import java.time.Duration;
+import java.util.Optional;
+
+import io.quarkus.runtime.annotations.ConfigGroup;
+
+@ConfigGroup
+public interface DiminishedReturnsRuntimeConfig {
+ /**
+ * If set to true, adds a termination to the local search
+ * ... | Please remember to update. |
timefold-solver | github_2023 | others | 1,313 | TimefoldAI | triceo | @@ -637,6 +637,126 @@ This is useful for benchmarking.
Switching xref:using-timefold-solver/running-the-solver.adoc#environmentMode[EnvironmentMode] can heavily impact when this termination ends.
+[#diminishedReturnsTermination]
+==== `DiminishedReturnsTermination`
+
+Terminates when the rate of improvement is bel... | I think we should talk about the softest score here. |
timefold-solver | github_2023 | others | 1,313 | TimefoldAI | triceo | @@ -637,6 +637,126 @@ This is useful for benchmarking.
Switching xref:using-timefold-solver/running-the-solver.adoc#environmentMode[EnvironmentMode] can heavily impact when this termination ends.
+[#diminishedReturnsTermination]
+==== `DiminishedReturnsTermination`
+
+Terminates when the rate of improvement is bel... | Since this is a core part of the algorithm, I don't think it should be a NOTE. Rather, a normal text like everything else.
Also, the above comment about the softest score will pay off here, where we talk about the hard score all of a sudden. |
timefold-solver | github_2023 | others | 1,313 | TimefoldAI | triceo | @@ -637,6 +637,126 @@ This is useful for benchmarking.
Switching xref:using-timefold-solver/running-the-solver.adoc#environmentMode[EnvironmentMode] can heavily impact when this termination ends.
+[#diminishedReturnsTermination]
+==== `DiminishedReturnsTermination`
+
+Terminates when the rate of improvement is bel... | I consider this section too verbose. It's IMO enough to show the duration and the seconds, and then mention we also support the others. |
timefold-solver | github_2023 | others | 1,313 | TimefoldAI | triceo | @@ -637,6 +637,126 @@ This is useful for benchmarking.
Switching xref:using-timefold-solver/running-the-solver.adoc#environmentMode[EnvironmentMode] can heavily impact when this termination ends.
+[#diminishedReturnsTermination]
+==== `DiminishedReturnsTermination`
+
+Terminates when the rate of improvement is bel... | I'd invert this statement - this termination cannot be used globally on the solver, only on a phase, and not on a CH phase. |
timefold-solver | github_2023 | others | 1,313 | TimefoldAI | triceo | @@ -637,6 +637,126 @@ This is useful for benchmarking.
Switching xref:using-timefold-solver/running-the-solver.adoc#environmentMode[EnvironmentMode] can heavily impact when this termination ends.
+[#diminishedReturnsTermination]
+==== `DiminishedReturnsTermination`
+
+Terminates when the rate of improvement is bel... | I'd mention that the termination can run for a very long time, and add a recommendation to combine the termination with a maximum time spent, to ensure it doesn't run for longer than acceptable.
Do we have a test for this? When I was toying with the termination, I saw some weird behavior where a composite terminatio... |
timefold-solver | github_2023 | others | 1,313 | TimefoldAI | triceo | @@ -637,6 +637,126 @@ This is useful for benchmarking.
Switching xref:using-timefold-solver/running-the-solver.adoc#environmentMode[EnvironmentMode] can heavily impact when this termination ends.
+[#diminishedReturnsTermination]
+==== `DiminishedReturnsTermination` | I'd start with an introductory paragraph explaining why we've done this. Absolute terminations are hard to configure, because they either depend on hardware (time-based) or on the problem (score-based). The relative termination doesn't have this problem. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.