Skip to content

Conversation

@PatrickDiallo23
Copy link
Contributor

Summary

This PR aims to add support for setting the time spend directly, without relying on manually creating a TerminationConfig object (#1254).

Added withTerminationUnimprovedSpentLimit and withTerminationSpentLimit methods in the SolverConfigOverride class. Also, I added 2 tests to ensure code coverage and a proper functionality.

Example

solverFactory.buildSolver(new SolverConfigOverride<VehicleRoutePlan>()
                .withTerminationSpentLimit(...)));

# OR

solverFactory.buildSolver(new SolverConfigOverride<VehicleRoutePlan>()
                .withTerminationUnimprovedSpentLimit(...)));

Copy link
Collaborator

@triceo triceo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!
I've asked some questions in the comments inline, let's have a conversation about this design.

@PatrickDiallo23
Copy link
Contributor Author

@triceo I updated the API as we discussed. I tried to provide a comprehensive documentation so that it will be easier for developers to understand how to use the methods. Please let me know if I used a good approach and if I should also add other unit tests (and where: in the other modified file or I should create SolverConfigOverrideTest class)?

Copy link
Collaborator

@triceo triceo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM when the comments are improved!

@PatrickDiallo23
Copy link
Contributor Author

@triceo I made the changes. I hope everything is better now.

@triceo triceo merged commit 649aba4 into TimefoldAI:main Sep 23, 2025
31 of 32 checks passed
@triceo
Copy link
Collaborator

triceo commented Sep 23, 2025

Thank you, Patrick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SolverConfigOverride should support setting the time spend directly (similar to SolverConfig itself)

2 participants