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.
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;
}
}
}
wait until statements. The full model also collects each class’s waiting time.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 feature | In chiaha-SLX |
|---|---|
Pucks, advance, fork, wait until, control variables, time in conditions | Runs |
| Pointers, use counts, sets (ranked, FIFO, LIFO) | Runs |
wait / reactivate, wait lists, interrupt / resume, priorities, yield | Runs |
for, do … while, switch, labels and goto | Runs |
| Arrays, enums, strings, parameter modes | Runs |
Classes with parameters; initial, final, clear, destroy; static | Runs |
| Statement definitions and macros | Runs |
rn_stream, rn_seed and the rv_* distributions | Runs, on our random-number streams or SLX’s own |
print with pictures, report, entity_class | Runs |
File I/O: filedef, open, read, write | Runs, inside the run’s own temporary folder |
Methods, and objects with { } initial values | Not 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.
Most SLX models are one or a few text files, so the first try takes a few minutes.
run --rng lehmer.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.