// Place global declarations here. const int STOCKWERKE := 4; chan knopf[STOCKWERKE]; chan tuer[STOCKWERKE]; chan rauf; chan runter; chan bereit; // Nachbildung einer Queue int[0,STOCKWERKE] anforderung[STOCKWERKE]; int[-1,STOCKWERKE] naechster := -1; int[-1,STOCKWERKE] zuletzt := 0;
Stock
chan &druecken, chan &oeffnen
// Place local declarations here. clock warten; clock verzoegerung;
Einsteigen
Warten
Idle
Knopfverwaltung
Steuerung
int[0,STOCKWERKE] position:=0; int[0,STOCKWERKE] ziel; int[0,STOCKWERKE] tmp;
Fahrstuhl
clock fahrzeit;
Stock0 := Stock(knopf[0], tuer[0]); Stock1 := Stock(knopf[1], tuer[1]); Stock2 := Stock(knopf[2], tuer[2]); Stock3 := Stock(knopf[3], tuer[3]); system Stock0, Stock1, Stock2, Stock3, Fahrstuhl, Knopfverwaltung, Steuerung;