A simulation of synchronizing gears modeled with akka-actors and scala-swing
Clone and run with:
mvn
Or run the main class GearGUI from the IDE.
- Each Gear is an Akka Actor which is represented in the GearGUI by a slider
- The gears are supervised by the GearController Actor which coordinates and keeps the state
- The Receiver Actor coordinates updates from the GearController to the GearGUI
- green: Gear is synced (= has the same speed as the calculated sync speed)
- yellow: Gear in progress
- red: Gear has been sabotaged (= a new speed was forced)
- magenta: Gear had an exception and is restarted by the supervisor
- black: Gear had 2 exceptions within 2 seconds (double click to revive)
- GearGUI nOfGears (increase if you want to have more gears)
- Gear errorLevel (raise initial value here to have more exceptions or use Slider in GUI)
- Gear sleepTime (raise initial value here to slow down simulation or use Slider in GUI)
- Update pom.xml, note that scala-swing is now maintained by the community
- Remove obsolete stuff and minor refactorings
- Update pom.xml
- Adjust the params in Gear for faster completion
- Add deprecated note for Typesafe Console
- Set the ErrorLevel via Slider from GUI
- Run Application via sbt-atmos plug-in
- Usage of Typesafe Console (deprecated) via via sbt-atmos plug-in
./sbt
> atmos:run-main ch.clx.geargui.GearGUI
[info] Starting Atmos and Typesafe Console ...
[info] Typesafe Console is available at http://localhost:9900
- Change the gear actor behaviour with "akka become", so there is no need for a local var "speed" anymore
- Minor enhancements: Removed ActorRefs in Messages
- Added sbt and support for monitoring with Typesafe Console via sbt-atmos plug-in https://github.com/sbt/sbt-atmos
- Forked from dhob/scala_gear_simulation
- Changed akka implementation from 1.3 -> 2.0 -> 2.1 using the akka migration guides
- Fault Tolerance through Supervisor Strategies a(k)ka "Let it crash"
- Minor enhancements to the GUI
- YourKit for thread activity
- Typesafe Console via sbt-atmos plug-in