ReenterMap.emam 709 Bytes
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
package de.rwth.pacman.heithoff2.BFS.single;

component ReenterMap {
    ports
      in Q(0m: 20m) currentX,
      in Q(1m: 23m) currentY,
      in Q(0m: 20m) oldX,
      in Q(1m: 23m) oldY,
      
      out Q(0m: 20m) newCurrentX,
      out Q(1m: 23m) newCurrentY,
      out Q(0m: 20m) newOldX,
      out Q(1m: 23m) newOldY;
    
    implementation Math {
        newCurrentX = currentX;
        newCurrentY = currentY;
        newOldX     = oldX;
        newOldY     = oldY;
        if currentX < 2
            newCurrentX = 18;
            newOldX = 19;
        elseif currentX > 18
            newCurrentX = 2;
            newOldX = 1;
        end
    }
Bernhard Rumpe's avatar
BR-sy    
Bernhard Rumpe committed
29
}