Scheduling & Priority Queues Examples

Scheduling and priority queue models explore how tasks compete for limited service. They show how priority levels, interrupts, and workflow rules determine wait times and throughput.

Examples include hospital triage, repair lines, and online matchmaking queues. Adjust priority policies or arrival rates to observe bottlenecks and starvation.

Select an example to explore it in the playground.

Beginner - Introductory Models

Nested Hierarchy Workflow

A nested hierarchy simulation where tasks flow across company departments.

Level:Beginner

workflowcapacityresource-managementthroughputbottleneck

  • Flows:arrivals, service
  • Probes:Dept0, Dept1, Dept0-Team0, Dept0-Team1, Dept1-Team0, Dept1-Team1

Queue Simulation

A queue simulation demonstrating throughput limits and system capacity.

Level:Beginner

queuethroughputbottleneckdiscrete-eventservicecapacity

  • Stocks:backlog[p]
  • Flows:produced, consumed
  • Probes:backlog_total, incoming_per_sec, outgoing_per_sec
Intermediate - Classic Dynamics

Bank Renege Simulation

A bank renege simulation where customers join a queue with limited patience and may leave before service if the wait is too long.

Level:Intermediate

queueservicediscrete-eventtime-delay

  • Stocks:queue
  • Flows:served, reneged
  • Probes:wait_time, served, reneged

Car Service Simulation - SimPy Tutorial

A car service simulation showing priority washing with features like interrupts.

Level:Intermediate

simpypriorityservicemaintenancequeueinterruptsdiscrete-eventreliabilityworkflow

  • Stocks:fuel_level, parts
  • Probes:fuel_level, wash_q, parts

Hospital ER Patient Flow

Queuing theory demo of patient flow through an emergency department.

Level:Intermediate

queuehealthcareresource-managementprioritization

  • Stocks:beds
  • Flows:arrivals, departures
  • Feedback Loops:staffing effects
  • Probes:wait_low, wait_med, wait_high, bed_util, lwbs, served

Matchmaking Queue

Simulates skill-based matchmaking with adjustable buckets, skill delta and max wait.

Level:Intermediate

matchmakingqueuegamefairness

  • Probes:queue_len, avg_wait, avg_delta
Advanced - Complex Simulations

Machines Simulation

A machines simulation depicting resource allocation and reliability.

Level:Advanced

reliabilityresource-managementmaintenancequeuethroughput

  • Stocks:buffer, idle-token store
  • Flows:in_rate, dispatch_rate
  • Probes:in_rate, dispatch_rate, buffer_level, breakdown, repair