Promise-based traffic simulation.
Also check softviz-philosophers (similar idea, different problem, in Java)
To learn more or to try it, visit https://djalil.me/softviz-semaphores/
Still refactoring/updating an old trashy side project of mine. See the GitHub issues and the TODO file.
This web app is supposed be useful (as in [2]) to students, so they can actually test their algorithms and see how they work in a dynamic system, and not just a viz like I did with DAC Exo3.
Why? Why not. Also, because the idea of simulating a dynamic system sounded cool (my professor mentioned it).
It makes use of:
- JavaScript's
with
feature which is deprecated and highly discouraged - AsyncFunction
- Promise
- SillySemaphore: My stupid Promise-based and queue-based semaphore
- Animated mainly using CSS
transition
andtransform: translate(..) rotate(..)
Why not use ES modules?
Do not work on the file://
protocol and I want this thing to work offline. Like, download as zip and open and run, just like that.
Developed and tested with Brave Browser v1.1 (Chromium v79.0).
Tested with Mozilla Firefox v76.0.
These are some of the cool documents and topics I checked while making this...
-
[1]: Steve Carr and Jean Mayo and Ching-kuang Shene, ThreadMentor: A Pedagogical Tool for Multithreaded Programming (tutorial)
-
[2]: B. P. Miller, What to Draw? When to Draw? An Essay on Parallel Program Visualization
-
Wikipedia, Queueing theory
-
Wikipedia, Taxicab geometry
-
Wikipedia, Computer simulation
-
Wikipedia, Web-based simulation
-
Wikipedia, Discrete-event simulation
-
SIM.JS: on Wikipedia, its website
-
Wanis Kabbaj: What a driverless world could look like | TED Talk
Abdeldjalil Hebal, CC BY 3.0