Skip to content

refactor: clean up around problem changes#2121

Merged
triceo merged 1 commit intoTimefoldAI:mainfrom
triceo:pfc
Feb 13, 2026
Merged

refactor: clean up around problem changes#2121
triceo merged 1 commit intoTimefoldAI:mainfrom
triceo:pfc

Conversation

@triceo
Copy link
Copy Markdown
Collaborator

@triceo triceo commented Feb 13, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the solver's problem change handling and removes deprecated functionality. It modernizes the API by removing ProblemFactChange in favor of ProblemChange, converting BestSolutionChangedEvent from a class to an interface, and eliminating the unused NoChangePhase feature along with its associated configuration and implementation files.

Changes:

  • Removed deprecated NoChangePhase functionality (class, factory, config, tests, XSD definitions)
  • Removed deprecated ProblemFactChange API in favor of ProblemChange
  • Converted BestSolutionChangedEvent from a class to an interface with DefaultBestSolutionChangedEvent as its implementation
  • Removed ProblemChangeAdapter and updated problem change processing to work directly with ProblemChange
  • Removed deprecated addProblemFactChange* and isEveryProblemFactChangeProcessed methods from Solver interface
  • Updated test code to use modern Java var syntax and simplified API
  • Fixed typo "occured" → "occurred" in SolveEventProducerId

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
core/src/main/resources/solver.xsd Removed noChangePhase element and type definitions
tools/benchmark/src/main/resources/benchmark.xsd Removed noChangePhase element and type definitions
spring-integration/.../reflect-config.json Removed NoChangePhaseConfig reflection configuration
spring-integration/.../solver-full.xml Removed noChangePhase test element
quarkus-integration/.../gizmoSupplierTestSolverConfig.xml Removed noChangePhase test element
core/.../testSolverConfigWithoutNamespace.xml Removed noChangePhase test element
core/.../NoChangePhase.java Deleted deprecated phase implementation
core/.../NoChangePhaseFactory.java Deleted deprecated phase factory
core/.../NoChangePhaseConfig.java Deleted deprecated phase configuration
core/.../NoChangePhaseTest.java Deleted test for deprecated functionality
core/.../ProblemFactChange.java Deleted deprecated interface
core/.../ProblemChangeAdapter.java Deleted adapter interface
core/.../BestSolutionChangedEvent.java Converted from class to interface
core/.../DefaultBestSolutionChangedEvent.java New implementation of BestSolutionChangedEvent interface
core/.../Solver.java Removed deprecated methods and updated to use @NullMarked
core/.../DefaultSolver.java Updated to use ProblemChange directly, removed deprecated methods
core/.../BasicPlumbingTermination.java Changed to use ProblemChange instead of ProblemChangeAdapter
core/.../BasicPlumbingTerminationTest.java Updated tests to use modern syntax and new API
core/.../EventProducerId.java Removed deprecated unknown() method
core/.../SolveEventProducerId.java Removed UNKNOWN enum value, fixed spelling
core/.../PhaseType.java Removed NO_CHANGE enum value
core/.../PhaseFactory.java Removed NoChangePhaseConfig handling
core/.../AbstractPhaseFactory.java Removed NoChangePhaseFactory check
core/.../SolverConfig.java Removed NoChangePhaseConfig from XML elements
core/.../PhaseConfig.java Removed NoChangePhaseConfig from subclasses
core/.../PartitionedSearchPhaseConfig.java Removed NoChangePhaseConfig from XML elements
core/.../CompositeMoveSelector.java Reformatted long error message
core/.../AbstractSolver.java Removed unused isTerminationSameAsSolverTermination method
docs/TODO.md Added items for BestSolutionChangedEvent and ProblemChange changes

Copy link
Copy Markdown
Contributor

@zepfred zepfred left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@Christopher-Chianelli Christopher-Chianelli left a comment

Choose a reason for hiding this comment

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

LGTM after Copilot suggestions are applied (in particular, if there are multiple ProblemChanges, a later ProblemChange may have to deal with a working solution with stale shadow variables since the adapter (that was removed) used to call updateShadowVariables). We probably should add a test for this case.

@sonarqubecloud
Copy link
Copy Markdown

@triceo triceo merged commit 69ccead into TimefoldAI:main Feb 13, 2026
21 of 22 checks passed
@triceo triceo deleted the pfc branch February 13, 2026 16:11
@triceo triceo added this to the v2.0.0.CR1 milestone Feb 13, 2026
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.

4 participants