jacamo-lang/jacamo

Problem with distributed workspace

Opened this issue · 5 comments

I've run the code which was provided in the Hello World tut (part V) in order to see how JaCaMo would behave when distributing workspace across multiple nodes. However, none of the agents in the america project were able to join the jacamo remote workspace:

CArtAgO Http Server running on http://192.168.30.204:3276
[JaCaMoLauncher] Workspace usa created.
[JaCaMoLauncher] artifact gui: display.GUIConsole("USA") at usa created.
[JaCaMoLauncher] Workspace brazil created.
[JaCaMoLauncher] artifact gui: display.GUIConsole("Brazil") at brazil created.
Jason Http Server running on http://192.168.30.204:3277
Looking for rmi://localhost/cartago_node
Looking for rmi://localhost/cartago_node
[CAgentArch] Op joinRemoteWorkspace(jacamo,"localhost",I) on artifact null(artifact_name= null) by maria failed - op: joinRemoteWorkspace(jacamo,"localhost",I)
[CAgentArch] Op joinRemoteWorkspace(jacamo,"localhost",I) on artifact null(artifact_name= null) by alice failed - op: joinRemoteWorkspace(jacamo,"localhost",I)
[CAgentArch] Op joinRemoteWorkspace(jacamo,"localhost",I) on artifact null(artifact_name= null) by maria failed - op: joinRemoteWorkspace(jacamo,"localhost",I)
[CAgentArch] Op joinRemoteWorkspace(jacamo,"localhost",I) on artifact null(artifact_name= null) by alice failed - op: joinRemoteWorkspace(jacamo,"localhost",I)
[CAgentArch] Op joinRemoteWorkspace(jacamo,"localhost",I) on artifact null(artifact_name= null) by maria failed - op: joinRemoteWorkspace(jacamo,"localhost",I)
[CAgentArch] Op joinRemoteWorkspace(jacamo,"localhost",I) on artifact null(artifact_name= null) by alice failed - op: joinRemoteWorkspace(jacamo,"localhost",I)
[maria] Error focusing on environment artifact art_env(jacamo,"localhost","")
[alice] Error focusing on environment artifact art_env(jacamo,"localhost","")
[CAgentArch] Op joinRemoteWorkspace(jacamo,"localhost",I) on artifact null(artifact_name= null) by alice failed - op: joinRemoteWorkspace(jacamo,"localhost",I)
[CAgentArch] Op joinRemoteWorkspace(jacamo,"localhost",I) on artifact null(artifact_name= null) by maria failed - op: joinRemoteWorkspace(jacamo,"localhost",I)
[CAgentArch] Op joinRemoteWorkspace(jacamo,"localhost",I) on artifact null(artifact_name= null) by alice failed - op: joinRemoteWorkspace(jacamo,"localhost",I)
[CAgentArch] Op joinRemoteWorkspace(jacamo,"localhost",I) on artifact null(artifact_name= null) by maria failed - op: joinRemoteWorkspace(jacamo,"localhost",I)
[CAgentArch] Op joinRemoteWorkspace(jacamo,"localhost",I) on artifact null(artifact_name= null) by alice failed - op: joinRemoteWorkspace(jacamo,"localhost",I)
[CAgentArch] Op joinRemoteWorkspace(jacamo,"localhost",I) on artifact null(artifact_name= null) by maria failed - op: joinRemoteWorkspace(jacamo,"localhost",I)
[alice] Error focusing on environment artifact art_env(jacamo,"localhost",gui)
[maria] Error focusing on environment artifact art_env(jacamo,"localhost",gui)
[alice] playing rs in hello_org.jacamo_team
[maria] playing rl in hello_org.jacamo_team
[alice] I am obliged to commit to print_special_chars on hello_eng... doing so
[maria] I am obliged to commit to print_l on hello_eng... doing so
[maria] No fail event was generated for +!print_l1[scheme(hello_eng),source(self)]
[maria] Found a goal for which there is no applicable plan:+!print_l1[scheme(hello_eng),source(self)]

As can be seen, both nodes are running on localhost and the group was formed correctly. Is there anything I can do to make this work? Is this a bug?

Cheers.

Hi,

I ran into a similar problem.
Doing a clean install of the latest version of JaCaMo worked for me, at least when running locally.
I believe there is a bug when running distributed, where agents are able to connect to remote workspaces but hang when trying to run an operation on a remote artefact.

Using direct commands from c4jason fixed for me.
You can create the remote workspace and artefacts as usual in the server's jcm, but on the client the agents have to connect manually, using the joinRemoteWorkspace(name,ip,id) internal action.

Cheers.

Thanks, @rafaelcaue ! I did exactly as you told and it finally worked as expected!

Just to let you know, I also had to focus on the organisational artefact and adopt roles manually so that things could work correctly. As can be seen in the output I pasted before, the formation was ok but maria and alice couldn't find plans for their goals for some reason. I only got it working when I followed @rafaelcaue 's advice (again) of doing things manually in the agent script.

Hi guys,
i've the same problem of @igorcadelima:
the master's jcm is this:

mas cartante {
agent cart:cartante.asl{
join: bingo
focus: bingo.gui
}
workspace bingo {
artifact gui: bingo.Tabella()
}
asl-path: src/agt
src/agt/inc
platform: cartago("infrastructure")
}

the "slave's" jcm is:

mas bingo_artifact {
agent marcello : player.asl{

	focus: bingo.gui @ cartante
}

platform: cartago()

node cartante running @ ip-master
asl-path: src/agt
          src/agt/inc

}
I've also tried to add in "player.asl" the code:
"joinRemoteWorkspace(bingo,"ip-master",Id)" as suggested by @rafaelcaue but, for the two cases, when i run the two jcm in the same PC, it works, conversely, when I run the jcm in two different PC, in the console of the jcm "slave" I check this:

CArtAgO Http Server running on http://[ip-slave]:3273
Jason Http Server running on http://[ip-slave]:3272

and in debug modality, selection the agent Marcello (section Action):
1 | joinRemoteWorkspace(bingo,"ip-master",Id) | false | 1

the String "ip-master" and "ip-slave" correspond to the real ip

Can Jacamo be started headlessly - without the GUIs?

Can Jacamo be started headlessly - without the GUIs?

Yes. You can change the log handler on logging.properties file.