Skip to content

Commit be46582

Browse files
authored
Merge pull request #36 from popmonkey/release-cleanup
Release cleanup
2 parents a8a0566 + 2c80bba commit be46582

7 files changed

Lines changed: 45 additions & 78 deletions

File tree

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ git submodule update --init --recursive
5050

5151
The HiGHS library must be installed on your system.
5252

53+
>[!NOTE]
54+
>If CMake cannot find a system-installed version of HiGHS, it will automatically download and build it as part of the project configuration process. While this simplifies setup, a pre-installed version is recommended for faster build times.
55+
5356
#### macOS (Homebrew)
5457

5558
This is the easiest method for macOS:
@@ -117,7 +120,7 @@ We use a standard out-of-source CMake build.
117120
118121
This will create the main products in the `build/` directory:
119122
120-
* `libjres_solver.a` (or `.lib` on Windows): The static library.
123+
* `libjres_solver.so` or `libjres_solver.a` (or `.dll`/`.lib`): The shared or static library. The type depends on the `BUILD_SHARED_LIBS` CMake option (defaults to ON).
121124
* `jres_solver` (or `jres_solver.exe`): The solver CLI executable.
122125
* `jres_formatter` (or `jres_formatter.exe`): The formatter CLI executable.
123126

README.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,18 @@ These structs are used to represent the availability of team members.
7373
| `schedule_len` | `int` | The number of schedule entries. |
7474
| `diagnosis` | `const char**` | An array of strings with diagnostic information. Empty on success. |
7575
| `diagnosis_len` | `int` | The number of diagnosis strings. |
76+
| `stats` | `JresSolverStats*` | Solver performance and complexity metrics. |
77+
| `options` | `JresSolverOptions*` | The options used to generate this solution. |
7678
| `teamMembers` | `JresTeamMember*` | A pointer to an array of team members, including their tzOffset. |
7779
| `teamMembers_len` | `int` | The number of team members. |
7880

7981
`JresScheduleEntry`
8082

8183
| Field | Type | Description |
8284
| :--- | :--- | :--- |
83-
| `stintId` | `int` | The ID of the stint. |
85+
| `id` | `int` | The ID of the stint. |
86+
| `startTime` | `const char*` | ISO 8601 timestamp for the start of the stint. |
87+
| `endTime` | `const char*` | ISO 8601 timestamp for the end of the stint. |
8488
| `driver` | `const char*` | Name of the assigned driver. |
8589
| `spotter` | `const char*` | Name of the assigned spotter. |
8690

@@ -255,7 +259,9 @@ The `jres_output_to_json` function returns a JSON string containing the solution
255259

256260
| Field | Type | Description |
257261
| :--- | :--- | :--- |
258-
| `stintId` | Integer | The ID of the stint. |
262+
| `id` | Integer | The ID of the stint. |
263+
| `startTime` | String | ISO 8601 timestamp for the start of the stint. |
264+
| `endTime` | String | ISO 8601 timestamp for the end of the stint. |
259265
| `driver` | String | Name of the assigned driver. |
260266
| `spotter` | String | Name of the assigned spotter (if Spotter Mode is active). |
261267

