|
From: <jom...@us...> - 2008-07-06 15:58:22
|
Revision: 1348
http://jason.svn.sourceforge.net/jason/?rev=1348&view=rev
Author: jomifred
Date: 2008-07-06 08:58:16 -0700 (Sun, 06 Jul 2008)
Log Message:
-----------
small changes for 1.1.2
Modified Paths:
--------------
trunk/applications/jason-team/readme.txt
trunk/applications/jason-team/screenshots/s1b.txt
trunk/applications/jason-team/screenshots/s1c ag against their curral.txt
trunk/demos/gui/readme.txt
trunk/release-notes.txt
trunk/src/jason/asSyntax/parser/AS2JavaParser.jcc
trunk/src/jason/asSyntax/parser/as2j.java
Added Paths:
-----------
trunk/src/jason/stdlib/if_then_else.java
Removed Paths:
-------------
trunk/src/jason/stdlib/conditional.java
Modified: trunk/applications/jason-team/readme.txt
===================================================================
--- trunk/applications/jason-team/readme.txt 2008-07-05 09:37:52 UTC (rev 1347)
+++ trunk/applications/jason-team/readme.txt 2008-07-06 15:58:16 UTC (rev 1348)
@@ -10,8 +10,8 @@
*/
-To run this team Jason 1.1.2 is required.
-
+To run this team Jason 1.1.2 is required.
+
Steps:
1. run massim-server
Modified: trunk/applications/jason-team/screenshots/s1b.txt
===================================================================
--- trunk/applications/jason-team/screenshots/s1b.txt 2008-07-05 09:37:52 UTC (rev 1347)
+++ trunk/applications/jason-team/screenshots/s1b.txt 2008-07-06 15:58:16 UTC (rev 1348)
@@ -1,79 +1,79 @@
-|---------------------------------------------------------------------------------|
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| X XXXXXXXXX X |
-| X XXX XXX X |
-| XX XXX XXX XX |
-| XX XXX XXX XX |
-| XXX XXX XXX XXX |
-| XXXX XXX XXX XXXX |
-| XXXXXX XXXXXX |
-| X X |
-| XXXXXX X X XXXXXX |
-| X XXXXX XX XX XXXXX X |
-| XX XXXXXXXX XXXXXXXX XX |
-| X ------ XXXXXX X |
-| X ------ XXXXXX X |
-| X ------ XXXXXX X |
-| X c ------ XXXXXX X |
-| XX cc ------ XXXXXX XX |
-| XX ------ XXXXXX XX |
-| XX 1 XXX ------ XXXXXX XXX XX |
-| XX X ------ XXXXXX X XX |
-| X X |
-| X X |
-| c X X |
-| c X X 32 |
-| X X |
-| XX XX 6 |
-| c X X 4 |
-| X X |
-| XX XX |
-| X X |
-| XX XX |
-| X X |
-| XX X X XX |
-| X X X X |
-| XX XX XX XX |
-| X XXX XXX X |
-| X XXXX XXXX X |
-| X XXX XXX X |
-| X XX XX X |
-| XX XX |
-| X X X X |
-| X X |
-| XXX XXX XXX XXX |
-| X X |
-| XXXX XXXX |
-| X XXXXXXXXXX XX X |
-| XX X X XX |
-| XX XX |
-| XX XX X |
-| XXXX |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-| |
-|---------------------------------------------------------------------------------|
+|---------------------------------------------------------------------------------|
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| X XXXXXXXXX X |
+| X XXX XXX X |
+| XX XXX XXX XX |
+| XX XXX XXX XX |
+| XXX XXX XXX XXX |
+| XXXX XXX XXX XXXX |
+| XXXXXX XXXXXX |
+| X X |
+| XXXXXX X X XXXXXX |
+| X XXXXX XX XX XXXXX X |
+| XX XXXXXXXX XXXXXXXX XX |
+| X ------ XXXXXX X |
+| X ------ XXXXXX X |
+| X ------ XXXXXX X |
+| X c ------ XXXXXX X |
+| XX cc ------ XXXXXX XX |
+| XX ------ XXXXXX XX |
+| XX 1 XXX ------ XXXXXX XXX XX |
+| XX X ------ XXXXXX X XX |
+| X X |
+| X X |
+| c X X |
+| c X X 32 |
+| X X |
+| XX XX 6 |
+| c X X 4 |
+| X X |
+| XX XX |
+| X X |
+| XX XX |
+| X X |
+| XX X X XX |
+| X X X X |
+| XX XX XX XX |
+| X XXX XXX X |
+| X XXXX XXXX X |
+| X XXX XXX X |
+| X XX XX X |
+| XX XX |
+| X X X X |
+| X X |
+| XXX XXX XXX XXX |
+| X X |
+| XXXX XXXX |
+| X XXXXXXXXXX XX X |
+| XX X X XX |
+| XX XX |
+| XX XX X |
+| XXXX |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+| |
+|---------------------------------------------------------------------------------|
Modified: trunk/applications/jason-team/screenshots/s1c ag against their curral.txt
===================================================================
--- trunk/applications/jason-team/screenshots/s1c ag against their curral.txt 2008-07-05 09:37:52 UTC (rev 1347)
+++ trunk/applications/jason-team/screenshots/s1c ag against their curral.txt 2008-07-06 15:58:16 UTC (rev 1348)
@@ -1,64 +1,64 @@
-| |
-| |
-| |
-| |
-| |
-| XXXXXXXXX |
-| XXX XXX |
-| X XXX XXX |
-| XX XXX XXX XX |
-| XXX XXX XXX XXX |
-| XXXX XXX XXX XXXX |
-| XXXXXX XXXXXX |
-| X X |
-| XXXXXX X X c XXXXXX |
-| X XXXXX XX XX c XXXXX X |
-| X XXXXXXXX XXXXXXXX XX |
-| X ------ XXXXXX X |
-| X ------ XXXXXX c X |
-| X ------ XXXXXX X |
-| X ------ XXXXXX X |
-| XX ------ XXXXXX 1 4 XX |
-| XX ------ XXXXXX E cE XX |
-| XX XXX ------ XXXXXX XXX 3 XX |
-| XX X ------ XXXXXX X XX |
-| X X |
-| X X c |
-| X X E |
-| X X |
-| X X |
-| XX XX |
-| X X |
-| X X |
-| X X |
-| X X |
-| X X |
-| XX XX |
-| XX XX |
-| X X |
-| XX XX |
-| X 2 X |
-| XX X X XX |
-| X X X X |
-| XX XX XX XX |
-| X XX XXX X |
-| X XXXX X |
-| X XXX X |
-| X XX X |
-| XX XX |
-| X X X X |
-| X X |
-| XXX XXX XXX |
-| X |
-| XXXX |
-| XXXXXXXXXX X |
-| X XX5 |
-| XX |
-| XXXX XX 6 |
-| XXXX |
-| |
-| |
-| |
-| |
-| |
-| |
+| |
+| |
+| |
+| |
+| |
+| XXXXXXXXX |
+| XXX XXX |
+| X XXX XXX |
+| XX XXX XXX XX |
+| XXX XXX XXX XXX |
+| XXXX XXX XXX XXXX |
+| XXXXXX XXXXXX |
+| X X |
+| XXXXXX X X c XXXXXX |
+| X XXXXX XX XX c XXXXX X |
+| X XXXXXXXX XXXXXXXX XX |
+| X ------ XXXXXX X |
+| X ------ XXXXXX c X |
+| X ------ XXXXXX X |
+| X ------ XXXXXX X |
+| XX ------ XXXXXX 1 4 XX |
+| XX ------ XXXXXX E cE XX |
+| XX XXX ------ XXXXXX XXX 3 XX |
+| XX X ------ XXXXXX X XX |
+| X X |
+| X X c |
+| X X E |
+| X X |
+| X X |
+| XX XX |
+| X X |
+| X X |
+| X X |
+| X X |
+| X X |
+| XX XX |
+| XX XX |
+| X X |
+| XX XX |
+| X 2 X |
+| XX X X XX |
+| X X X X |
+| XX XX XX XX |
+| X XX XXX X |
+| X XXXX X |
+| X XXX X |
+| X XX X |
+| XX XX |
+| X X X X |
+| X X |
+| XXX XXX XXX |
+| X |
+| XXXX |
+| XXXXXXXXXX X |
+| X XX5 |
+| XX |
+| XXXX XX 6 |
+| XXXX |
+| |
+| |
+| |
+| |
+| |
+| |
Modified: trunk/demos/gui/readme.txt
===================================================================
--- trunk/demos/gui/readme.txt 2008-07-05 09:37:52 UTC (rev 1347)
+++ trunk/demos/gui/readme.txt 2008-07-06 15:58:16 UTC (rev 1348)
@@ -1,18 +1,18 @@
-There are many ways of creating GUI for Jason agents.
-All of them relies on Java.
-
-This directory contains the following examples:
-
-gui1: uses and internal action to ask something to the user
-
-gui2: creates a window with buttons that, when pressed,
- produce events the agent can react to.
-
-
-Some examples of Jason also use GUI:
-
-auction: uses a customised agent architecture that provides special
- actions to show information in a GUI
-
-domestic-robot, iterated-prisoners-dilemma, and many others: the GUI
- is implemented and maintained by the environment.
\ No newline at end of file
+There are many ways of creating GUI for Jason agents.
+All of them relies on Java.
+
+This directory contains the following examples:
+
+gui1: uses and internal action to ask something to the user
+
+gui2: creates a window with buttons that, when pressed,
+ produce events the agent can react to.
+
+
+Some examples of Jason also use GUI:
+
+auction: uses a customised agent architecture that provides special
+ actions to show information in a GUI
+
+domestic-robot, iterated-prisoners-dilemma, and many others: the GUI
+ is implemented and maintained by the environment.
Modified: trunk/release-notes.txt
===================================================================
--- trunk/release-notes.txt 2008-07-05 09:37:52 UTC (rev 1347)
+++ trunk/release-notes.txt 2008-07-06 15:58:16 UTC (rev 1348)
@@ -3,7 +3,7 @@
-------------
New features
-. (experimental) control of the execution in plan's body with if, while
+. (experimental) control of the execution in plan bodies with if, while,
and for.
--- if ----
@@ -17,8 +17,9 @@
if <logical formula> holds, <plan_body1> is executed; otherwise,
<plan_body2> is executed.
- e.g.: if (vl(X) & X > 10) { // where vl(X) is a belief
- .print("value > 10")
+ e.g.: if (vl(X) & X > 10 & X < 20) { // where vl(X) is a belief
+ .print("value > 10 and ");
+ .print("value < 20")
}
--- while ---
@@ -41,7 +42,7 @@
<plan_body>
};
- for all unifications of <logical formula> the <plan_body> is executed.
+ the <plan_body> is executed for all unifications of <logical formula>.
e.g.: for ( vl(X) ) {
.print(X)
@@ -55,19 +56,19 @@
New examples and demos:
-. demos/gui: two simple examples of how to make a GUI for agents
+. demos/gui: two simple examples of how to make a GUI for individual agents
. example/food-simulation: implementation of the scenario of simulation
presented in http://jasss.soc.surrey.ac.uk/1/3/3.html
Bugs fixed:
-. BUF doesn't add annotation "source(percept)" in the perception deletion event
-. drop_desire does not remove desires in Circumstance.Event correctly
+. BUF didn't add annotation "source(percept)" in the perception deletion event
+. drop_desire did not remove desires in Circumstance.Event correctly
when annotations are used
-. print works like println
-. =.. with atoms
-. unbound vars as arguments for rules (as identified by Stephen Cranefield)
+. print worked like println
+. problem in =.. with atoms
+. problem in unification whe unbound vars were used as arguments
+ for rules (as identified by Stephen Cranefield)
-
-------------
version 1.1.1
-------------
Modified: trunk/src/jason/asSyntax/parser/AS2JavaParser.jcc
===================================================================
--- trunk/src/jason/asSyntax/parser/AS2JavaParser.jcc 2008-07-05 09:37:52 UTC (rev 1347)
+++ trunk/src/jason/asSyntax/parser/AS2JavaParser.jcc 2008-07-06 15:58:16 UTC (rev 1348)
@@ -403,7 +403,7 @@
]
F=pred() {
if (F.getFunctor().equals("if")) {
- Pred c = new Pred(".conditional");
+ Pred c = new Pred(".if_then_else");
c.setTerms(F.getTerms());
F = c;
} else if (F.getFunctor().equals("while")) {
Modified: trunk/src/jason/asSyntax/parser/as2j.java
===================================================================
--- trunk/src/jason/asSyntax/parser/as2j.java 2008-07-05 09:37:52 UTC (rev 1347)
+++ trunk/src/jason/asSyntax/parser/as2j.java 2008-07-06 15:58:16 UTC (rev 1348)
@@ -548,7 +548,7 @@
}
F = pred();
if (F.getFunctor().equals("if")) {
- Pred c = new Pred(".conditional");
+ Pred c = new Pred(".if_then_else");
c.setTerms(F.getTerms());
F = c;
} else if (F.getFunctor().equals("while")) {
Deleted: trunk/src/jason/stdlib/conditional.java
===================================================================
--- trunk/src/jason/stdlib/conditional.java 2008-07-05 09:37:52 UTC (rev 1347)
+++ trunk/src/jason/stdlib/conditional.java 2008-07-06 15:58:16 UTC (rev 1348)
@@ -1,111 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2003 Rafael H. Bordini, Jomi F. Hubner, et al.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// To contact the authors:
-// http://www.dur.ac.uk/r.bordini
-// http://www.inf.furb.br/~jomi
-//
-//----------------------------------------------------------------------------
-
-package jason.stdlib;
-
-import java.util.Iterator;
-
-import jason.JasonException;
-import jason.asSemantics.DefaultInternalAction;
-import jason.asSemantics.IntendedMeans;
-import jason.asSemantics.InternalAction;
-import jason.asSemantics.TransitionSystem;
-import jason.asSemantics.Unifier;
-import jason.asSyntax.LogicalFormula;
-import jason.asSyntax.PlanBody;
-import jason.asSyntax.Term;
-
-/**
-Implementation of <b>if</b>.
-
-<p>Syntax:
-<pre>
- if ( <i>logical formula</i> ) {
- <i>plan_body1</i>
- [ } else { <i>plan_body2</i> ]
- };
-</pre>
-</p>
-
-<p>if <i>logical formula</i> holds, <i>plan_body1</i> is executed;
-otherwise, <i>plan_body2</i> is executed.</p>
-
-<p>Example:
-<pre>
-+event : context
- <- ....
- if (vl(X) & X > 10) { // where vl(X) is a belief
- .print("value > 10")
- };
- ....
-</pre>
-The unification is changed by the evaluation of the logical formula, i.e., X might have a value after if.
-</p>
-
-*/
-public class conditional extends DefaultInternalAction {
-
- private static InternalAction singleton = null;
- public static InternalAction create() {
- if (singleton == null)
- singleton = new conditional();
- return singleton;
- }
-
- @Override
- public Object execute(TransitionSystem ts, Unifier un, Term[] args) throws Exception {
- try {
- if ( !(args[0] instanceof LogicalFormula))
- throw new JasonException("The first argument of if must be a logical formula.");
-
- LogicalFormula logExpr = (LogicalFormula)args[0];
- PlanBody whattoadd = null;
-
- Iterator<Unifier> iu = logExpr.logicalConsequence(ts.getAg(), un);
- if (iu.hasNext()) { // .if THEN
- if ( !args[1].isPlanBody())
- throw new JasonException("The second argument of if must be a plan body term.");
- whattoadd = (PlanBody)args[1];
- un.compose(iu.next());
- } else if (args.length == 3) { // .if ELSE
- if ( !args[2].isPlanBody())
- throw new JasonException("The third argument of if must be a plan body term.");
- whattoadd = (PlanBody)args[2];
- }
-
- if (whattoadd != null) {
- IntendedMeans im = ts.getC().getSelectedIntention().peek();
- PlanBody ifia = im.getCurrentStep();
- whattoadd.setAsBodyTerm(false);
- ifia.add(1,whattoadd);
- }
- return true;
- } catch (ArrayIndexOutOfBoundsException e) {
- throw new JasonException("The 'if' has not received the required arguments.");
- } catch (JasonException e) {
- throw e;
- } catch (Exception e) {
- throw new JasonException("Error in 'if': " + e, e);
- }
- }
-}
Added: trunk/src/jason/stdlib/if_then_else.java
===================================================================
--- trunk/src/jason/stdlib/if_then_else.java (rev 0)
+++ trunk/src/jason/stdlib/if_then_else.java 2008-07-06 15:58:16 UTC (rev 1348)
@@ -0,0 +1,111 @@
+//----------------------------------------------------------------------------
+// Copyright (C) 2003 Rafael H. Bordini, Jomi F. Hubner, et al.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// To contact the authors:
+// http://www.dur.ac.uk/r.bordini
+// http://www.inf.furb.br/~jomi
+//
+//----------------------------------------------------------------------------
+
+package jason.stdlib;
+
+import java.util.Iterator;
+
+import jason.JasonException;
+import jason.asSemantics.DefaultInternalAction;
+import jason.asSemantics.IntendedMeans;
+import jason.asSemantics.InternalAction;
+import jason.asSemantics.TransitionSystem;
+import jason.asSemantics.Unifier;
+import jason.asSyntax.LogicalFormula;
+import jason.asSyntax.PlanBody;
+import jason.asSyntax.Term;
+
+/**
+Implementation of <b>if</b>.
+
+<p>Syntax:
+<pre>
+ if ( <i>logical formula</i> ) {
+ <i>plan_body1</i>
+ [ } else { <i>plan_body2</i> ]
+ };
+</pre>
+</p>
+
+<p>if <i>logical formula</i> holds, <i>plan_body1</i> is executed;
+otherwise, <i>plan_body2</i> is executed.</p>
+
+<p>Example:
+<pre>
++event : context
+ <- ....
+ if (vl(X) & X > 10) { // where vl(X) is a belief
+ .print("value > 10")
+ };
+ ....
+</pre>
+The unification is changed by the evaluation of the logical formula, i.e., X might have a value after if.
+</p>
+
+*/
+public class if_then_else extends DefaultInternalAction {
+
+ private static InternalAction singleton = null;
+ public static InternalAction create() {
+ if (singleton == null)
+ singleton = new if_then_else();
+ return singleton;
+ }
+
+ @Override
+ public Object execute(TransitionSystem ts, Unifier un, Term[] args) throws Exception {
+ try {
+ if ( !(args[0] instanceof LogicalFormula))
+ throw new JasonException("The first argument of if must be a logical formula.");
+
+ LogicalFormula logExpr = (LogicalFormula)args[0];
+ PlanBody whattoadd = null;
+
+ Iterator<Unifier> iu = logExpr.logicalConsequence(ts.getAg(), un);
+ if (iu.hasNext()) { // .if THEN
+ if ( !args[1].isPlanBody())
+ throw new JasonException("The second argument of if must be a plan body term.");
+ whattoadd = (PlanBody)args[1];
+ un.compose(iu.next());
+ } else if (args.length == 3) { // .if ELSE
+ if ( !args[2].isPlanBody())
+ throw new JasonException("The third argument of if must be a plan body term.");
+ whattoadd = (PlanBody)args[2];
+ }
+
+ if (whattoadd != null) {
+ IntendedMeans im = ts.getC().getSelectedIntention().peek();
+ PlanBody ifia = im.getCurrentStep();
+ whattoadd.setAsBodyTerm(false);
+ ifia.add(1,whattoadd);
+ }
+ return true;
+ } catch (ArrayIndexOutOfBoundsException e) {
+ throw new JasonException("The 'if' has not received the required arguments.");
+ } catch (JasonException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new JasonException("Error in 'if': " + e, e);
+ }
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|