simresults

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package simresults is the schema of the result sidecar a SysML v1 migration writes (-migration-results) and the comparison of a migrated run configuration with its tool's stored runs reads (-compare-results).

Index

Constants

View Source
const (
	StatisticRuns      = "N"
	StatisticMean      = "Mean"
	StatisticDeviation = "Deviation"
	StatisticOutOfSpec = "OutOfSpec"
)

The statistics a tool's Monte Carlo analysis records, as it names them.

Variables

This section is empty.

Functions

func Count

func Count(n int64) *int64

Count is n as an optional statistic.

func Real

func Real(v float64) *float64

Real is v as an optional statistic.

Types

type ConfigurationResults

type ConfigurationResults struct {
	// ID is the configuration's xmi:id, Name the qualified name of its action def.
	ID   string `json:"id"`
	Name string `json:"name"`
	// Runs is numberOfRuns (0 for none); Draws is durationSimulationMode as a draw policy ("" for none).
	Runs  int64  `json:"runs,omitempty"`
	Draws string `json:"draws,omitempty"`
	// ClockStep is the step, in seconds, the tool's internal simulation clock ticked by
	// (stepSize in timeUnit, once startTime enables the clock); 0 for the built-in clock.
	ClockStep float64 `json:"clockStep,omitempty"`
	// Target is the part holding the execution target, Behavior the action usage performing it; "" for none.
	Target   string `json:"target,omitempty"`
	Behavior string `json:"behavior,omitempty"`
	// Location is the qualified v1 name of the result package, "" for none.
	Location string `json:"resultLocation,omitempty"`
	// Analysis is the observable the target's Monte Carlo analysis summarises, "" for none.
	Analysis string `json:"analysis,omitempty"`
	// AnalysisCase names the Simulation::MonteCarlo analysis def written for the target and
	// Statistics its declared returns, in order, as the tool names them (Statistic*).
	AnalysisCase string   `json:"analysisCase,omitempty"`
	Statistics   []string `json:"statistics,omitempty"`
	// Observables are the properties the snapshots hold numbers for, sorted.
	Observables []string   `json:"observables"`
	Snapshots   []Snapshot `json:"snapshots"`
	// Notes say what of the tool's results has no place in the sidecar.
	Notes []string `json:"notes,omitempty"`
}

ConfigurationResults are one configuration's run settings and the snapshots the tool stored.

func (*ConfigurationResults) Disagreeing

func (c *ConfigurationResults) Disagreeing(observable string) []Snapshot

Disagreeing are the summaries of observable whose mean lies more than three standard errors from another's, so they cannot be of one model; in snapshot order.

func (*ConfigurationResults) StoredRuns

func (c *ConfigurationResults) StoredRuns() int64

StoredRuns are the runs the snapshots stand for: each summarised snapshot counts its runs, every other one run.

func (*ConfigurationResults) Summarised

func (c *ConfigurationResults) Summarised(observable string) []Snapshot

Summarised are the snapshots recording statistics of observable, in snapshot order; none when every snapshot stores the observable run by run.

func (*ConfigurationResults) Values

func (c *ConfigurationResults) Values(observable string) []float64

Values are the numbers the snapshots hold for observable run by run, in snapshot order; a snapshot summarising the observable holds its mean, which is no run's.

type Results

type Results struct {
	// Source names the v1 document migrated.
	Source         string                 `json:"source"`
	Configurations []ConfigurationResults `json:"configurations"`
}

Results are the result snapshots of every run configuration of a document, in the order the configurations are written.

func Read

func Read(r io.Reader) (*Results, error)

Read reads a sidecar -migration-results wrote: exactly one JSON document indexing at least one configuration; content after it is an error.

func (*Results) Repeats

func (r *Results) Repeats(i int) []string

Repeats notes each summarising snapshot of configuration i that another configuration's snapshot repeats — same name, same statistics, no number apart — since Monte Carlo runs do not come out alike twice, but a stored result is copied.

func (*Results) Summary

func (r *Results) Summary() string

Summary counts what the sidecar indexes: configurations, those with snapshots, snapshots, and the runs they stand for when a snapshot summarises several.

type Snapshot

type Snapshot struct {
	ID         string             `json:"id"`
	Name       string             `json:"name,omitempty"`
	Values     map[string]float64 `json:"values"`
	Statistics *Statistics        `json:"statistics,omitempty"`
}

Snapshot is one run the tool stored: the numbers its slots hold, by property; or the statistics of several runs, when the tool summarised them in one.

func (Snapshot) Repeats

func (s Snapshot) Repeats(o Snapshot) bool

Repeats reports whether o stores the same summarised runs as s: the same name, the same statistics, and no observable both hold a different number of.

type Statistics

type Statistics struct {
	Observable string   `json:"observable"`
	Runs       int64    `json:"runs"`
	Mean       float64  `json:"mean"`
	Deviation  *float64 `json:"deviation,omitempty"`
	OutOfSpec  *int64   `json:"outOfSpec,omitempty"`
}

Statistics are what a tool's Monte Carlo analysis records of one observable over the runs of a snapshot: their count and mean, and when it recorded them, their standard deviation and the count of runs out of specification.

func (Statistics) Disagrees

func (s Statistics) Disagrees(o Statistics) bool

Disagrees reports whether s and o cannot summarise runs of one distribution: their means lie more than three standard errors of their difference apart. Without both deviations the standard error is unknown, so nothing disagrees.

func (Statistics) Equal

func (s Statistics) Equal(o Statistics) bool

Equal reports whether s and o record the same statistics, an unrecorded one equal only to an unrecorded one.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL