Skip to main content

OuterLoop

Trait OuterLoop 

Source
pub trait OuterLoop {
    // Required methods
    fn name(&self) -> &'static str;
    fn check(&mut self, ctx: &mut OuterLoopContext<'_, '_>) -> OuterLoopStatus;

    // Provided methods
    fn invalidates(&self) -> Invalidates { ... }
    fn initialize(&mut self, _ctx: &mut OuterLoopContext<'_, '_>) { ... }
}
Expand description

What a loop is allowed to do to a solve.

Deliberately narrower than powsybl’s OuterLoop, which is ServiceLoader- discovered so third parties can register their own. That is a Java-ecosystem affordance; here the list is built by the crate, and the abstraction exists to make the loops compose, not to be extended from outside.

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn check(&mut self, ctx: &mut OuterLoopContext<'_, '_>) -> OuterLoopStatus

Look at the converged state and either accept it or change something.

Provided Methods§

Source

fn invalidates(&self) -> Invalidates

What this loop invalidates when it reports OuterLoopStatus::Unstable. Read by the driver, which then resets or restamps as required. See the module docs.

Source

fn initialize(&mut self, _ctx: &mut OuterLoopContext<'_, '_>)

Called once, before the first solve, with the network in its initial state. The place to record starting tap positions or bus types.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§