From: <jom...@us...> - 2013-08-30 11:32:05
|
Revision: 1744 http://sourceforge.net/p/jason/svn/1744 Author: jomifred Date: 2013-08-30 11:32:02 +0000 (Fri, 30 Aug 2013) Log Message: ----------- fix bugs related to JAG events and a bug related to wait inside atomic intentions Modified Paths: -------------- trunk/demos/persistent-belief-base/VoidBB.java trunk/lib/moise.jar trunk/release-notes.txt trunk/src/jason/asSemantics/TransitionSystem.java trunk/src/jason/asSyntax/PlanLibrary.java trunk/src/jason/stdlib/wait.java Modified: trunk/demos/persistent-belief-base/VoidBB.java =================================================================== --- trunk/demos/persistent-belief-base/VoidBB.java 2013-08-24 16:23:00 UTC (rev 1743) +++ trunk/demos/persistent-belief-base/VoidBB.java 2013-08-30 11:32:02 UTC (rev 1744) @@ -20,6 +20,8 @@ } public void stop() { } + public void clear() { + } public int size() { return 0; } Modified: trunk/lib/moise.jar =================================================================== (Binary files differ) Modified: trunk/release-notes.txt =================================================================== --- trunk/release-notes.txt 2013-08-24 16:23:00 UTC (rev 1743) +++ trunk/release-notes.txt 2013-08-30 11:32:02 UTC (rev 1744) @@ -9,6 +9,10 @@ ...; !g(4)[hard_deadline(3000)]; ... if g(4) is not finished in 3 seconds, a failure event is produced. +- the internal action .wait accepts a logical expression as argument, as in + ...; .wait(b(X) & X > 10); .... + The intention will be suspended until the agent belief b(X) with X > 10. + Timeout and elapse time arguments can be used as previously. --------------------------- version 1.3.9 Modified: trunk/src/jason/asSemantics/TransitionSystem.java =================================================================== --- trunk/src/jason/asSemantics/TransitionSystem.java 2013-08-24 16:23:00 UTC (rev 1743) +++ trunk/src/jason/asSemantics/TransitionSystem.java 2013-08-30 11:32:02 UTC (rev 1744) @@ -1156,7 +1156,7 @@ if (failAnnots == null) failAnnots = JasonException.createBasicErrorAnnots( JasonException.UNKNOW_ERROR, ""); - Literal eventLiteral = failEvent.getTrigger().getLiteral(); + Literal eventLiteral = failEvent.getTrigger().getLiteral().forceFullLiteralImpl(); eventLiteral.addAnnots(failAnnots); // add failure annots in the event related to the code source Modified: trunk/src/jason/asSyntax/PlanLibrary.java =================================================================== --- trunk/src/jason/asSyntax/PlanLibrary.java 2013-08-24 16:23:00 UTC (rev 1743) +++ trunk/src/jason/asSyntax/PlanLibrary.java 2013-08-30 11:32:02 UTC (rev 1744) @@ -342,7 +342,7 @@ public List<Plan> getCandidatePlans(Trigger te) { List<Plan> l = relPlans.get(te.getPredicateIndicator()); - if ((l == null || l.isEmpty()) && !varPlans.isEmpty()) { // no rel plan, try varPlan + if ((l == null || l.isEmpty()) && !varPlans.isEmpty() && te != TE_JAG_SLEEPING && te != TE_JAG_AWAKING) { // no rel plan, try varPlan for (Plan p: varPlans) if (p.getTrigger().sameType(te)) { if (l == null) Modified: trunk/src/jason/stdlib/wait.java =================================================================== --- trunk/src/jason/stdlib/wait.java 2013-08-24 16:23:00 UTC (rev 1743) +++ trunk/src/jason/stdlib/wait.java 2013-08-30 11:32:02 UTC (rev 1744) @@ -89,8 +89,8 @@ public static final String waitAtom = ".wait"; - @Override public boolean canBeUsedInContext() { return false; } - @Override public boolean suspendIntention() { return true; } + @Override public boolean canBeUsedInContext() { return false; } + @Override public boolean suspendIntention() { return true; } @Override public int getMinArgs() { return 1; } @Override public int getMaxArgs() { return 3; } @@ -175,8 +175,8 @@ ts.runAtBeginOfNextCycle(new Runnable() { public void run() { try { - // add SI again in C.I if it was not removed and this wait was not dropped - if (c.removePendingIntention(sEvt) == si && !c.hasIntention(si) && !dropped) { + // add SI again in C.I if (1) it was not removed (2) is is not running (by some other reason) -- but this test does not apply to atomic intentions --, and (3) this wait was not dropped + if (c.removePendingIntention(sEvt) == si && (si.isAtomic() || !c.hasIntention(si)) && !dropped) { if (stopByTimeout && te != null && elapsedTimeTerm == null) { // fail the .wait by timeout if (si.isSuspended()) { // if the intention was suspended by .suspend This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |