Analysis, random and diagrams
cimba.analysis
- cimba.analysis.summary(samples, *, confidence=0.95)
Per design point statistics of a
(points, replications)array (orSamples), ignoring non-finite values. Returns aSummary.
- class cimba.analysis.Summary
Arrays with one entry per design point:
n,mean,std(sample,ddof=1),lowerandupper(Student-t confidence interval for the mean).
- cimba.analysis.compare(samples, *, a, b, confidence=0.95)
Paired comparison of design points
aandb: the mean ofsamples[b] - samples[a]over replications where both are finite, with a Student-t interval. Returns aComparison.
- class cimba.analysis.Comparison
a,b,n(pairs used),difference,lower,upper.nanif fewer than two pairs.
- cimba.analysis.check_input(source, *, reference, n=4096, seed=0, lags=10)
Generate
nvalues fromsource(a distribution, trace or row source) and compare them with the 1-Dreference. Returns anInputCheck. For abootstrap.jointsource,referenceis a mapping with the same keys or a 2-D array with one column per member, and the result is aJointInputCheck.
- class cimba.analysis.InputCheck
reference_mean,generated_mean,reference_variance,generated_variance,reference_quantilesandgenerated_quantiles(5, 25, 50, 75 and 95%),reference_acf/generated_acfandreference_pacf/generated_pacf(from lag 0),ks_statisticandks_pvalue(two-sample Kolmogorov–Smirnov).
- class cimba.analysis.JointInputCheck
keys,members(oneInputCheckper member),reference_correlationandgenerated_correlationmatrices.
cimba.random
Distribution draws for model-internal randomness in compiled code (routing,
tie-breaking). They use the trial’s default stream. For real-world
variability, prefer an input with an inputs.dist source. Calling these
on the host raises RuntimeError.
Function |
Returns |
|---|---|
|
float |
|
float |
|
float |
|
float |
|
float |
|
bool |
|
int |
categorical(probabilities) returns an index into probabilities.
cimba.diagrams
Draw configured models. Nothing is compiled or run, and input sources need not be bound yet. See Draw your model.
- cimba.diagrams.structure(model)
The object tree: one
"instance"node per static model instance (labelledpath: Class), solid edges to children and list items, dotted edges for references. Returns aGraph.
- cimba.diagrams.process_graph(model, *, fields=False, hooks=False)
Interactions inferred from the source of every process and event, resolved against the configured objects. Nodes: processes, entities, inputs (with their source), events, and
new Xnodes for spawned model classes, grouped by model instance and by spawned class. Edges are labelled with the operation (put,get,acquire,release,preempt,enqueue,cancel,wait,signal,record,next,now,at,spawn,schedule, andwritewithfields=True) and point the way things flow.hooks=Trueaddson_start/on_endhooks as actors. Returns aGraph.
- cimba.diagrams.mermaid(model)
Shortcut for
structure(model).to_mermaid().
- class cimba.diagrams.Graph
-
- node(key)
The node with that key.
- to_mermaid(direction='TD')
Mermaid
flowcharttext (TD,LR, …); groups become subgraphs.
- to_dot(rankdir='TB')
Graphviz DOT text; groups become clusters (dashed for spawned classes).
- topological_order()
Node keys in flow order;
ValueErrorif the graph has a cycle.
- class cimba.diagrams.Node
key(a canonical path such asharbor.facilities.tugsorShip.voyage),label,kind(instance,process,hook,event,entity,input,fieldormodel) andgroup.
- class cimba.diagrams.Edge
source,target,labelandstyle("solid"or"dotted").
- class cimba.diagrams.Group
key,labelandkind("model"or"spawned").