Skip to main content

ConstraintChannel

Trait ConstraintChannel 

Source
pub trait ConstraintChannel: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn evaluate(&self, state: &[f64]) -> KernelResult<f64>;
    fn dimension_names(&self) -> Vec<String>;
}
Expand description

A domain-agnostic constraint channel operating on a state vector.

Each channel evaluates a constraint dimension and returns a margin in [0, 1], where 0 means “at constraint boundary” and 1 means “maximum headroom”.

Required Methods§

Source

fn name(&self) -> &str

Human-readable name of this constraint channel.

Source

fn evaluate(&self, state: &[f64]) -> KernelResult<f64>

Evaluate this constraint channel against the given state vector.

Returns a margin in [0, 1].

Source

fn dimension_names(&self) -> Vec<String>

Names of state dimensions this channel operates on.

Implementors§