1
0
mirror of https://github.com/balkian/SOJA.git synced 2024-10-31 18:51:43 +00:00
SOJA/src/asl/nluAgent.asl
2012-03-20 17:16:44 +01:00

40 lines
1.5 KiB
Plaintext

// Agent nluAgent in project Web40SOJason
/* Initial beliefs and rules */
/* Initial goals */
/* Plans */
@in_msg
+user_msg(Msg, Query) : true
<- sendNLU(Query, Msg);
-user_msg(Msg, Query). // clear the memory
/* Tell the user agent what the NLU system understood */
+price(Terms, Price)[query(Query), domain(travel)] : true
<- .send(userAgent, tell, price(Terms, Price)[query(Query)], domain(travel));
.print("Percibido: price ",Terms, " ", Price ).
+date(Terms, Day, Month, Year)[query(Query), domain(travel)] : true
<- .send(userAgent, tell, date(Terms, Day, Month, Year)[query(Query), domain(travel)]);
.print("Percibido: date ",Terms, " ", Day, " ", Month, " ", Year).
+time(Terms, Hours, Minutes)[query(Query), domain(travel)] : true
<- .send(userAgent, tell, time(Terms, Hours, Minutes)[query(Query), domain(travel)]);
.print("Percibido: time ",Terms, " ", Hours, " ", Minutes).
+location(Terms, Place)[query(Query), domain(travel)] : true
<- .send(userAgent, tell, location(Terms, Place)[query(Query), domain(travel)]);
.print("Percibido: location ",Terms, " ", Place).
+type(Terms)[query(Query), domain(travel)] : true
<- .send(userAgent, tell, type(Terms)[query(Query), domain(travel)]);
.print("Percibido: type ",Terms).
@sendFindTravel
+done[query(Query), domain(Domain)] : true
<- .wait(1000); // wait until all other information is sent
.print("Percepcion completada");
.send(userAgent, achieve, find(Domain, Query)).