Skip to content

Commit

Permalink
feat: implement standby mode decision and flow towards control agents…
Browse files Browse the repository at this point in the history
… in director agent
  • Loading branch information
AndreaGiulianelli committed Apr 18, 2023
1 parent 429fe73 commit 0f9badf
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/agt/director.asl
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,31 @@
// Check standby proposals for pre/post operating room
+!checkPrePostOperatingRoomStandbyProposals
<- in(requestStandby, RoomId, Temperature, Humidity, AmbientLight);
.println(requestedPre);
.println(RoomId);
.concat("requested standby for pre/post operating room:", RoomId, LogString);
.println(LogString);
.send(temperatureControl, tell, specificTemperatureTarget(RoomId, Temperature));
.send(humidityControl, tell, specificHumidityTarget(RoomId, Humidity));
.send(luminosityControl, tell, specificIlluminanceTarget(RoomId, AmbientLight));
!!checkPrePostOperatingRoomStandbyProposals.

// Check standby proposals for operating room
+!checkOperatingRoomStandbyProposals
<- in(requestStandby, RoomId, Temperature, Humidity, AmbientLight, SurgicalLight);
.println(requestedOp);
.println(RoomId);
.concat("requested standby for operating room: ", RoomId, LogString);
.println(LogString);
.send(temperatureControl, tell, specificTemperatureTarget(RoomId, Temperature));
.send(humidityControl, tell, specificHumidityTarget(RoomId, Humidity));
.send(luminosityControl, tell, specificIlluminanceTarget(RoomId, AmbientLight, SurgicalLight));
!!checkOperatingRoomStandbyProposals.

+!checkStandbyEnd
<- in(stopStandby, RoomId);
.println(stopStandby);
.println(RoomId);
.concat("stop standby for room: ", RoomId, LogString);
.println(LogString);
.send(temperatureControl, untell, specificTemperatureTarget(RoomId, _));
.send(humidityControl, untell, specificHumidityTarget(RoomId, _));
.send(luminosityControl, untell, specificIlluminanceTarget(RoomId, _, _));
.send(luminosityControl, untell, specificIlluminanceTarget(RoomId, _));
!!checkStandbyEnd.

{ include("$jacamoJar/templates/common-cartago.asl") }
Expand Down

0 comments on commit 0f9badf

Please sign in to comment.