Closed lcpz closed 7 years ago
This also happens with user-defined internal actions which create agents:
bob.asl
!start.
+!start
<-
.print("creating a workspace");
createWorkspace("wsp");
joinWorkspace("wsp", _);
jia.create_carl. // 'noenv' error
//.create_agent(carl, "carl.asl"). // this works
src/jia/create_carl.java
// [...]
public class create_carl extends DefaultInternalAction {
@Override
public Object execute(TransitionSystem ts, Unifier un, Term[] args) throws Exception {
RuntimeServicesInfraTier rs = ts.getUserAgArch().getRuntimeServices();
rs.createAgent("carl", "carl.asl", null, null, null, null, ts.getAg());
rs.startAgent("carl");
return true;
}
}
Variant project: example3.zip
Hi, thanks again for reporting the bug and providing the example (that simplifies a lot our testing). It will be fixed in the next release of jacamo. Meanwhile, you can solve it by calling createAgent as follows:
...
List<String> archs = new ArrayList<String>();
archs.add("jaca.CAgentArch");
archs.add("jacamo.infra.JaCaMoAgArch");
rs.createAgent("carl", "carl.asl", null, archs, null, null, ts.getAg());
I confirm it works in both test cases, thanks.
I've set archs
as a one-liner in the class like this:
public static List<String> archs = new ArrayList<String>(Arrays.asList("jaca.CAgentArch", "jacamo.infra.JaCaMoAgArch"));
REDACTED: This is more general than I thought, so I made my post concise.
I've encountered an issue related to #7. My test case is:
bob
creates a workspacewsp
and an artifactart
;art
creates agentcarl
, which wants to joinwsp
.But
carl
fails to do so because of a "noenv" error.Following are the full listings.
example.jcm
bob.asl
carl.asl
src/env/example/Test.java
Console output:
I also attach the related project: example2.zip
What am I doing wrong? Thanks in advance.