2016-02-23 41 views
0

我必須編寫一個多代理程序系統,並且我不知道如何將agent.java與GUI集成,在這段時間內,我嘗試創建一個Hello World代理程序接口,但是我無法「T它們之間整合,這是我的TestJADE.class將Java GUI與代理程序集成在一起

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

這是做正確的方式??,請幫助我:(

回答

1

您的GUI必須爲與代理商交往。爲此,代理必須擴展AgentGui Class。 在Jade平臺中,要創建一個代理,您不要使用new key這個詞。您必須調用createNewAgent ContainerController類的方法。

相關問題