Home/chiaha-SLX/SLX models

Run SLX models in your browser

If you’ve written models in SLX, you can write them in chiaha-SLX. Pucks, control variables, wait until, sets and statement definitions work the way the SLX books describe them, and models run in a browser workspace with nothing to install.

What carries over from SLX

The language is C-like, with a simulation core on top. Each active object runs its own actions as a puck. A puck holds time with advance and waits on a condition with wait until. A condition can read any number of control variables, and the puck wakes when one of them changes so the condition holds.

Sets and pointers work as well. The example on this page keeps its queue in a set ranked by priority. The server takes the first customer in the set, so higher priorities go first and ties are served first come, first served.

Statement definitions let a library add new statements to the language. If your models are in GPSS/H instead, the GPSS page shows how each block maps.

class Customer
{
  int             priority;
  double          arrived;
  control boolean done;
  actions
  {
    arrived = time;
    place ME into line;
    wait until (done);
    terminate;
  }
}

set(Customer)
  ranked(descending priority) line;

class Server
{
  actions
  {
    pointer(Customer) c;
    forever
    {
      wait until (line.size > 0);
      c = first Customer in line;
      remove c from line;
      advance rv_expo(3, 10.0);
      c->done = TRUE;
    }
  }
}
From the priority queue example: a ranked set, a pointer, and two wait until statements. The full model also collects each class’s waiting time.

What runs today

This is the language feature by feature. If your model uses something on the last row, send it to us and we’ll tell you what it would take.

SLX featureIn chiaha-SLX
Pucks, advance, fork, wait until, control variables, time in conditionsRuns
Pointers, use counts, sets (ranked, FIFO, LIFO)Runs
wait / reactivate, wait lists, interrupt / resume, priorities, yieldRuns
for, do … while, switch, labels and gotoRuns
Arrays, enums, strings, parameter modesRuns
Classes with parameters; initial, final, clear, destroy; staticRuns
Statement definitions and macrosRuns
rn_stream, rn_seed and the rv_* distributionsRuns, on our random-number streams or SLX’s own
print with pictures, report, entity_classRuns
File I/O: filedef, open, read, writeRuns, inside the run’s own temporary folder
Methods, and objects with { } initial valuesNot yet

Names and types are checked before anything runs, so a typo is reported at its line in your model instead of halfway through a run.

Bringing a model over

Most SLX models are one or a few text files, so the first try takes a few minutes.

  1. Get early access. It’s a short form, and you can sign in as soon as you send it.
  2. Paste the model into the editor and press Run. The output pane shows what the model prints. Use the final-values option to see every global at the end of the run.
  3. Fix what the checker flags. Each message links to the line it’s about.
  4. Compare with your old results. Run replications with different seeds, or switch to SLX’s own random-number generator from the terminal with run --rng lehmer.
  5. Send us what doesn’t run at info@chiaha.com. We’ll tell you what needs changing, or move the model for you.

Each run happens in a temporary folder that’s deleted when the run ends; the chiaha-SLX page has the details and the free plan’s limits. To see more complete models first, read the example models with their code.

chiaha-SLX can also put item flow and rate flow in the same model. Discrete rate simulation was created by Andrew Siprelle of our team in 1990.

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