|
17 | 17 | <- ?obtainObserver(OperatingBlockObserverId);
|
18 | 18 | focus(OperatingBlockObserverId).
|
19 | 19 |
|
| 20 | +// Get the luminosity updates |
| 21 | +@luminosity [atomic] |
| 22 | ++luminosity(RoomId, RoomType, Value) |
| 23 | + <- ! adjustLuminosity(RoomId, RoomType, Value). |
| 24 | + |
| 25 | +// Check if there is a specific value of luminosity for that room id and then achieve the optimal luminosity |
| 26 | +// Pre/Post Operating Room |
| 27 | ++!adjustLuminosity(RoomId, RoomType, CurrentValue): specificIlluminanceTarget(RoomId, OptimalAmbientLight) |
| 28 | + <- !achieveOptimalIlluminance(RoomId, CurrentValue, OptimalAmbientLight). |
20 | 29 | // Operating Room
|
21 |
| -+luminosity(RoomId, RoomType, Value) |
22 |
| - : optimalIlluminance(RoomType, OptimalAmbientLight, OptimalSurgicalLight) & |
23 |
| - Value \== OptimalAmbientLight |
24 |
| - <- .println(adjust_luminosity_operating_room); |
25 |
| - !setAmbientLight(RoomId, OptimalAmbientLight); |
26 |
| - !setSurgicalLight(RoomId, OptimalSurgicalLight). |
| 30 | ++!adjustLuminosity(RoomId, RoomType, CurrentValue): specificIlluminanceTarget(RoomId, OptimalAmbientLight, OptimalSurgicalLight) |
| 31 | + <- !achieveOptimalIlluminance(RoomId, CurrentValue, OptimalAmbientLight, OptimalSurgicalLight). |
27 | 32 |
|
| 33 | +// If there isn't any specific value for the room id then achieve the optimal luminosity based on the room type |
28 | 34 | // Pre/Post Operating Room
|
29 |
| -+luminosity(RoomId, RoomType, Value) |
30 |
| - : optimalIlluminance(RoomType, OptimalAmbientLight) & |
31 |
| - Value \== OptimalAmbientLight |
| 35 | ++!adjustLuminosity(RoomId, RoomType, CurrentValue) |
| 36 | + : not specificIlluminanceTarget(RoomId, X) & |
| 37 | + optimalIlluminance(RoomType, OptimalAmbientLight) |
| 38 | + <- !achieveOptimalIlluminance(RoomId, CurrentValue, OptimalAmbientLight). |
| 39 | +// Operating Room |
| 40 | ++!adjustLuminosity(RoomId, RoomType, CurrentValue) |
| 41 | + : not specificIlluminanceTarget(RoomId, X, Y) & |
| 42 | + optimalIlluminance(RoomType, OptimalAmbientLight, OptimalSurgicalLight) |
| 43 | + <- !achieveOptimalIlluminance(RoomId, CurrentValue, OptimalAmbientLight, OptimalSurgicalLight). |
| 44 | + |
| 45 | +// Goals to achieve optimal illuminance |
| 46 | +// Pre/Post Operating Room |
| 47 | ++!achieveOptimalIlluminance(RoomId, CurrentValue, OptimalAmbientLight) : CurrentValue \== OptimalAmbientLight |
32 | 48 | <- .println(adjust_luminosity_pre_post_operating_room);
|
33 | 49 | !setAmbientLight(RoomId, OptimalAmbientLight).
|
| 50 | ++!achieveOptimalIlluminance(RoomId, CurrentValue, OptimalAmbientLight) : CurrentValue == OptimalAmbientLight |
| 51 | + <- true. |
| 52 | + |
| 53 | +// Operating Room |
| 54 | ++!achieveOptimalIlluminance(RoomId, CurrentValue, OptimalAmbientLight, OptimalSurgicalLight) : CurrentValue \== OptimalAmbientLight |
| 55 | + <- .println(adjust_luminosity_operating_room); |
| 56 | + !setAmbientLight(RoomId, OptimalAmbientLight); |
| 57 | + !setSurgicalLight(RoomId, OptimalSurgicalLight). |
| 58 | ++!achieveOptimalIlluminance(RoomId, CurrentValue, OptimalAmbientLight, OptimalSurgicalLight) : CurrentValue == OptimalAmbientLight |
| 59 | + <- true. |
34 | 60 |
|
35 | 61 | // Ambient light set goal
|
36 | 62 | +!setAmbientLight(RoomId, Value)
|
|
0 commit comments