@@ -268,9 +274,27 @@ When the solver fails, the `schedule` array will be empty, and the `diagnosis` a
268274
```json
269275
{
270276
"schedule": [
271-
{ "stintId": 1, "driver": "Niki", "spotter": "Alain" },
272-
{ "stintId": 2, "driver": "Niki", "spotter": "Alain" },
273-
{ "stintId": 3, "driver": "Alain", "spotter": "Niki" }
277+
{
278+
"id": 1,
279+
"startTime": "2024-06-15T15:00:00Z",
280+
"endTime": "2024-06-15T16:00:00Z",
281+
"driver": "Niki",
282+
"spotter": "Alain"
283+
},
284+
{
285+
"id": 2,
286+
"startTime": "2024-06-15T16:00:00Z",
287+
"endTime": "2024-06-15T17:00:00Z",
288+
"driver": "Niki",
289+
"spotter": "Alain"
290+
},
291+
{
292+
"id": 3,
293+
"startTime": "2024-06-15T17:00:00Z",
294+
"endTime": "2024-06-15T18:00:00Z",
295+
"driver": "Alain",
296+
"spotter": "Niki"
297+
}
274298
],
275299
"diagnosis": []
276300
}

TOOLS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ jres_solver.exe [options]
4848
| :--- | :------------------- | :-------------------------------------------------------------------------------------------- | :------ |
4949
| `-i` | `--input` | Path to the race data `.json` file. Reads from `stdin` if omitted. | `stdin` |
5050
| `-o` | `--output` | Path to save the calculated schedule (JSON). **Required for the Formatter.** | `stdout`|
51-
| `-t` | `--time-limit` | Maximum time (in seconds) to let the optimizer run. | `30` |
51+
| `-t` | `--time-limit` | Maximum time (in seconds) to let the optimizer run. | `5` |
5252
| `-q` | `--quiet` | Suppress INFO logs and the printed schedule summary. | `false` |
5353
| `-s` | `--spotter-mode` | Strategy for assigning spotters. Options: `none`, `integrated`, `sequential`. | `none` |
5454
| | `--allow-no-spotter` | Allow specific stints to have no spotter assigned (if spotter mode is active). | `false` |
55-
| `-g` | `--optimality-gap` | Stop solver when the solution is within this gap of perfection (e.g., `0.01` for 1%). | `0.0` |
55+
| `-g` | `--optimality-gap` | Stop solver when the solution is within this gap of perfection (e.g., `0.2` for 20%). | `0.2` |
5656
| `-d` | `--diagnose` | Run in **Diagnostic Mode** to explain why a schedule is infeasible. | `false` |
5757
| `-h` | `--help` | Print usage instructions. | |
5858

include/jres_solver/jres_json_converter.hpp

Lines changed: 0 additions & 60 deletions
This file was deleted.

include/jres_solver/jres_solver.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ JRES_SOLVER_API char* jres_output_to_json(const JresSolverOutput* output);
200200

201201
JRES_SOLVER_API void free_jres_solver_input(JresSolverInput* input);
202202
JRES_SOLVER_API void free_jres_solver_output(JresSolverOutput* output);
203+
JRES_SOLVER_API const char* jres_get_last_error();
203204
JRES_SOLVER_API void free_json_string(char* json_string);
204205

205206
#ifdef __cplusplus

src/jres_json_converter.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @file src/jres_json_converter.cpp
44
* @brief JSON conversion functions for the JRES Solver library.
55
*/
6-
#include "jres_solver/jres_json_converter.hpp"
6+
#include "jres_solver/jres_solver.hpp"
77
#include "nlohmann/json.hpp"
88
#include <iostream>
99
#include <cstring>
@@ -57,7 +57,7 @@ char* allocate_and_copy(const std::string& s) {
5757
return cstr;
5858
}
5959

60-
JresSolverInput* jres_input_from_json(const char* jsonData) {
60+
JRES_SOLVER_API JresSolverInput* jres_input_from_json(const char* jsonData) {
6161
last_error_message.clear(); // Clear previous error
6262
try {
6363
json j = json::parse(jsonData);
@@ -125,7 +125,7 @@ JresSolverInput* jres_input_from_json(const char* jsonData) {
125125
}
126126

127127

128-
char* jres_output_to_json(const JresSolverOutput* output) {
128+
JRES_SOLVER_API char* jres_output_to_json(const JresSolverOutput* output) {
129129
last_error_message.clear(); // Clear previous error
130130
if (!output) {
131131
last_error_message = "Output is nullptr.";
@@ -194,11 +194,11 @@ char* jres_output_to_json(const JresSolverOutput* output) {
194194
}
195195
}
196196

197-
const char* jres_get_last_error() {
197+
JRES_SOLVER_API const char* jres_get_last_error() {
198198
return last_error_message.c_str();
199199
}
200200

201-
void free_jres_solver_output(JresSolverOutput* output) {
201+
JRES_SOLVER_API void free_jres_solver_output(JresSolverOutput* output) {
202202
if (!output) {
203203
return;
204204
}
@@ -232,7 +232,7 @@ void free_jres_solver_output(JresSolverOutput* output) {
232232
delete output;
233233
}
234234

235-
void free_jres_solver_input(JresSolverInput* input) {
235+
JRES_SOLVER_API void free_jres_solver_input(JresSolverInput* input) {
236236
if (!input) {
237237
return;
238238
}

src/jres_solver.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
#include "jres_internal_types.hpp"
88
#include "jres_standard_solver.hpp"
99
#include "jres_diagnostic_solver.hpp"
10-
#include "jres_solver/jres_json_converter.hpp"
1110

12-
JresSolverOutput* solve_race_schedule(const JresSolverInput* input, const JresSolverOptions* options) {
11+
JRES_SOLVER_API JresSolverOutput* solve_race_schedule(const JresSolverInput* input, const JresSolverOptions* options) {
1312
try {
1413
jres::internal::SolverInput internal_input = jres::internal::from_c_input(input);
1514
JresStandardSolver solver(internal_input, *options);
@@ -26,7 +25,7 @@ JresSolverOutput* solve_race_schedule(const JresSolverInput* input, const JresSo
2625
}
2726
}
2827

29-
JresSolverOutput* diagnose_race_schedule(const JresSolverInput* input, const JresSolverOptions* options) {
28+
JRES_SOLVER_API JresSolverOutput* diagnose_race_schedule(const JresSolverInput* input, const JresSolverOptions* options) {
3029
try {
3130
jres::internal::SolverInput internal_input = jres::internal::from_c_input(input);
3231
JresDiagnosticSolver solver(internal_input, *options);
@@ -43,6 +42,6 @@ JresSolverOutput* diagnose_race_schedule(const JresSolverInput* input, const Jre
4342
}
4443
}
4544

46-
void free_json_string(char* json_string) {
45+
JRES_SOLVER_API void free_json_string(char* json_string) {
4746
delete[] json_string;
4847
}

0 commit comments

Comments
 (0)