A reproducible discrete-event simulation of a virtual clinical service, modelling patient arrivals, nurse availability, urgency and four service types.
julia --project=. -e 'using Pkg; Pkg.instantiate()'
julia --project=. test/runtests.jlThe model API is defined in vcc.jl:
include("vcc.jl")
parameters = Parameters(100, 2.0, 0.2, 14.7, 3.2, 37.5, 10.6,
16.72, 3.2, 22.27, 5.0, 4)
state = run_simulation(parameters, 42)A fixed seed controls patient attributes, service selection, arrivals and service durations.
- Exactly
npatients arrive and are served;n = 0returns an empty completed state. - Timing means and standard deviations must be finite and strictly positive; invalid parameters fail with
ArgumentErrorbefore random distributions are built. - Every arrival schedules its successor independently of nurse availability.
- Waiting patients enter service once a nurse becomes free.
- Service times are positive and patient IDs are unique.
- Same-time events retain their true timestamp and use deterministic insertion order; simulation time is never adjusted to break a tie.
- Assigned service intervals do not overlap for an individual nurse.
vccrun.jl is an optional exploratory sweep and requires additional CSV, DataFrames and Makie packages. It is intentionally separate from the minimal tested core environment. Its 100 runs per cell use the deterministic, distinct seed series 1234:1333; they are reproducible replicates rather than repeated copies of the default trajectory.
The distributions, positive-time clamping, and urgency rules are illustrative modelling assumptions, not a validated clinical staffing model. The invariant tests establish program behavior only; they do not validate inputs, outcomes, staffing requirements, or operational decisions. Validate parameters and outcomes independently before any operational use.
MIT.