|
From: <jom...@us...> - 2014-09-24 17:12:57
|
Revision: 1810
http://sourceforge.net/p/jason/svn/1810
Author: jomifred
Date: 2014-09-24 17:12:50 +0000 (Wed, 24 Sep 2014)
Log Message:
-----------
fix bug in example cnp
Modified Paths:
--------------
trunk/examples/contract-net-protocol/c.asl
Modified: trunk/examples/contract-net-protocol/c.asl
===================================================================
--- trunk/examples/contract-net-protocol/c.asl 2014-09-24 12:59:32 UTC (rev 1809)
+++ trunk/examples/contract-net-protocol/c.asl 2014-09-24 17:12:50 UTC (rev 1810)
@@ -9,12 +9,13 @@
/* Initial goals */
!startCNP(1,fix(computer)).
+//!startCNP(2,banana).
/* Plans */
// start the CNP
+!startCNP(Id,Task)
- <- .print("Waiting participants...");
+ <- .print(" Waiting participants for task ",Task,"...");
.wait(2000); // wait participants introduction
+cnp_state(Id,propose); // remember the state of the CNP
.findall(Name,introduction(participant,Name),LP);
@@ -41,7 +42,8 @@
@lc1[atomic]
+!contract(CNPId)
: cnp_state(CNPId,propose)
- <- -+cnp_state(CNPId,contract);
+ <- -cnp_state(CNPId,_);
+ +cnp_state(CNPId,contract);
.findall(offer(O,A),propose(CNPId,O)[source(A)],L);
.print("Offers are ",L);
L \== []; // constraint the plan execution to at least one offer
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|