Skip to main content

mamdani_infer

Function mamdani_infer 

Source
pub fn mamdani_infer(
    universe: &[f32],
    rules: &[MamdaniRule<'_>],
    scratch: &mut [f32],
) -> Option<f32>
Expand description

Mamdani inference: clip each rule’s consequent at its firing strength (min-implication), aggregate across rules by max into scratch, then defuzzify by centroid over universe. None if the aggregate set carries no mass. Zero-heap (caller owns scratch, sized to the universe).