ProblemChange

Trait ProblemChange 

Source
pub trait ProblemChange:
    Send
    + Sync
    + Debug {
    // Required methods
    fn do_change(
        &self,
        solution: &mut Value,
        director: &mut dyn ProblemChangeDirector,
    );
    fn to_dto(&self) -> ProblemChangeDto;
}
Expand description

A problem change represents a modification to the planning solution during solving.

Problem changes allow real-time planning by dynamically adding, removing, or modifying planning entities and problem facts while the solver is running.

All modifications to the solution must be performed through the ProblemChangeDirector to ensure that variable listeners are properly notified and the score is correctly updated.

Required Methods§

Source

fn do_change( &self, solution: &mut Value, director: &mut dyn ProblemChangeDirector, )

Apply the change to the working solution.

§Arguments
  • solution - The working solution to modify (as JSON value)
  • director - The director through which all modifications must be made
Source

fn to_dto(&self) -> ProblemChangeDto

Convert to a serializable DTO for transmission to the solver service.

Implementors§