|
From: <jom...@us...> - 2009-03-02 15:20:45
|
Revision: 1456
http://jason.svn.sourceforge.net/jason/?rev=1456&view=rev
Author: jomifred
Date: 2009-03-02 15:20:39 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
new internal action: .all_names
Modified Paths:
--------------
trunk/build.xml
trunk/doc/index.html
trunk/release-notes.txt
trunk/src/jason/infra/centralised/CentralisedRuntimeServices.java
trunk/src/jason/infra/jade/JadeRuntimeServices.java
trunk/src/jason/infra/saci/SaciRuntimeServices.java
trunk/src/jason/runtime/RuntimeServicesInfraTier.java
trunk/src/jason/stdlib/create_agent.java
trunk/src/jason/stdlib/my_name.java
trunk/src/jason/stdlib/package.html
Added Paths:
-----------
trunk/src/jason/stdlib/all_names.java
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2009-02-27 08:11:39 UTC (rev 1455)
+++ trunk/build.xml 2009-03-02 15:20:39 UTC (rev 1456)
@@ -352,6 +352,7 @@
<delete dir="${distDir}/bin/classes" />
<delete dir="${distDir}/bin/classes-eclipse" />
<delete dir="${distDir}/doc/faq" />
+ <delete dir="${distDir}/doc/api-doxygen" />
<delete dir="${distDir}/doc/mini-tutorial/src" />
<tar compression="gzip" tarfile="${distFile}.tgz" longfile="gnu">
Modified: trunk/doc/index.html
===================================================================
--- trunk/doc/index.html 2009-02-27 08:11:39 UTC (rev 1455)
+++ trunk/doc/index.html 2009-03-02 15:20:39 UTC (rev 1456)
@@ -20,7 +20,7 @@
<li><a href="api/jason/stdlib/package-summary.html#package_description">Stantard internal actions</a> (html)</li>
<li><a href="api/jason/functions/package-summary.html">Stantard arithmetic functions</a> (html)</li>
-<li>API of all classes: generated by <a href="api/index.html">JavaDoc</a> or by <a href="api-doxygen/html/index.html">Doxygen</a>.</li><br>
+<li>API of all classes: generated by <a href="api/index.html">JavaDoc</a>.</li><br>
<li><a href="AS2JavaParser.html">Syntax of AgentSpeak</a> as
interpreted by <a href="http://jason.sf.net"><b><i>Jason</i></b></a> (html
Modified: trunk/release-notes.txt
===================================================================
--- trunk/release-notes.txt 2009-02-27 08:11:39 UTC (rev 1455)
+++ trunk/release-notes.txt 2009-03-02 15:20:39 UTC (rev 1456)
@@ -10,9 +10,11 @@
- for messages sent to itself, the sender is 'self' now,
and not the agent's name as in previous releases
+
New internal actions
- .puts: used for printing messages to the console (based on Ruby
similar method). Developed by Felipe Meneguzzi.
+- .all_names: get the name of all agentes in the system.
Changes in internal actions
- .relevant_plans has a third argument that gets the labels
Modified: trunk/src/jason/infra/centralised/CentralisedRuntimeServices.java
===================================================================
--- trunk/src/jason/infra/centralised/CentralisedRuntimeServices.java 2009-02-27 08:11:39 UTC (rev 1455)
+++ trunk/src/jason/infra/centralised/CentralisedRuntimeServices.java 2009-03-02 15:20:39 UTC (rev 1456)
@@ -78,12 +78,6 @@
return masRunner.getAgs().keySet();
}
- /** @deprecated use getAgentsNames() */
- public Set<String> getAgentsName() {
- return getAgentsNames();
- }
-
-
public int getAgentsQty() {
return masRunner.getAgs().keySet().size();
}
Modified: trunk/src/jason/infra/jade/JadeRuntimeServices.java
===================================================================
--- trunk/src/jason/infra/jade/JadeRuntimeServices.java 2009-02-27 08:11:39 UTC (rev 1455)
+++ trunk/src/jason/infra/jade/JadeRuntimeServices.java 2009-03-02 15:20:39 UTC (rev 1456)
@@ -98,11 +98,6 @@
return null;
}
- /** @deprecated use getAgentsNames() */
- public Set<String> getAgentsName() {
- return getAgentsNames();
- }
-
public int getAgentsQty() {
try {
return getAgentsNames().size();
Modified: trunk/src/jason/infra/saci/SaciRuntimeServices.java
===================================================================
--- trunk/src/jason/infra/saci/SaciRuntimeServices.java 2009-02-27 08:11:39 UTC (rev 1455)
+++ trunk/src/jason/infra/saci/SaciRuntimeServices.java 2009-03-02 15:20:39 UTC (rev 1456)
@@ -94,12 +94,6 @@
return null;
}
- /** @deprecated use getAgentsNames() */
- public Set<String> getAgentsName() {
- return getAgentsNames();
- }
-
-
public int getAgentsQty() {
try {
return facilitator.getAgQty() - 3; // do not include controller,
Modified: trunk/src/jason/runtime/RuntimeServicesInfraTier.java
===================================================================
--- trunk/src/jason/runtime/RuntimeServicesInfraTier.java 2009-02-27 08:11:39 UTC (rev 1455)
+++ trunk/src/jason/runtime/RuntimeServicesInfraTier.java 2009-03-02 15:20:39 UTC (rev 1456)
@@ -47,9 +47,6 @@
/** Returns a set of all agents' name */
public Set<String> getAgentsNames();
- /** @deprecated use getAgentsNames */
- public Set<String> getAgentsName();
-
/** Gets the number of agents in the MAS. */
public int getAgentsQty();
Added: trunk/src/jason/stdlib/all_names.java
===================================================================
--- trunk/src/jason/stdlib/all_names.java (rev 0)
+++ trunk/src/jason/stdlib/all_names.java 2009-03-02 15:20:39 UTC (rev 1456)
@@ -0,0 +1,71 @@
+//----------------------------------------------------------------------------
+// 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 jason.asSemantics.DefaultInternalAction;
+import jason.asSemantics.TransitionSystem;
+import jason.asSemantics.Unifier;
+import jason.asSyntax.Atom;
+import jason.asSyntax.ListTerm;
+import jason.asSyntax.ListTermImpl;
+import jason.asSyntax.Term;
+import jason.runtime.RuntimeServicesInfraTier;
+
+/**
+ <p>Internal action: <b><code>.all_names</code></b>.
+
+ <p>Description: get the names of all agents in the system.
+ This identification is given by the runtime
+ infrastructure of the system (centralised, saci, jade, ...)
+
+ <p>Parameters:<ul>
+ <li>+/- names (list).<br/>
+ </ul>
+
+ <p>Examples:<ul>
+
+ <li> <code>.all_names(L)</code>: unifies with L a list of all agents in the system.</li>
+
+ </ul>
+
+ @see jason.stdlib.my_name
+ @see jason.runtime.RuntimeServicesInfraTier
+*/
+public class all_names extends DefaultInternalAction {
+
+ @Override public int getMinArgs() { return 1; }
+ @Override public int getMaxArgs() { return 1; }
+
+ @Override
+ public Object execute(TransitionSystem ts, Unifier un, Term[] args) throws Exception {
+ checkArguments(args);
+ RuntimeServicesInfraTier rs = ts.getUserAgArch().getArchInfraTier().getRuntimeServices();
+ ListTerm ln = new ListTermImpl();
+ ListTerm tail = ln;
+ for (String a: rs.getAgentsNames()) {
+ tail = tail.append(new Atom(a));
+ }
+ return un.unifies(args[0], ln);
+ }
+}
Modified: trunk/src/jason/stdlib/create_agent.java
===================================================================
--- trunk/src/jason/stdlib/create_agent.java 2009-02-27 08:11:39 UTC (rev 1455)
+++ trunk/src/jason/stdlib/create_agent.java 2009-03-02 15:20:39 UTC (rev 1456)
@@ -41,7 +41,7 @@
<p>Parameters:<ul>
- <li>+ name (atom): the name for the new agent.<br/>
+ <li>+ name (atom or string): the name for the new agent.<br/>
<li>+ source (string): path to the file where the AgentSpeak code
for the new agent can be found.<br/>
Modified: trunk/src/jason/stdlib/my_name.java
===================================================================
--- trunk/src/jason/stdlib/my_name.java 2009-02-27 08:11:39 UTC (rev 1455)
+++ trunk/src/jason/stdlib/my_name.java 2009-03-02 15:20:39 UTC (rev 1456)
@@ -55,6 +55,8 @@
@see jason.stdlib.send
@see jason.stdlib.broadcast
+ @see jason.stdlib.all_names
+
*/
public class my_name extends DefaultInternalAction {
Modified: trunk/src/jason/stdlib/package.html
===================================================================
--- trunk/src/jason/stdlib/package.html 2009-02-27 08:11:39 UTC (rev 1455)
+++ trunk/src/jason/stdlib/package.html 2009-03-02 15:20:39 UTC (rev 1456)
@@ -50,6 +50,7 @@
<li>{@link jason.stdlib.send send}: send messages. </li>
<li>{@link jason.stdlib.broadcast broadcast}: broadcast messages.</li>
<li>{@link jason.stdlib.my_name my_name}: get the agent's name.</li>
+ <li>{@link jason.stdlib.all_names all_names}: get the names of all agents in the system.</li>
</ul>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|