0

I am working with JADE ( Java Agent Development framework), and I am trying to write a behavior which makes an agent moving from container to another. I tried this command:

public void action() {
  ACLMessage msg = myAgent.receive(template); 
  if (msg != null) {
      moveRequest = msg; 
      String destination = 
      doMove(new ContainerID(destination, null));
  }
  else {
    block();
  }
}

but it seems that I have a failure in moving:

jade.core.mobility.AgentMobilityService$CommandSourceSink handleInformMoved Grave: Mobility protocol not supported. Aborting transfer

It will be better if I get the source code for a complete behavior.
Thanks in advance

Avery
  • 2,270
  • 4
  • 33
  • 35
steevn
  • 242
  • 2
  • 8
  • What is the failure? Your problem is difficult to diagnose without more information – Avery Feb 10 '15 at 17:47
  • this is the failure shown : jade.core.mobility.AgentMobilityService$CommandSourceSink handleInformMoved Grave: Mobility protocol not supported. Aborting transfer – steevn Feb 17 '15 at 11:04

1 Answers1

1

this is the code to start the jade platform:

import jade.core.Profile;
import jade.core.ProfileImpl;
import jade.core.Runtime;
import jade.wrapper.AgentContainer;
import jade.wrapper.AgentController;


public class Run {

    public Run() {
        Runtime rt = Runtime.instance();
        rt.setCloseVM(true);
        AgentContainer mc = rt.createMainContainer(new ProfileImpl());

        Profile p = new ProfileImpl();
        p.setParameter("container-name", "Foo");
        AgentContainer ac = rt.createAgentContainer(p);

        try{
            AgentController rma = mc.createNewAgent("rma", "jade.tools.rma.rma", null);
            rma.start();
            AgentController ma = mc.createNewAgent("MA", "MobileAgent", null);
            ma.start();
        }
        catch(Exception e){
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        new Run();
    }
}

And this is the code for the mobile agent. After being created, the agent moves immediately to the container Foo.

import jade.core.Agent;
import jade.core.Location;

public class MobileAgent extends Agent {

    private static final long serialVersionUID = 1L;

    @Override
    protected void setup() {
        System.out.println("Hello World");
        Location destination = new jade.core.ContainerID("Foo", null);
        doMove(destination);
        super.setup();
    }

    @Override
    protected void beforeMove() {
        System.out.println("Preparing to move");
        super.beforeMove();
    }

    @Override
    protected void afterMove() {
        System.out.println("Arrived to destination");
        super.afterMove();
    }
}
abc
  • 21
  • 3
  • still have the same problem, i don't know exactly where the problem is, may be in my plateforme itself, anyway thanks Mr Ayoub – steevn Mar 04 '15 at 22:16