Skip to content
Shapemetry

Model - Analyze

API reference for src/schema/analyze, src/core/analyze on @huukhanhnguyen/model, reachable from ., ./compute.

See the Guide for the ModelJSON / evaluate pipeline.

API reference

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

AnalyzeModel

type

type AnalyzeModel
// = {
    nodes: NodeCollectionHost<ChildNode>;
    scope: ModelScopeHost;
}

monteCarlo

function

Same monteCarloSteps algorithm, driven with event-loop yields (see CHUNK_SIZE's doc).

monteCarlo(model: AnalyzeModel, config: MonteCarloConfig, onProgress?: AnalyzeProgress): Promise<MonteCarloResult>

monteCarloSync

function

Same algorithm, driven synchronously — see sweepSync's doc.

monteCarloSync(model: AnalyzeModel, config: MonteCarloConfig, onProgress?: AnalyzeProgress): MonteCarloResult

optimize

function

Same optimizeSteps algorithm, driven with event-loop yields (see CHUNK_SIZE's doc).

optimize(model: AnalyzeModel, config: OptimizeConfig, onProgress?: AnalyzeProgress): Promise<OptimizeResult>

optimizeSync

function

Same algorithm, driven synchronously — see sweepSync's doc.

optimizeSync(model: AnalyzeModel, config: OptimizeConfig, onProgress?: AnalyzeProgress): OptimizeResult

sweep

function

Grid-sweep config.parameters (1 or 2 in practice, but any count works) over their own linspace, evaluating every config.measures expression at each grid point — yields to the event loop every CHUNK_SIZE evaluations.

sweep(model: AnalyzeModel, config: SweepConfig, onProgress?: AnalyzeProgress): Promise<AnalyzeTable>

sweepSync

function

Same algorithm as sweep, driven synchronously (no event-loop yields) — for a caller that must return without awaiting anything (tableAnalyze's detached-copy resolution, see Model.ts's _runAnalysis).

sweepSync(model: AnalyzeModel, config: SweepConfig, onProgress?: AnalyzeProgress): AnalyzeTable
Last updated: 📖 1 min readEdit on GitHub