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

📄 zeus_container_transport.java

📁 人工智能中Agent开发包。多 Agent 系统是处理自治 Agent 之间知识层的协作问题
💻 JAVA
字号:
/** property of BTexact Communications
Not for public use or disclosure. 
Research product only.

*/
package zeus.actors.outtrays;

import javax.agent.service.*; 
import javax.agent.*; 
import FIPA.*; 
import zeus.concepts.*;
import zeus.actors.*;

/** 
    implementation of the OutTray interface that is used 
when two agents in the same container attempt to communicate
    */
public class Zeus_Container_Transport implements OutTray { 
        
        
    private ZeusAgentContext context = null;    
//    private ContainerCommunicationIn otherAgent = null;    

     
    public Zeus_Container_Transport (ZeusAgentContext context) { 
         this.context = context;
    }
    
        
        
   public void send  (Object obj) throws UnsuitableMessageException { 
    try { 
        Performative  perf = (Performative) obj; 
     // 	otherAgent.message(perf); 
 
        } catch (ClassCastException cce) { 
            throw new UnsuitableMessageException ("Must be Performative to work with this transport"); 
        }catch (Exception e) { 
            e.printStackTrace(); 
            throw new UnsuitableMessageException ("Bad message in send() - unknown problem, Excepiton printed to sout"); 
    
    }
    }
        
        
        
   public void send (Performative perf) { 
	try {
	    	//otherAgent.message(perf);}
                ;
                }
	catch (Throwable tr) {
		tr.printStackTrace(); 
		System.out.println("Error in local container class");}
   }
   
        
   public void send (javax.agent.Envelope env) { 
    try {
        // very risky - is the object a performative, probably not.....
        Performative perf = (Performative) env.getObject(); 
      //  otherAgent.messsage(perf);
    }
       catch (ClassCastException cce) { 
        cce.printStackTrace(); 
        return; }
	catch (Throwable tr) {
		tr.printStackTrace();
		System.out.println("Error in local container class");}
        
   }
   
   
   
 }

⌨️ 快捷键说明

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