0

Hello guys I want to design a Finite state machine for lift controller and I have no idea what can be the states and the transitions between them. The lift has three levels and can move up and down, and can open and close its doors.

  • The lift has three levels and can move up and down, and can open and close its doors.
  • Inside the lift are three buttons that passengers can press to specify which floor they want to go to.
  • On each floor, outside the lift, is a button to call the lift to that floor which are up and down buttons. and the controller works with the sensors and the whole system is an active system. and these are below are the system's actions.
  • lift.moveUp() to make the lift start moving up.
  • lift.moveDown() to make the lift start moving down.
  • lift.stop() to make the lift stop moving.
  • lift.openDoor() to make the door start opening
  • lift.closeDoor() to make the door start closing.
  • lift.restartTimer(int duration) to set the time on the timer
  • lift.turnWarningLightOn() to turn the warning light on
  • lift.turnWarningLightOff() to turn the warning light off

    Heading ##and these are the sensors:

  • "request1", "request2", "request3" : The lift button or call button for floor 1 / 2 / 3 was pressed.

  • "atF1", "atF2", "atF3" : The lift is at floor 1 / 2 / 3
  • "startUp", "startDown" : The lift has just started to move up / down
  • "doorClosed", "doorOpened" : The door has just finished closing / opening
  • "doorMoving" : The door has just started opening or closing
  • "timerExpired" : The timer has just expired.
  • "doorSensor" : A person has just moved through the door (in or out)
  • "withinCapacity" : A person has got out and the lift has just become not overloaded.
  • "overCapacity" : A person has got in and the lift has just become overloaded.

1 Answers1

0

Try this. It uses AKKA FSM for Scala

Elevator implemented in FSM

faisal00813
  • 400
  • 5
  • 12