Skip to content

Full Example: A Single-Server Queue ​

Use this queue to run your first simulation, read four performance metrics, and plot how the number of servers affects the waiting line.

Single-server queue open in the Jupiter editor, with the Petri net, its parameters, and all four metrics visible

Arrival adds a customer to Queue every 10 minutes on average (ARRIVAL_TIME). Start immediately moves a waiting customer into InService if a server token is available in Server. Finish completes service after 5 minutes on average (SERVICE_TIME) and returns the token to Server. The queue starts empty with SERVERS set to 1. Both arrival and service delays are exponential.

Metrics in this model ​

#Place reads the number of tokens in a place, and E{...} takes its expected value. In a stationary simulation, that gives an estimate of the long-run average. Keep the identifiers as written because the expressions refer to names in the model.

  • avg_queue uses E{#Queue} to count the average number of customers waiting for service. Expect about 0.5 customers.
  • utilization_pct uses (E{#InService} / SERVERS) * 100 to compute the average percentage of busy servers. With one server, expect it to be busy about 50% of the time.
  • throughput uses E{#InService} / SERVICE_TIME to estimate service completions per minute. Each busy server completes service at the reciprocal of its mean service time. Expect about 0.1 customers/min.
  • in_system uses E{#Queue} + E{#InService} to count the average number of customers waiting or in service. Expect about 1 customer.

1. Import the model and find the metrics ​

  1. Save the example model as queue.json.
  2. Open a project in Jupiter, preferably a new one for this exercise. In the editor, choose File → Import (Local) and select queue.json.
  3. Find Metrics in the right panel to inspect the four expressions already in the model. To define a metric in your own project, click Add metric, enter a name and expression, then click Add. See Creating Metrics for more examples.

2. Run the stationary simulation ​

  1. Click Unique Simulation. In Execution Configuration, use Stationary Simulation and set Simulation Time to 500000 minutes of model time.
  2. Under Advanced Options, enter 42 in the seed field to reproduce the run. Leave the other options at their defaults and click Unique Simulation in the dialog.
  3. When the run finishes, click Multi Simulation. On Results, compare the Metrics table with the approximate values above. Small differences are expected from simulation.

3. Plot the effect of adding servers ​

  1. In Multi Simulation, open Scenarios.
  2. Under X-Axis, select SERVICE_TIME. Set Start to 2, End to 8, and Steps to 4. Leave Treat as rate unchecked so the axis represents minutes of service time.
  3. Under Y-Axis, select avg_queue to plot the average number of customers waiting.
  4. Under Lines, click Add 2nd parameter, select SERVERS, and enter 1 and 2 in the two fields that appear. Click Add line to create a third field and enter 3. Each value creates a curve for that number of servers.
  5. Confirm the form shows 12 combinations, then click Run Scenarios. Scroll to Parameter Surface to see the chart.

Scenario form with service times of 2 to 8 minutes, the avg_queue metric, and lines for one, two, and three servers

Scenario chart comparing the average waiting queue across four service times for one, two, and three servers

Compare the curves at the same service time to see how much each extra server reduces the waiting line. Read one curve from left to right to see what happens as service gets slower. Use the chart's Metric selector to explore the other three metrics for the same 12 scenarios.