Skip to main content

Crate qrunap2

Crate qrunap2 

Source
Expand description

A documented subset of QNAP2 for queueing network simulation.

Parse and run a model with an explicit random seed:

let source = r#"
/DECLARE/
QUEUE INPUT, DESK;
/STATION/
NAME=INPUT;
TYPE=SOURCE;
SERVICE=EXP(2);
TRANSIT=DESK;
/STATION/
NAME=DESK;
TYPE=SERVER,SINGLE;
SERVICE=EXP(1);
TRANSIT=OUT;
/CONTROL/
TMAX=10000;
/EXEC/
BEGIN
SIMUL;
END;
/END/
"#;
let report = qrunap2::run(source, 42)?;
assert_eq!(report.seed, 42);
assert_eq!(report.stations.len(), 2);

This crate implements a limited language subset, not full QNAP2 compatibility. See the compatibility guide for supported constructs and limitations.

Structs§

Model
A validated network description and finite simulation horizon.
Report
Simulation totals, per-station statistics and sampled population trace.
Station
A source or service station and its routing destination.
StationReport
Statistics for a source or service station over the simulation horizon.
Trace
A sample of the network population at a simulation time.

Enums§

Distribution
A constant duration or an exponential duration parameterized by its mean.

Functions§

parse
Parse and validate the supported QNAP2 subset.
run
Parse a QNAP2-subset model and simulate it using the supplied random seed.
simulate
Simulate a model with a reproducible seed, validating it before execution.