Skip to content

Commit 74740fe

Browse files
TomCoolsoemebamoCopilot
authored
doc: Apply suggestions from code review
Co-authored-by: Jurriaan Persyn <oemebamo@gmail.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 631a585 commit 74740fe

6 files changed

Lines changed: 21 additions & 20 deletions

File tree

docs/src/modules/ROOT/pages/quickstart/overview.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Deploy a fully isolated optimization service. This opinionated approach reduces
4747

4848
| *Best for*
4949
| Embedding the solver into an existing application
50-
| Running optimization as a standalone, isolated service
50+
| Running optimization as a standalone, isolated service that is easier to integrate, orchestrate & scale
5151

5252
| *Ease of use*
5353
| Requires manual wiring: you manage configuration, lifecycle, and integration

docs/src/modules/ROOT/pages/quickstart/shared/_whatyoubuild.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
You will build an optimization solution that runs locally on your machine, and optimizes a school timetable for students and teachers.
44

5-
Your application will assign `Lessons` to `Timeslots` and `Rooms` automatically
5+
Your application will assign `Lesson` instances to `Timeslot` and `Room` instances automatically
66
by using AI to adhere to hard and soft scheduling _constraints_, for example:
77

88
* A room can have at most one lesson at the same time.

docs/src/modules/ROOT/pages/quickstart/shared/school-timetabling/_school-timetabling-constraints.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Soft constraints are weighted too, against other soft constraints.
1919
*Hard constraints always outweigh soft constraints*, regardless of their respective weights.
2020

2121
To calculate the score, implement a `TimetableConstraintProvider` class.
22-
It uses Timefold Solver's xref:https://docs.timefold.ai/timefold-solver/latest/constraints-and-score/score-calculation[Constraint Streams API]
22+
It uses Timefold Solver's xref:constraints-and-score/score-calculation.adoc[Constraint Streams API]
2323
which is inspired by Java Streams and SQL:
2424

2525
[tabs]

docs/src/modules/ROOT/pages/service/constraint-weights.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ Next, in the xref:./rest-api.adoc#modelConverter[model converter], make sure to
9797
----
9898
TimetableConfigOverrides modelConfigOverrides = modelConfig.overrides();
9999
100-
ConstraintWeightOverrides<HardMediumSoftLongScore> constraintWeightOverrides = ConstraintWeightOverrides.none();
101-
constraintWeightOverrides = ConstraintWeightOverrides.of(
102-
Map.ofEntries(
103-
Map.entry(TEACHER_CONFLICT,
104-
HardMediumSoftLongScore.ofHard(modelConfigOverrides.getTeacherConflictWeight())),
105-
Map.entry(ROOM_COMFLICT,
106-
HardMediumSoftLongScore
107-
.ofSoft(modelConfigOverrides.getRoomConflictWeight()));
100+
ConstraintWeightOverrides<HardMediumSoftLongScore> constraintWeightOverrides = ConstraintWeightOverrides.of(
101+
Map.ofEntries(
102+
Map.entry(TimetableConstraintProvider.TEACHER_CONFLICT,
103+
HardMediumSoftLongScore.ofHard(modelConfigOverrides.getTeacherConflictWeight())),
104+
Map.entry(TimetableConstraintProvider.ROOM_CONFLICT,
105+
HardMediumSoftLongScore.ofSoft(modelConfigOverrides.getRoomConflictWeight()))
106+
)
107+
);
108108
109109
solverModel.setConstraintWeightOverrides(constraintWeightOverrides);
110110
----

docs/src/modules/ROOT/pages/service/rest-api.adoc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ If your model provides xref:./demo-data.adoc[demo data], the following endpoints
6969
== Request and response structure
7070

7171
The generated endpoints do not accept/return the pure `ModelInput`/`ModelOutput` objects as JSON.
72-
Instead, a fixed envelop is used for both the requests and responses of solver actions.
72+
Instead, a fixed envelope is used for both the requests and responses of solver actions.
7373

7474
=== Structured solving request
7575

@@ -158,7 +158,7 @@ Additionally, more fields might be added for specific model implementations:
158158
"warnings": []
159159
}
160160
},
161-
"modelOutput": <ModelOutput class as JSON>,
161+
"modelOutput": "<ModelOutput class as JSON>",
162162
"inputMetrics": {
163163
"lessons": 200,
164164
"timeslots": 50
@@ -202,20 +202,21 @@ To convert between `ModelInput` / `ModelOutput` and the `SolverModel`, a `ModelC
202202
[source,java,options="nowrap"]
203203
----
204204
@ApplicationScoped
205-
public class TimetableConvertor implements ModelConvertor<HardSoftLongScore, TimetableDto, Timetable, EmptyModelConfigOverrides, EmptyModelInputMetrics, EmptyModelOutputMetrics, Timetable> {
205+
public class TimetableConvertor implements ModelConvertor<HardSoftLongScore, TimetableDto, EmptyModelConfigOverrides, Timetable, TimetableDto> {
206206
207207
@Override
208-
public Timetable toSolverModel(TimetableDto modelInput, TimetableDto previousModelOutput, ModelConfig<EmptyModelConfigOverrides> modelConfig) {
208+
public Timetable toSolverModel(TimetableDto modelInput, ModelConfig<EmptyModelConfigOverrides> modelConfig,
209+
Optional<TimetableDto> lastModelOutput) {
209210
return // Mapping logic
210211
}
211212
212213
@Override
213-
public Timetable toSolverModel(TimetableDto modelInput, ModelConfig<EmptyModelConfigOverrides> modelConfig) {
214+
public TimetableDto toModelOutput(Timetable solverModel) {
214215
return // Mapping logic
215216
}
216217
217218
@Override
218-
public TimetableDto toModelOutput(Timetable solverModel) {
219+
public TimetableDto applyOutputToInput(TimetableDto modelInput, TimetableDto modelOutput) {
219220
return // Mapping logic
220221
}
221222
}
@@ -309,11 +310,11 @@ The `metadata` object is a part of the model response json and contains the vali
309310

310311
Additionally, a richer validation result can be obtained by a dedicated REST endpoint:
311312

312-
`GET /v1/timetables/+{id}+/validation-result`
313+
`GET /v1/timetables/\{id\}/validation-result`
313314

314315
Assuming the xref:timetableValidatorExample[example TimetableValidator], the endpoint provides the following response:
315316

316-
.Validation result available via `GET /v1/timetables/+{id}+/validation-result`.
317+
.Validation result available via `GET /v1/timetables/\{id\}/validation-result`.
317318
[source,json, highlight=13..17]
318319
----
319320
{

docs/src/modules/ROOT/pages/using-timefold-solver/running-the-solver.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:sectnums:
66
:icons: font
77
:relevance: core-only
8-
:notes: Too much things service module does automatically or with 1 single configuration.
8+
:notes: Too many things the service module does automatically, or with a single configuration.
99

1010
[#theSolverInterface]
1111
== The `Solver` interface

0 commit comments

Comments
 (0)