0
我想註冊varios代理,並使用此代碼。向DF註冊代理時出錯
的錯誤是:jade.domain.FIPAAgentManagement.MissingParameter:(缺少參數DF-Agent的描述名稱)
如何修正這個錯誤?
感謝
的clases
public class Main {
public static void main(String[] args) {
String[] services = {"-gui"};
Boot.main(services);
Agent1 = new Agent1(0,0,"a");
}
}
public class Agent1 extends Agent{
public Agent1(int x, int y, String name) {
super(x, y, name);
setup();
}
protected void setup(){
System.out.println("hi");
ServiceDescription sd = new ServiceDescription();
sd.setType("buyer");
sd.setName("asa");
register(sd);
}
void register(ServiceDescription sd){
DFAgentDescription dfd = new DFAgentDescription();
dfd.setName(getAID());
dfd.addServices(sd);
try {
DFService.register(this, dfd);
}
catch (FIPAException fe) { fe.printStackTrace(); }
}
protected void takeDown(){
System.out.println("bye");
}
}