Мобильность промежуточного ПО JADE

Я работаю с JADE (среда разработки Java-агентов) и пытаюсь написать поведение, которое заставляет агента перемещаться из контейнера в другой. Я попробовал эту команду:

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

но похоже у меня сбой в движении:

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

Будет лучше, если я получу исходный код для полного поведения.
Заранее спасибо


person steevn    schedule 10.02.2015    source источник
comment
В чем провал? Вашу проблему трудно диагностировать без дополнительной информации   -  person Avery    schedule 10.02.2015
comment
это показанная ошибка: jade.core.mobility.AgentMobilityService$CommandSourceSink handleInformMoved Grave: протокол мобильности не поддерживается. Прерывание передачи   -  person steevn    schedule 17.02.2015


Ответы (1)


это код для запуска нефритовой платформы:

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();
    }
}

А это код мобильного агента. После создания агент сразу перемещается в контейнер 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();
    }
}
person AyouB    schedule 04.03.2015
comment
все еще есть та же проблема, я не знаю точно, где проблема, может быть, в самой моей платформе, в любом случае, спасибо, мистер Аюб. - person steevn; 05.03.2015