pub struct SolverEventSupport<S: PlanningSolution> { /* private fields */ }Expand description
Central event broadcaster for solver events.
Manages listener registration and event distribution. All listener methods are called synchronously in registration order.
Implementations§
Source§impl<S: PlanningSolution> SolverEventSupport<S>
impl<S: PlanningSolution> SolverEventSupport<S>
Sourcepub fn add_solver_listener(&mut self, listener: Arc<dyn SolverEventListener<S>>)
pub fn add_solver_listener(&mut self, listener: Arc<dyn SolverEventListener<S>>)
Adds a solver-level event listener.
Sourcepub fn add_phase_listener(
&mut self,
listener: Arc<dyn PhaseLifecycleListener<S>>,
)
pub fn add_phase_listener( &mut self, listener: Arc<dyn PhaseLifecycleListener<S>>, )
Adds a phase lifecycle listener.
Sourcepub fn add_step_listener(&mut self, listener: Arc<dyn StepLifecycleListener<S>>)
pub fn add_step_listener(&mut self, listener: Arc<dyn StepLifecycleListener<S>>)
Adds a step lifecycle listener.
Sourcepub fn clear_listeners(&mut self)
pub fn clear_listeners(&mut self)
Removes all listeners.
Sourcepub fn fire_best_solution_changed(&self, solution: &S, score: &S::Score)
pub fn fire_best_solution_changed(&self, solution: &S, score: &S::Score)
Fires the best solution changed event.
Sourcepub fn fire_solving_started(&self, solution: &S)
pub fn fire_solving_started(&self, solution: &S)
Fires the solving started event.
Sourcepub fn fire_solving_ended(&self, solution: &S, is_terminated_early: bool)
pub fn fire_solving_ended(&self, solution: &S, is_terminated_early: bool)
Fires the solving ended event.
Sourcepub fn fire_phase_started(&self, phase_index: usize, phase_type: &str)
pub fn fire_phase_started(&self, phase_index: usize, phase_type: &str)
Fires the phase started event.
Sourcepub fn fire_phase_ended(&self, phase_index: usize, phase_type: &str)
pub fn fire_phase_ended(&self, phase_index: usize, phase_type: &str)
Fires the phase ended event.
Sourcepub fn fire_step_started(&self, step_index: u64)
pub fn fire_step_started(&self, step_index: u64)
Fires the step started event.
Sourcepub fn fire_step_ended(&self, step_index: u64, score: &S::Score)
pub fn fire_step_ended(&self, step_index: u64, score: &S::Score)
Fires the step ended event.
Sourcepub fn solver_listener_count(&self) -> usize
pub fn solver_listener_count(&self) -> usize
Returns the number of solver listeners.
Sourcepub fn phase_listener_count(&self) -> usize
pub fn phase_listener_count(&self) -> usize
Returns the number of phase listeners.
Sourcepub fn step_listener_count(&self) -> usize
pub fn step_listener_count(&self) -> usize
Returns the number of step listeners.
Sourcepub fn has_listeners(&self) -> bool
pub fn has_listeners(&self) -> bool
Returns true if there are any listeners registered.
Trait Implementations§
Source§impl<S: PlanningSolution> Debug for SolverEventSupport<S>
impl<S: PlanningSolution> Debug for SolverEventSupport<S>
Source§impl<S: PlanningSolution> Default for SolverEventSupport<S>
impl<S: PlanningSolution> Default for SolverEventSupport<S>
Auto Trait Implementations§
impl<S> Freeze for SolverEventSupport<S>
impl<S> !RefUnwindSafe for SolverEventSupport<S>
impl<S> Send for SolverEventSupport<S>
impl<S> Sync for SolverEventSupport<S>
impl<S> Unpin for SolverEventSupport<S>
impl<S> !UnwindSafe for SolverEventSupport<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more