|
From: <jom...@us...> - 2009-02-13 13:07:53
|
Revision: 1442
http://jason.svn.sourceforge.net/jason/?rev=1442&view=rev
Author: jomifred
Date: 2009-02-13 13:07:48 +0000 (Fri, 13 Feb 2009)
Log Message:
-----------
allows the agent's name in .create_agent to be a string
Modified Paths:
--------------
trunk/doc/mini-tutorial/src/getting-started/VacuumCleaning-1/vc.asl
trunk/src/jason/stdlib/create_agent.java
Modified: trunk/doc/mini-tutorial/src/getting-started/VacuumCleaning-1/vc.asl
===================================================================
--- trunk/doc/mini-tutorial/src/getting-started/VacuumCleaning-1/vc.asl 2009-02-13 11:29:23 UTC (rev 1441)
+++ trunk/doc/mini-tutorial/src/getting-started/VacuumCleaning-1/vc.asl 2009-02-13 13:07:48 UTC (rev 1442)
@@ -1,7 +1,7 @@
/*
-Very simple vaccum cleaner agent in a world that has only four locations.
+Very simple vacuum cleaner agent in a world that has only four locations.
Perceptions:
. dirty: the current location has dirty
@@ -15,5 +15,3 @@
*/
// TODO: the code of the agent
-
-
Modified: trunk/src/jason/stdlib/create_agent.java
===================================================================
--- trunk/src/jason/stdlib/create_agent.java 2009-02-13 11:29:23 UTC (rev 1441)
+++ trunk/src/jason/stdlib/create_agent.java 2009-02-13 13:07:48 UTC (rev 1442)
@@ -97,7 +97,12 @@
public Object execute(TransitionSystem ts, Unifier un, Term[] args) throws Exception {
checkArguments(args);
- Term name = args[0];
+ String name;
+ if (args[0].isString())
+ name = ((StringTerm)args[0]).getString();
+ else
+ name = args[0].toString();
+
StringTerm source = (StringTerm)args[1];
File fSource = new File(source.getString());
@@ -126,7 +131,7 @@
}
RuntimeServicesInfraTier rs = ts.getUserAgArch().getArchInfraTier().getRuntimeServices();
- return rs.createAgent(name.toString(), fSource.getAbsolutePath(), agClass, agArchClass, bbPars, ts.getSettings());
+ return rs.createAgent(name, fSource.getAbsolutePath(), agClass, agArchClass, bbPars, ts.getSettings());
}
private Structure testString(Term t) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|