我想开始在 Eclipse 中编写 JADE。为此,我添加了Java 代理开发框架 - Eclipse 和 Maven 集成提供的以下脚本。
我做了一个代理:
public class Test extends Agent {
private static final long serialVersionUID = 1L;
String nickname = "Peter";
AID id = new AID(nickname, AID.ISLOCALNAME);
protected void setup() {
// Printout a welcome message
System.out.println("Hello! Buyer-agent " +getAID().getName()+ " is ready.");
}
}
Run Code Online (Sandbox Code Playgroud)
当我使用以下参数运行 JadeBootThread.run() 时:
private final String ACTOR_NAMES_args = "buyer:test.Test";
private final String GUI_args = "-gui";
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
public class Test extends Agent {
private static final long serialVersionUID = 1L;
String nickname = "Peter";
AID id = new AID(nickname, AID.ISLOCALNAME);
protected void setup() {
// Printout a welcome message
System.out.println("Hello! Buyer-agent " +getAID().getName()+ " is ready.");
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试搞乱 private Final String GUI_args = "-gui"; 参数并添加“-local-port 1111”,但这给出了完全相同的错误(错误中的端口也保持为 1099)
在 eclipse 中将代码作为参数运行时添加以下内容
-gui -host 192.168.2.9 -port 12344
agentttt:com.DAO.test_agents.PingAgent
Run Code Online (Sandbox Code Playgroud)
然后将主类命名为
jade.Boot
Run Code Online (Sandbox Code Playgroud)
然后只需运行添加了所有外部 jar 文件的代码,我想这不会给出任何 ICP 错误。
| 归档时间: |
|
| 查看次数: |
11565 次 |
| 最近记录: |