Skip to content

Minimal SDL (Specification and Description Language) implementation in Snap!

Notifications You must be signed in to change notification settings

Kiniotico/sdl4snap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

184 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDL4Snap !

SDL4Snap ! is a Snap ! library with a minimal implementation of the modeling Specification and Description Language (SDL) in Snap ! and Snap4Arduino.

Yoy can find an introduction to SDL here, a tutorial (vintage) here, and an introduction to modeling with SDL here.

Try it at: Hello World!

(JavaScript extensions must be ticked)

The PingPong example can be considered the "Hello World" of a SDL based multi-agent system. An online runnable example can be found here.

PingPong SDL model

PingPong SDL model

To import the PingPong SDL model into UMLetino, copy the following URL to the clipboard, and then paste it when "File Import":

https://raw.githubusercontent.com/pixavier/sdl4snap/master/examples/PingPong_SDL.uxf

If you only want to import the SDL palette into UMLetino, copy the following URL to the clipboard, and then paste it when "File Import":

https://raw.githubusercontent.com/pixavier/sdl4snap/master/palette/SDL_palette.uxf

Usage and blocks

Start from the HelloWorld example, and delete the blocks you will not use. Each agent (sprite) has some atributes (local variables) that are needed by the SDL engine, such as "SDL signal input queue" and "SDL state".

To create new processes, duplicate a similar one instead creating it from scratch.

Here you can see the Snap ! translation of the PingPong example:

Ping Pong Snap ! implementation

Using PubSub architecture to support distributed messaging

The scheme of processes communication is described in the classic SDL Forum SDL-88 Tutorial SDL Tutorial, as it is shown in the following picture:

Process communication

SDL4Snap ! can use MQTT to support distributed messaging over a network. The MQTT4Snap ! extension lets send/receive messages via the MQTT protocol, hence agents (blocks and processes) can run distributed among Snap ! Internet-connected browsers. MQTT4Snap ! "pub" and "sub" blocks, combined to the "send signal" block, as depicted in the following image:

Distributed SDL

MQTT based systems can be combined with other protocols like HTTP-REST or OPC-UA with another no/low-code tools like Node-RED.

SDL4Snap ! was presented in the Snap!con 2021 Conference.

SDL4Snap ! was presented in the SAM 2021 (MODELS 2021) Conference, with the paper "Combining Low-Code Programming and SDL-Based Modeling with Snap! in the Industry 4.0 Context".

About

Minimal SDL (Specification and Description Language) implementation in Snap!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%