⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jadejessagent.java

📁 JADE(JAVA Agent开发框架)是一个完全由JAVA语言开发的软件,它简化了多Agent系统的实现。
💻 JAVA
字号:
// Oliver Hoffmann 10 May 2001 oliver@hoffmann.org
// in collaboration with Fabio Bellifemine and Ernest Friedmann-Hill
package examples.JadeJessProtege;
import jess.*;
import jade.core.*;

public class JadeJessAgent extends jade.core.Agent // shows how Protege, JESS and JADE can be combined
  {
  private Rete jess;
  public Rete getRete ()
    {
    return jess;
    }
  public void setArguments(String arguments[]) // get the first argument passed to this Agent as the key to get the Rete engine
    {
	  jess = JessHashtable.getRete(arguments[0]); // JESS should have stored a java pointer to itself there
    } // end setArguments method
  protected void setup() // is called when agent is started
    {
	  System.err.println("JadeJessAgent: jess: "+jess);
  	if (jess == null)
  	  {
  	  System.err.println("JadeJessAgent: no JESS engine provided, will make a new one");
      jess = new Rete();
  		}
    try
      {
      jess.store("AGENT",this);
    	jess.executeCommand("(assert (Agent (fetch AGENT)))");
      }
    catch (Exception exception)
      {
      exception.printStackTrace();
      }
    try
      {
      addBehaviour(new JadeJessBehaviour(this));
      }
    catch (Exception exception)
      {
      exception.printStackTrace();
      }
    } // end setup method
  } // end JadeJessAgent class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -