primopy

Courses

Short courses to work through in primopy. A course opens in the editor as one project, its lessons the chapters of one document, with examples to run, programs to record and step through, exercises that check themselves, and a quiz with Primo after each lesson.

Average wait rises slowly up to about 60 percent utilization, then steeply, and the simulated points follow the formula

Discrete-event simulation in plain Python

Five lessons, each with exercises and a quiz

A kiosk has one barista. Will there be a line, how long is the wait, and does a second barista help more with one shared line or with two? Build small simulations with only what comes with Python, check each against a known formula, and see that a simulation is a short program with a clock, a list and a loop.

For Students who are comfortable with variables, if, loops, lists, dictionaries and functions, as taught in a first programming course. No probability or queueing theory needed.

▶Start in primopy
The 5 lessons
  1. StartDiscrete-event simulation in plain Python
  2. 1One server, customer by customer

    M/M/1, random times with random.expovariate, a queue simulated by one short loop with no clock, and why a line gets long even when the barista can keep up.

  3. 2One server with an event list

    A clock, a state and a list of future events: the same queue, the time-weighted length of the line, Little's law, and customers who walk away from a long line.

  4. 3Several servers, customer by customer

    M/M/c with one free time per server, Erlang C to test against, and why one shared line beats separate lines.

  5. 4Several servers with an event list

    The event loop with several servers, utilization from busy time, and a new behavior as a new kind of event.

  6. 5From Python to Quisim

    Replications, confidence intervals and warm-up, what a real study still needs, and how your code maps to Quisim's blocks.

Teaching a course in primopy, or writing one? Write to us, and it can be on this page.