Skip to content
Shapemetry

Types - Analyze

API reference for ./model/analyze on @huukhanhnguyen/types.

See the Guide for the package's role.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

AnalyzeConfig

type

Design-study vocabulary — sweep / optimize / Monte-Carlo configs and their result tables. Pure records: the runner (@huukhanhnguyen/model) reads them, nothing here holds a live graph object.

type AnalyzeConfig
// = SweepConfig | OptimizeConfig | MonteCarloConfig

AnalyzeMode

type

type AnalyzeMode
// = "sweep" | "optimize" | "monteCarlo"

AnalyzeProgress

type

type AnalyzeProgress
// = (done: number, total: number) => void

AnalyzeRunResult

type

type AnalyzeRunResult
// = AnalyzeTable | OptimizeResult | MonteCarloResult

AnalyzeTable

type

type AnalyzeTable
// = {
    columns: string[];
    rows: unknown[][];
}

MeasureConfig

type

type MeasureConfig
// = {
    key: string;
    expression: string;
}

MonteCarloConfig

type

type MonteCarloConfig
// = {
    parameters: MonteCarloParameterConfig[];
    measures: MeasureConfig[];
    samples?: number;
    seed?: number;
}

MonteCarloParameterConfig

type

A named numeric range — sampled (Monte Carlo) or searched (optimize). Not the same shape as SweepParameterConfig, which walks from/to in discrete steps rather than sampling a range.

type MonteCarloParameterConfig
// = {
    key: string;
    min: number;
    max: number;
}

MonteCarloResult

type

type MonteCarloResult
// = {
    table: AnalyzeTable;
    summary: AnalyzeTable;
}

ObjectiveConfig

type

type ObjectiveConfig
// = {
    expression: string;
    goal: "min" | "max";
}

OptimizeConfig

type

type OptimizeConfig
// = {
    parameters: MonteCarloParameterConfig[];
    objective: ObjectiveConfig;
    maxEvaluations?: number;
}

OptimizeResult

type

type OptimizeResult
// = {
    best: {
        params: Record<string, number>;
        value: number;
    };
    trace: AnalyzeTable;
}

SimplexVertex

type

type SimplexVertex
// = {
    point: number[];
    value: number;
}

SweepConfig

type

type SweepConfig
// = {
    parameters: SweepParameterConfig[];
    measures: MeasureConfig[];
}

SweepParameterConfig

type

type SweepParameterConfig
// = {
    key: string;
    from: number;
    to: number;
    steps: number;
}
Last updated: 📖 1 min readEdit on GitHub