mwg API
    Preparing search index...

    Interface HeuristicStage<A>

    interface HeuristicStage<A = unknown> {
        id: string;
        weigh?: (
            candidate: HeuristicCandidate<A>,
            context: HeuristicContext,
        ) => number;
        when?: (context: HeuristicContext) => boolean;
    }

    Type Parameters

    • A = unknown
    Index
    id: string
    weigh?: (candidate: HeuristicCandidate<A>, context: HeuristicContext) => number

    score one candidate; higher wins. Defaults to defaultWeigh

    when?: (context: HeuristicContext) => boolean

    whether this stage runs at all; it always does when omitted