|
From: <jom...@us...> - 2009-01-15 16:39:12
|
Revision: 1429
http://jason.svn.sourceforge.net/jason/?rev=1429&view=rev
Author: jomifred
Date: 2009-01-15 16:39:02 +0000 (Thu, 15 Jan 2009)
Log Message:
-----------
update faq with new version of example using-only-jason-BDI
Modified Paths:
--------------
trunk/applications/jason-eclipse-plugin/build.xml
trunk/build.xml
trunk/demos/using-only-jason-BDI-engine/SimpleJasonAgent.java
trunk/doc/faq/faq.tex
Modified: trunk/applications/jason-eclipse-plugin/build.xml
===================================================================
--- trunk/applications/jason-eclipse-plugin/build.xml 2009-01-06 16:33:24 UTC (rev 1428)
+++ trunk/applications/jason-eclipse-plugin/build.xml 2009-01-15 16:39:02 UTC (rev 1429)
@@ -12,7 +12,7 @@
<property name="dist.properties" value="${basedir}/bin/dist.properties" />
<property name="version" value="1" />
- <property name="release" value="2.0" />
+ <property name="release" value="2" />
<property name="distDir" value="${basedir}/dist" />
<property name="distDirPlugins" value="${distDir}/plugins" />
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2009-01-06 16:33:24 UTC (rev 1428)
+++ trunk/build.xml 2009-01-15 16:39:02 UTC (rev 1429)
@@ -15,7 +15,7 @@
<property name="dist.properties" value="${basedir}/bin/dist.properties" />
<property name="version" value="1" />
- <property name="release" value="2.0" />
+ <property name="release" value="2" />
<property name="distDir" value="${env.HOME}/tmp/x/Jason-${version}.${release}" />
<property name="distFile" value="${env.HOME}/Jason-${version}.${release}" />
Modified: trunk/demos/using-only-jason-BDI-engine/SimpleJasonAgent.java
===================================================================
--- trunk/demos/using-only-jason-BDI-engine/SimpleJasonAgent.java 2009-01-06 16:33:24 UTC (rev 1428)
+++ trunk/demos/using-only-jason-BDI-engine/SimpleJasonAgent.java 2009-01-15 16:39:02 UTC (rev 1429)
@@ -87,8 +87,8 @@
@Override
public void sleep() {
try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {}
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {}
}
// Not used methods
Modified: trunk/doc/faq/faq.tex
===================================================================
--- trunk/doc/faq/faq.tex 2009-01-06 16:33:24 UTC (rev 1428)
+++ trunk/doc/faq/faq.tex 2009-01-15 16:39:02 UTC (rev 1429)
@@ -579,7 +579,7 @@
\end{verbatim}
The following class implements the required architecture (the complete
-code is available with the examples in the \jason distribution). This
+code is available in the `demos' directory in the \jason distribution). This
code simply adds \code{x(10)} into the agent's belief base through
perception and get the output action, in this case \code{do(50)}.
@@ -597,10 +597,8 @@
// Semantics is implemented)
Agent ag = new Agent();
- setTS(ag.initAg(this,
- new DefaultBeliefBase(),
- "demo.asl", // source code
- new Settings()));
+ new TransitionSystem(ag, new Circumstance(), new Settings(), this);
+ ag.initAg("demo.asl"); // demo.asl is the file containing the code of the agent
}
public String getAgName() {
@@ -608,7 +606,7 @@
}
public void run() {
- while (true) {
+ while (isRunning()) {
// calls the Jason engine to perform one reasoning cycle
getTS().reasoningCycle();
}
@@ -629,6 +627,27 @@
action.setResult(true);
feedback.add(action);
}
+
+ public boolean canSleep() {
+ return true;
+ }
+
+ public boolean isRunning() {
+ return true;
+ }
+
+ public void sleep() {
+ try { Thread.sleep(1000); } catch (InterruptedException e) {}
+ }
+
+ public void sendMsg(jason.asSemantics.Message m) throws Exception {
+ }
+
+ public void broadcast(jason.asSemantics.Message m) throws Exception {
+ }
+
+ public void checkMail() {
+ }
}
\end{verbatim}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|