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 ¶
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 ¶
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 ¶
Read reads a sidecar -migration-results wrote: exactly one JSON document indexing at least one configuration; content after it is an error.
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.