Home/chiaha-SLX/GPSS models

GPSS/H style models, run in a browser

Each GPSS block becomes a line or two of chiaha-SLX. The workspace includes four GPSS textbook problems rewritten this way: one server, two barbers sharing a line, a machine that breaks down, and customers who give up waiting.

Two barbers, one line

In GPSS this is the TRANSFER BOTH problem. Customers arrive every 12 to 24 minutes and wait in one line for whichever of two barbers is free, with barber 1 preferred. A haircut takes 12 to 20 minutes, and the shop runs for 480 minutes.

Each barber is a control boolean. One wait until waits for either barber, which is what TRANSFER BOTH does with two SEIZE blocks. The if then takes barber 1 when he’s free and barber 2 otherwise.

The waiting-time statistics that QUEUE and DEPART would collect are two lines of plain arithmetic, so you can see exactly how each number is computed.

class Customer
{
  int which;
  actions
  {
    double arrived_at = time;
    wait until (!b1 || !b2);
    if (!b1) { b1 = TRUE; which = 1; }
    else     { b2 = TRUE; which = 2; }
    double w = time - arrived_at;
    total_wait += w;
    advance rv_uniform(2, 12.0, 20.0);
    if (which == 1) b1 = FALSE;
    else b2 = FALSE;
    served++;
    terminate;
  }
}
The customer, shortened from gpss/multi-barber in the workspace. The full model also tracks the longest wait and each barber’s busy time.

GPSS blocks and what they become

A blocking GPSS block becomes a wait until on a condition. The rest are ordinary statements.

GPSS/HIn chiaha-SLX
GENERATEA generator object that loops: advance the interarrival time, then activate new Customer()
SEIZE / RELEASEwait until (!busy); busy = TRUE; … busy = FALSE;
ENTER / LEAVEA control int count: wait until (free > 0); free--; … free++;
ADVANCEadvance, with any of the rv_* distributions
QUEUE / DEPARTRecord the arrival time and add time - arrived_at to a total
TESTwait until (condition); or if
TRANSFER BOTHOne wait until on either resource, then if to take the free one
Renegingwait until (!busy or time >= arrived_at + patience); then leave if still busy
PREEMPT / RETURNA breakdown object sets machine_down; the job in service waits out the repair and finishes its remaining work
TERMINATEterminate;

Every row comes from one of the workspace models: gpss/mm1, gpss/multi-barber, gpss/machine-breakdowns, gpss/reneging, and the bank tellers for ENTER and LEAVE.

Moving an old GPSS deck

Card decks in the old column format don’t load directly. Rewriting one follows the deck block by block, using the table above, so the model keeps its shape. If you’d rather not do it yourself, our team can move it and check that it reproduces your old results.

GPSS World and other GPSS versions have their own dialects. Send us a model from any of them and we’ll tell you what it takes.

Once a model is in chiaha-SLX it can use the rest of the language too: objects with their own attributes, sets, pointers and wait until on any condition. The SLX page lists what the language runs today, and the example models walk through complete models with their code. Free plan limits and how we handle your model are on the chiaha-SLX page.

SLX, GPSS/H and GPSS World are trademarks of their respective owners. ChiAha is not affiliated with or endorsed by them.