我必须编写一个多代理系统,但我不知道如何将agent.java与GUI集成,这次我尝试创建一个Hello World代理界面,但我无法在它们之间集成,这是我的 TestJADE.class
package testjade;
import jade.core.Agent;
public class TestJADE extends Agent {
private static final long serialVersionUID = 1L;
protected void setup() {
System.out.println("Hello Jade!");
System.out.println("I'm the first Agent with you!");
}
}
这是我的按钮操作代码
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
TestJADE agent = new TestJADE();
agent.setup();
}
这是正确的方法吗?请帮助我:(
最佳答案
您的 GUI 必须与代理关联。为此,代理必须扩展 AgentGui 类。 在 Jade 平台中,要创建代理,您不需要使用“新 key ”一词。您必须调用ContainerController 类的createNewAgent 方法。
关于java - 将 java GUI 与代理应用程序集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35582056/