multiple_replications()
Run multiple replications of a Ciw simulation and collect performance metrics.
Usage
multiple_replications(
network, process_model, num_reps=50, runtime=1000.0, warmup=0.0, n_jobs=-1
)Executes independent replications of a discrete event simulation, collecting node performance measures including arrivals, waiting times, service times, utilisation, and queue lengths. Activity and resource names from the process model are included in the output.
Parameters
network: ciw.Network-
A configured Ciw network object defining the queueing system structure, service distributions, and routing.
process_model: ProcessModel-
Pydantic model containing activity and resource metadata. Used to map node IDs to human-readable activity and resource names.
num_reps: int = 50-
Number of independent replications to run. Each replication uses a the replication number as a random seed.
runtime: float = 1000.0-
Simulation time horizon for each replication. Units match the time units used in service and arrival distributions.
warmup: float = 0.0-
Warmup period to exclude from statistics. Records with arrival times before this value are filtered out to reduce initialization bias.
n_jobs: int = -1- Number of cores to use for parallel replications. Use -1 for all cores.
Returns
pd.DataFrame-
DataFrame with one row per node per replication containing:
- rep : int Replication number (0-indexed)
- node_id : int Ciw node identifier (1-indexed)
- activity_name : str Name of the activity from process model
- resource_name : str Name of the resource from process model
- resource_capacity : int Number of servers at this node
- arrivals : int Number of completed visits to this node
- mean_wait : float Mean waiting time (queueing time before service)
- mean_service : float Mean service time
- utilisation : float Time-averaged server utilisation (fraction busy)
- mean_Lq : float Time-averaged mean number of customers in queue