Simoji is a language and tool for thinkers to write shareable simulations using ๐'s. You write your simulations in a simple language using mostly Emojis and then click play. Simoji is public domain, open source, and suggestions welcome!
comment Define an ant agent
๐
comment Ants turn then move one space per tick
onTick
turnRandomly
move
comment Ants pick up food.
onHit
๐ฅ
pickItUp
comment Define an ant hill
โฐ
comment On each tick, with 5% odds
onTick 0.05
comment Spawn an ant
spawn ๐
๐ฅ
comment Set up the board.
insert 3 ๐ฅ
insert 1 โฐ
The Board is the rectangle on which your simulation takes place. It has a width and height and is divided into a grid.
Agents are the key concept in Simoji. Everything you see on your board is an agent. In the code above, the ant, hill, and food are all agent types.
Events are blocks of commands that execute during the running of the experiments. Probabilities can be assigned so blocks run stochastically.
Some events can also happen on the board level:
Agents can have attributes. You can define your own. Some are built in like:
Some attributes are booleans with only 2 states like:
You can run multiple boards at the same time using the experiment
keyword. You can tweak any words in your experiments. Usually you want to change Settings. The maximum boards at one time is currently 4.
You can define parameters that you use throughout your simulation code. This makes it easy to tweak them in experiments. For example:
lightningFrequencySetting .1
experiment
comment Lots of lightning
lightningFrequencySetting .5
Data is collected during the running of every experiment. You can export this data to CSV and/or start analyizing it immediately in the Ohayo app.
You can setup your board with the following commands.
You can drop new Agents onto your board using the Agent Palette on the right side of your screen.
Simoji the language is a Tree Language. There are no visible syntax characters. Indentation is used for parent/child relationships. Here is the grammar.
Combo | Command |
---|---|
Spacebar | Play/Pause |
? | Toggle Help |
t | Advance one tick |
r | Reset Experiments |
s | Snapshot Current Starting Params |
o | Open Reports |
c | Export CSV data |
d | Toggle Debugger |
Arrows | Move selection |
Backspace | Delete selection |
At the top of the page you should see a link that you can copy and paste to share your sim. When you update your simulation code that link will update.
You can load any simulation from a publicly accessible URL by prefixing it with: https://simoji.treenotation.org/#url
. For example: https://simoji.treenotation.org/#url%20https://simoji.treenotation.org/examples/eatTheBacon.simoji
The source code for Simoji and all development happens on Github.