-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildAgent.asl
44 lines (16 loc) · 1017 Bytes
/
buildAgent.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
// Agent buildAgent in project productionLine
/* Initial beliefs and rules */
/* Initial goals */
buildStatus(0).
buildFree(true).
//!arrangePosition.
/* Plans */
!arrangePosition.
+!arrangePosition: true <- resetPosition; .print("Build initializes itself"); !awareSortAg. // reset first
+!mybuild : true <- -+buildFree(false); ?buildStatus(M); .print("M= ",M); K = M+1; -+buildStatus(K); .print("K=", K); !state.
+!state : buildStatus(L) & L ==1 <-.print("Press 1 ",L); mediumPress; .send(sortAgent,achieve,samplecolor); !awareSortAg.
+!state : buildStatus(Z) & Z ==2 <- .print("Press 2 ",Z); secondPress; !eject.
+!eject : true <- .print("Eject"); -+buildStatus(0); ejectProduct; .send(sortAgent,achieve,samplecolor);!awareSortAg. //state_eject
+!awareSortAg: true <- ?buildFree(Bf); .send(sortAgent,tell,buildFree(true)).
+!mybuild : false <- ?buildStatus(M); !mybuild.
+!arrangePosition:false <- ?buildStatus(YY);!arrangePosition.