Hi There,
I‘m new to agent-oriented programming and just started to explore SARL. My goal is similar to Marcos. I also started with the PingPongSpace Example from the Tutorial. I then tried to separate the BootAgent into two new Boot Agents. One should start the PingAgent, the other one should start the Pong Agent. I used the same code from the original BootAgent, but had only one spawn call in it. And I defined a hard coded UUID with which I created the comspace.
What I find irritating is, that when I start the PingAgent, it founds the PongAgent. Although it is not started yet. Meaning the if (comspace.participants.size > 1) ist true. When I then start the PongAgent it creates a new comspace. So there is no communication between the two agents. In debug mode the comspace ids look like this:
comspace EventSpaceImpl (id=384)
comspace EventSpaceImpl (id=381)
Where am I wrong? What is a proper way to do this? BTW, an example of network communication in the tutorial section of the documentation would be nice.
I‘m using eclipse SARL Version: 0.8.6
Thanks and best regards
Marko
Hello,
I created a new world space in the inner context of an Agent with this code :
this.worldSpace = innerContext.getOrCreateSpaceWithID(OpenEventSpaceSpecification, uid)
this.worldSpace.register(asEventListener)
then, I try to add an Agent to this new space with that code (the Agent was not created in the innerContext):
val worldSpace = worldContext.getOrCreateSpaceWithSpec(OpenEventSpaceSpecification, worldSpaceIaD)
worldSpace.register(asEventListener)
(I verified that the contextID and the spaceID are the same, and it is the case)
But the first Agent seems to never receive the MemberJoined event.
Is it normal ? Did I do something wrong ?
Finally, I am not sure if it was the problem...
I complete the information with some logs, maybe it could help...
this.worldSpace = innerContext.getOrCreateSpaceWithID(OpenEventSpaceSpecification, uid)
this.worldSpace.register(asEventListener)
[INFO, 9:41:37am, Janus SRE] Space SpaceID [
type = "SpaceID"
id = 15029ea2-0c1b-437b-b4ce-9ef4b94744dc
contextID = 005a4b66-cde2-4af5-8570-0adf92c3246d
spaceSpec = interface io.sarl.util.OpenEventSpaceSpecification
] is created
info("Joining the World organisation: " + occurrence.spaceID + " (" + occurrence.context + ").")
val worldContext = occurrence.context
val worldSpaceID = occurrence.spaceID
val worldSpace = worldContext.getOrCreateSpaceWithID(OpenEventSpaceSpecification, worldSpaceID)
worldSpace.register(asEventListener)
[INFO, 9:41:37am, VirtualPedestrian-b087b4b7-8c67-4e40-b856-98c3697da5a2] Joining the World organisation: 15029ea2-0c1b-437b-b4ce-9ef4b94744dc (005a4b66-cde2-4af5-8570-0adf92c3246d).
Do you find something wrong ?
getOrCreateSpaceWithID
for the second time as nothing is displayed and if I change the ID, something appends Space SpaceID [...] is created
.
Hi, I am new to Sarl and just tried to set up Sarl in Eclipse with Maven. The Eclipse Download from the Website did not work, when launching Eclipse.app I receive an error message, that an error has occurred after choosing the working directory (macOS)
I followed all the steps from the tutorial and just tried to set up a launch configuration in eclipse. I have Janus added as a dependency, and had maven update the project, but I cannot add the Janus Library to the launch config. I would be really grateful for help. Thank you!