N@5FloorElevator_SJIHAD
I@F1 L1 F2 L2 F3 L3 F4 L4 F5 L5
O@LengthH Flor Door1 Door2 Door3 Door4 Door5
interval (20)  Length > LengthS -> LengthS += 0.02 * 100; LengthS > Length -> LengthS -= 0.02 * 100;
If F1 | L1 == 1 -> Length = 500; If LengthS == 500 -> Flor = 1;
If F2 | L2 == 1 -> Length = 400; If LengthS == 400 -> Flor = 2;
If F3 | L3 == 1 -> Length = 300; If LengthS == 300 -> Flor = 3;
If F4 | L4 == 1 -> Length = 200; If LengthS == 200 -> Flor = 4;
If F5 | L5 == 1 -> Length = 100; If LengthS == 100 -> Flor = 5;
If LengthS ==  500 & Length == 500 -> Door1 = 1;
If LengthS <  500 -> Door1 = 90;
If LengthS > 400 -> Door2 = 90;
If LengthS == 400 & Length == 400 -> Door2 = 1;
If LengthS < 400 -> Door2 = 90;
If LengthS > 300 -> Door3 = 90;
If LengthS == 300 & Length == 300 -> Door3 = 1;
If LengthS < 300 -> Door3 = 90;
If LengthS > 200 -> Door4 = 90;
If LengthS == 200 & Length == 200 -> Door4 = 1;
If LengthS < 200 -> Door4 = 90;
If LengthS == 100 & Length == 100 -> Door5 = 1;
If LengthS > 100 -> Door5 = 90;
LengthH = LengthS
