Aufgrund einer Wartung wird GitLab am 25.01 zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 25.01 between 8:00 and 9:00 am.

ControlFlow.emam 1.18 KB
Newer Older
Bernhard Rumpe's avatar
BR-sy    
Bernhard Rumpe committed
1
/* (c) https://github.com/MontiCore/monticore */
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package de.rwth.pacman.heithoff2.BFS.single;

component ControlFlow {
    ports
      in Q(0m: 20m) currentX,
      in Q(1m: 23m) currentY,
      in B searchFinished,
      in B safeFromSearchFinished,
      in B safeFoundFromSearchFinished,
      in Z oldDirection,
      in B positionIsSafe,
      in B safeFoundFromNewPosition,
      in Q(0m: 20m) newXFromNewPosition,
      in Q(1m: 23m) newYFromNewPosition,
      in Z newDirectionFromNewPosition,
      
      out Q(0m: 20m) newX,
      out Q(1m: 23m) newY,
      out B safeFound,
      out B safe,
      out Z newDirection;
    
    implementation Math {
        newDirection = oldDirection;
        newX = currentX;
        newY = currentY;
        
        if searchFinished == 1
            safe = safeFromSearchFinished;
            safeFound = safeFoundFromSearchFinished;
        elseif positionIsSafe == 0
            safe = 0;
            safeFound = 0;
        else
            safe = 1;
            safeFound = safeFoundFromNewPosition;
            newX = newXFromNewPosition;
            newY = newYFromNewPosition;
            newDirection = newDirectionFromNewPosition;
        end
    }
Bernhard Rumpe's avatar
BR-sy    
Bernhard Rumpe committed
43
}