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
- func Count(n int64) *int64
- func DrawnMean(d *runtime.Distribution) semantics.Value
- func Real(v float64) *float64
- func RealOf(v semantics.Value) float64
- func RealValue(v float64) semantics.Value
- func Relative(stored, ran semantics.Value) string
- func SameName(name, qualified string) bool
- func Spell(v float64) string
- func StoredDeviation(cfg *ConfigurationResults, observable string) (float64, bool)
- func StoredDistribution(cfg *ConfigurationResults, observable string) (d *runtime.Distribution, pooled bool)
- type CaseStatistic
- type CaseStatistics
- type Comparison
- type ConfigurationResults
- func (c *ConfigurationResults) Disagreeing(observable string) []Snapshot
- func (c *ConfigurationResults) StoredRuns() int64
- func (c *ConfigurationResults) StoredRunsText() string
- func (c *ConfigurationResults) Summarised(observable string) []Snapshot
- func (c *ConfigurationResults) Values(observable string) []float64
- type Difference
- type ObservableComparison
- type ObservablePair
- type Refusal
- type Results
- type Snapshot
- type Statistics
Constants ¶
const ( StatisticRuns = "N" StatisticMean = "Mean" StatisticDeviation = "Deviation" StatisticOutOfSpec = "OutOfSpec" )
The statistics a tool's Monte Carlo analysis records, as it names them.
const OpenSysMLLabel = "OpenSysML ("
OpenSysMLLabel prefixes the runs' row of a comparison table, before the feature.
Variables ¶
This section is empty.
Functions ¶
func DrawnMean ¶ added in v0.11.0
func DrawnMean(d *runtime.Distribution) semantics.Value
DrawnMean is a distribution's mean as the Real the runs drew.
func Relative ¶ added in v0.11.0
Relative spells the relative difference of ran from stored as a signed percentage, or the absolute difference when stored is zero.
func SameName ¶ added in v0.11.0
SameName is whether name names the configuration qualified: as the qualified name itself, as its text unquoted, or as its last segment.
func StoredDeviation ¶ added in v0.11.0
func StoredDeviation(cfg *ConfigurationResults, observable string) (float64, bool)
StoredDeviation pools the deviation of the observable over the tool's values and summaries, false when a summary kept none or fewer than two runs define one.
func StoredDistribution ¶ added in v0.11.0
func StoredDistribution(cfg *ConfigurationResults, observable string) (d *runtime.Distribution, pooled bool)
StoredDistribution is the tool's distribution of the observable: over its stored values when it summarised none, else pooled from values and summaries, which fixes the count and the mean alone.
Types ¶
type CaseStatistic ¶ added in v0.11.0
type CaseStatistic struct {
Statistic, Of, Tool, Run, Difference string
}
CaseStatistic is one statistic of the case: what it is, where the case declares it, the tool's value, the runs' value and their relative difference.
type CaseStatistics ¶ added in v0.11.0
type CaseStatistics struct {
Analysis string
Rows []CaseStatistic
Notes []string
}
CaseStatistics compares the statistics a Simulation::MonteCarlo case declares of an observable with the tool's pooled values, one row per statistic.
type Comparison ¶ added in v0.11.0
type Comparison struct {
Observables []ObservableComparison
}
Comparison sets the tool's distribution of every compared observable of one configuration beside the distribution the runs came to, observable by observable.
func Compare ¶ added in v0.11.0
func Compare(cfg *ConfigurationResults, table sweep.SweepTable, observe []ObservablePair) Comparison
Compare sets the tool's results of each compared observable of cfg beside the runs of table, in the order ComparedObservables lists them. Numbers are read as they are; nothing is scaled or tuned.
func (Comparison) Lines ¶ added in v0.11.0
func (c Comparison) Lines() []string
Lines table the comparison as `sysml -compare-results` prints it: the tool's distribution of every observable beside the runs', with the relative difference of each statistic, then the notes on what was pooled or not compared.
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) StoredRunsText ¶ added in v0.11.0
func (c *ConfigurationResults) StoredRunsText() string
StoredRunsText spells how many runs the tool stored of the configuration, and over how many snapshots when one summarises several.
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 Difference ¶ added in v0.11.0
type Difference struct {
Min, Mean, P50, P90, Max string
}
Difference is the relative difference of each statistic, "" where it is not compared.
type ObservableComparison ¶ added in v0.11.0
type ObservableComparison struct {
Stored string
Feature string
// Unit is the unit the runs' numbers came in, "" for none.
Unit string
// Tool is the tool's distribution, nil when it stored no number; Pooled is
// whether it was pooled from summaries, so only Count and Mean are known.
Tool *runtime.Distribution
Pooled bool
// Unstored is whether the tool stored no result at all to compare against.
Unstored bool
// Run is the distribution of the completed runs, nil when they are not
// compared; Produced is how many runs produced a number for the feature.
Run *runtime.Distribution
Produced int
// Compared is whether the runs were made and are reported, false when the
// tool stored no observable of the name or no number for it.
Compared bool
// Difference is the relative difference of each statistic, nil without
// both distributions; a pooled tool distribution compares the mean alone.
Difference *Difference
// Declared is the per-statistic comparison of a Simulation::MonteCarlo case
// the configuration's observable is analysed by, nil when none is.
Declared *CaseStatistics
// Notes explain what was pooled, not compared, or compared with reservations.
Notes []string
}
ObservableComparison is one observable's comparison: the tool's distribution (pooled from summaries when it stored any), the runs' distribution when the completed runs all produced a number for the feature in one unit, and the relative difference of each statistic when both are there.
type ObservablePair ¶ added in v0.11.0
ObservablePair is a stored observable and the feature of the run that answers it; an empty Feature is the target's feature of the observable's own name.
func ComparedObservables ¶ added in v0.11.0
func ComparedObservables(cfg *ConfigurationResults, table sweep.SweepTable, observe []ObservablePair) []ObservablePair
ComparedObservables are the pairs asked for, or every stored observable when none was — the observable the configuration's analysis summarises, else every feature the completed runs produced a number for, when the tool stored none; one naming no feature is read from the feature of its own name that the target object holds — `target.Time_Total` — or the bare name when the configuration runs on no target.
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 ¶
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 ¶
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.
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.
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.