RunwayStateMachine

Kevin Brightwell edited this page Aug 26, 2015 · 1 revision
Clone this wiki locally

The Model

class Runway {

  runwayStateMachine {

    Open {
      alarm -> Emergency;

      Free {
        entry / {turnOnGreenLight();}
        exit / {turnOffGreenLight();}
        planeLanding -> Occupied;
        repair -> Restoration;
      }

      Occupied {
        planeTakesOff -> Free;
      }
    }

    Closed {
      entry / {closeRunway();}

      Emergency {
        clear -> Open;
      }

      Ready {
        open -> Open;
      }

      conc Restoration {
        Restoration_1 {
          Repair {
            repairCompleted -> Inspecttion;
          }
          Inspection { 
            check [success] -> Ready;
            check [!success] -> Repair; 
          }
        }  
        Restoration_2 {
          Maintenance {
            do { performMaintananceWork();}
          }
} } } } }