Skip to content

An experiment with Akka FSM, to capture time-dependent events using multiple Elevators

License

Unknown, CC0-1.0 licenses found

Licenses found

Unknown
LICENSE
CC0-1.0
COPYING
Notifications You must be signed in to change notification settings

nsengupta/ElevatorFSM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Well, the Internet is full of articles/blogs/code that explain/demonstrate how to model an elevator's functions as a Finite State Machine (FSM). What the heck! I thought of adding one more. :-)

But, my intention is not to repeat the old story. I want to try and model the following, using one elevator as an unit:

  • Behaviour of a single elevator (or a lift, as is referred to in my part of the world)
  • Controlling its behaviour from a, well, Controller
  • Modeling a collection of lifts, as is seen in hotels
  • Coordination between these lifts and the controller
  • Accounting for h/w devices in the lifts, which send asynchronous signals (messages) to the lifts they are attached to

I don't expect to complete this at one go. Instead, I will build it phase-wise.

The blog is here.

A few hints about various components (may help follow the implementation)

  • org.nirmalya.carriages.types.withExplicitMovingState.LiftCarriageWithMovingState

It models the carriage itself; constructed with a TimeConsumingHWSignalSimulator

  • org.nirmalya.entities.TimeConsumingHWSignalSimulator

It implements the MovingStateSimulator trait. Specifically, it implements the simulation of spending time while moving to a particular floor (function: simulateMovementTo()).

  • org.nirmalya.entities.InlaidButtonPanel

It models a button panel mounted inside a carriage. It is identified by an ID as well as the carriage it is mounted inside. The carriage is an actor; hence, it is constructed with an ActorRef.

  • org.nirmalya.entities.LiftController

The Controller in the system. It is constructed with a collection of carriages.

About

An experiment with Akka FSM, to capture time-dependent events using multiple Elevators

Resources

License

Unknown, CC0-1.0 licenses found

Licenses found

Unknown
LICENSE
CC0-1.0
COPYING

Stars

Watchers

Forks

Packages

No packages published

Languages