-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpersonal_assistant.asl
75 lines (56 loc) · 1.85 KB
/
personal_assistant.asl
1
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// personal assistant agent
/* Task 2 Start of your solution */
artificial_light(2).
natural_light(1).
mattress_vibration(0).
best_option(Number) :- Number = 0.
+lights(State) : true <-
.print("Lights are ", State).
-lights(State) : true <-
.print("Lights are ", State).
+blinds(State) : true <-
.print("Blinds are ", State).
-blinds(State) : true <-
.print("Blinds are ", State).
+mattress(State) : true <-
.print("Mattress is ", State).
-mattress(State) : true <-
.print("Mattress is ", State).
+wristband(State) : true <-
.print("Wristband is ", State).
-wristband(State) : true <-
.print("Wristband is ", State).
+upcoming_event("now") : owner_state("awake") <-
.print("Enjoy your event.").
+upcoming_event("now") : owner_state("asleep") <-
.print("Starting wake-up routine.");
!wake_up.
+!wake_up : owner_state("asleep") & mattress_vibration(Number) & best_option(Number) <-
.print("Wake up with mattress vibration.");
setVibrationsMode;
-+mattress_vibration(2);
-+artificial_light(1);
-+natural_light(0);
.wait(1000);
!wake_up.
+!wake_up : owner_state("asleep") & natural_light(Number) & best_option(Number) <-
.print("Wake up with natural light.");
raiseBlinds;
-+natural_light(2);
-+mattress_vibration(1);
-+artificial_light(0);
.wait(1000);
!wake_up.
+!wake_up : owner_state("asleep") & artificial_light(Number) & best_option(Number) <-
.print("Wake up with artificial light.");
turnOnLights;
-+artificial_light(2);
-+natural_light(1);
-+mattress_vibration(0);
.wait(1000);
!wake_up.
+!wake_up : true <-
.print("The user is now awake.").
/* Task 2 End of your solution */
/* Import behavior of agents that work in CArtAgO environments */
{ include("$jacamoJar/templates/common-cartago.asl") }