|
From: <jom...@us...> - 2009-02-11 21:21:45
|
Revision: 1437
http://jason.svn.sourceforge.net/jason/?rev=1437&view=rev
Author: jomifred
Date: 2009-02-11 21:21:39 +0000 (Wed, 11 Feb 2009)
Log Message:
-----------
fix a small problem in the VC example
Modified Paths:
--------------
trunk/demos/communication/bob.asl
trunk/doc/mini-tutorial/src/getting-started/VacuumCleaning-1/VCWorld.java
trunk/doc/mini-tutorial/src/getting-started/VacuumCleaning-1/vc.asl
trunk/examples/domestic-robot/robot.asl
Modified: trunk/demos/communication/bob.asl
===================================================================
--- trunk/demos/communication/bob.asl 2009-02-11 10:05:46 UTC (rev 1436)
+++ trunk/demos/communication/bob.asl 2009-02-11 21:21:39 UTC (rev 1437)
@@ -15,7 +15,7 @@
.println("Sending assynchronous ask ");
.send(maria, askOne, vl(_)); // assync ask has no fourth argument
- // the answer is received as an event +vl(X)
+ // the answer is received as an event +vl(X)
.println("Sending ask for something Maria does not know, but can handle by +? ");
.send(maria, askOne, t2(_), Ans2);
@@ -37,10 +37,10 @@
.send(maria, askOne, fullname, FN);
.println("Full name is ",FN);
- // Send to maria a plan to achieve the goal hello
- .plan_label(Plan,hp); // get a plans based on a plan's label
- .println("Sending tell how: ",Plan);
- .send(maria,tellHow,Plan);
+ // Send to maria a plan to achieve the goal hello
+ .plan_label(Plan,hp); // get a plans based on a plan's label
+ .println("Sending tell how: ",Plan);
+ .send(maria,tellHow,Plan);
.println("Asking Maria to achieve 'hello'");
.send(maria,achieve, hello(bob));
@@ -49,8 +49,8 @@
.println("Asking Maria to unachieve 'hello'");
.send(maria,unachieve, hello(bob));
- // send untell how to maria
- .send(maria,untellHow,hp).
+ // send untell how to maria
+ .send(maria,untellHow,hp).
+vl(X)[source(A)]
Modified: trunk/doc/mini-tutorial/src/getting-started/VacuumCleaning-1/VCWorld.java
===================================================================
--- trunk/doc/mini-tutorial/src/getting-started/VacuumCleaning-1/VCWorld.java 2009-02-11 10:05:46 UTC (rev 1436)
+++ trunk/doc/mini-tutorial/src/getting-started/VacuumCleaning-1/VCWorld.java 2009-02-11 21:21:39 UTC (rev 1437)
@@ -61,6 +61,12 @@
// remove previous perception
clearPercepts();
+ if (dirty[vcx][vcy]) {
+ addPercept(lDirty);
+ } else {
+ addPercept(lClean);
+ }
+
if (vcx == 0 && vcy == 0) {
addPercept(lPos1);
} else if (vcx == 1 && vcy == 0) {
@@ -70,19 +76,15 @@
} else if (vcx == 1 && vcy == 1) {
addPercept(lPos4);
}
-
- if (dirty[vcx][vcy]) {
- addPercept(lDirty);
- } else {
- addPercept(lClean);
- }
}
@Override
public boolean executeAction(String ag, Structure action) {
- try { Thread.sleep(500);} catch (Exception e) {} //show down the execution
+ logger.info("doing "+action);
+ try { Thread.sleep(500);} catch (Exception e) {} // slow down the execution
+
// Change the world model based on action
if (action.getFunctor().equals("suck")) {
if (dirty[vcx][vcy]) {
Modified: trunk/doc/mini-tutorial/src/getting-started/VacuumCleaning-1/vc.asl
===================================================================
--- trunk/doc/mini-tutorial/src/getting-started/VacuumCleaning-1/vc.asl 2009-02-11 10:05:46 UTC (rev 1436)
+++ trunk/doc/mini-tutorial/src/getting-started/VacuumCleaning-1/vc.asl 2009-02-11 21:21:39 UTC (rev 1437)
@@ -15,4 +15,3 @@
// TODO: the code of the agent
-
Modified: trunk/examples/domestic-robot/robot.asl
===================================================================
--- trunk/examples/domestic-robot/robot.asl 2009-02-11 10:05:46 UTC (rev 1436)
+++ trunk/examples/domestic-robot/robot.asl 2009-02-11 21:21:39 UTC (rev 1437)
@@ -1,6 +1,6 @@
/* Initial beliefs and rules */
-// initially, I believe that there are some beer in the fridge
+// initially, I believe that there is some beer in the fridge
available(beer,fridge).
// my owner should not consume more than 10 beers a day :-)
@@ -24,7 +24,7 @@
!at(robot,owner);
hand_in(beer);
?has(owner,beer);
- // remember that one beer is consumed
+ // remember that another beer has been consumed
.date(YY,MM,DD); .time(HH,NN,SS);
+consumed(YY,MM,DD,HH,NN,SS,beer).
@@ -50,7 +50,7 @@
<- move_towards(P);
!at(robot,P).
-// when the supermarket finished the order, try the 'has' goal again
+// when the supermarket makes a delivery, try the 'has' goal again
+delivered(beer,_Qtd,_OrderId)[source(supermarket)]
: true
<- +available(beer,fridge);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|