亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mobileagent.java

?? JADE(JAVA Agent開發框架)是一個完全由JAVA語言開發的軟件,它簡化了多Agent系統的實現。
?? JAVA
字號:
/*****************************************************************
JADE - Java Agent DEvelopment Framework is a framework to develop 
multi-agent systems in compliance with the FIPA specifications.
Copyright (C) 2000 CSELT S.p.A. 

GNU Lesser General Public License

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, 
version 2.1 of the License. 

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA  02111-1307, USA.
*****************************************************************/

package examples.mobile;

import java.util.Vector;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Iterator;
import jade.core.*;
import jade.core.behaviours.*;

import jade.domain.mobility.*;
import jade.domain.FIPANames;
import jade.content.lang.Codec;
import jade.content.lang.sl.SLCodec;

import jade.gui.GuiAgent;
import jade.gui.GuiEvent;

import jade.lang.acl.ACLMessage;
import jade.lang.acl.MessageTemplate;


/**
This is an example of mobile agent. 
This class contains the resources used by the agent behaviours: the counter, 
the 
flag cntEnabled, and the list of visited locations. 
At the setup it creates a gui and adds behaviours to: get the list of
available locations from AMS, serve the incoming messages, and
to increment the counter. 
In particular, notice the usage of the two methods <code>beforeMove()</code> and
<code>afterMove()</code> to execute some application-specific tasks just before and just after
the agent migration takes effect.

Because this agent has a GUI, it extends the class GuiAgent that, in turn,
extends the class Agent. Being the GUI a different thread, the communication
between the agent and its GUI is based on event passing.
@see jade.gui.GuiAgent
@author Giovanni Caire - CSELT S.p.A
@version $Date: 2004-08-20 12:15:13 +0200 (ven, 20 ago 2004) $ $Revision: 5283 $
*/
public class MobileAgent extends GuiAgent {
  int     cnt;   // this is the counter
  public boolean cntEnabled;  // this flag indicates if counting is enabled
  transient protected MobileAgentGui gui;  // this is the gui
  Location nextSite;  // this variable holds the destination site

  // These constants are used by the Gui to post Events to the Agent
  public static final int EXIT = 1000;
  public static final int MOVE_EVENT = 1001;
  public static final int STOP_EVENT = 1002;
  public static final int CONTINUE_EVENT = 1003;
  public static final int REFRESH_EVENT = 1004;
  public static final int CLONE_EVENT = 1005;

  // this vector contains the list of visited locations
  Vector visitedLocations = new Vector();

  public void setup() {
	  // register the SL0 content language
	  getContentManager().registerLanguage(new SLCodec(), FIPANames.ContentLanguage.FIPA_SL0);
	  // register the mobility ontology
	  getContentManager().registerOntology(MobilityOntology.getInstance());

	  // creates and shows the GUI
	  gui = new MobileAgentGui(this);
	  gui.setVisible(true); 

	  // get the list of available locations and show it in the GUI
	  addBehaviour(new GetAvailableLocationsBehaviour(this));

	  // initialize the counter and the flag
	  cnt = 0;
	  cntEnabled = true;

	  ///////////////////////
	  // Add agent behaviours to increment the counter and serve
	  // incoming messages
	  Behaviour b1 = new CounterBehaviour(this);
	  addBehaviour(b1);	
	  Behaviour b2 = new ServeIncomingMessagesBehaviour(this);
	  addBehaviour(b2);	
	}

	public void takeDown() {
	  if (gui!=null) {
            gui.dispose();
	    gui.setVisible(false);
	  }
          System.out.println(getLocalName()+" is now shutting down.");
	}

  /**
   * This method stops the counter by disabling the flag
   */
   void stopCounter(){
    cntEnabled = false;
   }

  /**
   * This method resume counting by enabling the flag
   */
   void continueCounter(){
     cntEnabled = true;
   }

  /**
   * This method displays the counter in the GUI
   */
   void displayCounter(){
     gui.displayCounter(cnt);
   }
  
   
protected void beforeClone() {
  System.out.println(getLocalName()+" is now cloning itself.");
}

protected void afterClone() {
  System.out.println(getLocalName()+" has cloned itself.");
  afterMove();
}
  /**
   * This method is executed just before moving the agent to another
   * location. It is automatically called by the JADE framework.
   * It disposes the GUI and prints a bye message on the standard output.
   */
	protected void beforeMove() 
	{
		gui.dispose();
		gui.setVisible(false);
		System.out.println(getLocalName()+" is now moving elsewhere.");
	}

  /**
   * This method is executed as soon as the agent arrives to the new 
   * destination.
   * It creates a new GUI and sets the list of visited locations and
   * the list of available locations (via the behaviour) in the GUI.
   */
   protected void afterMove() {
     System.out.println(getLocalName()+" is just arrived to this location.");
     // creates and shows the GUI
     gui = new MobileAgentGui(this);
     //if the migration is via RMA the variable nextSite can be null.
     if(nextSite != null)
     {
     	visitedLocations.addElement(nextSite);
      for (int i=0; i<visitedLocations.size(); i++)
        gui.addVisitedSite((Location)visitedLocations.elementAt(i));
     }
     gui.setVisible(true); 	
			
     // Register again SL0 content language and JADE mobility ontology,
     // since they don't migrate.
     getContentManager().registerLanguage(new SLCodec(), FIPANames.ContentLanguage.FIPA_SL0);
	 getContentManager().registerOntology(MobilityOntology.getInstance());
     // get the list of available locations from the AMS.
     // FIXME. This list might be stored in the Agent and migrates with it.
     addBehaviour(new GetAvailableLocationsBehaviour(this));
   }

  public void afterLoad() {
      afterClone();
  }

  public void beforeFreeze() {
      beforeMove();
  }

  public void afterThaw() {
      afterMove();
  }

  public void beforeReload() {
      beforeMove();
  }

  public void afterReload() {
      afterMove();
  }


	/////////////////////////////////
	// GUI HANDLING
		

	// AGENT OPERATIONS FOLLOWING GUI EVENTS
	protected void onGuiEvent(GuiEvent ev)
	{
		switch(ev.getType()) 
		{
		case EXIT:
			gui.dispose();
			gui = null;
			doDelete();
			break;
		case MOVE_EVENT:
      Iterator moveParameters = ev.getAllParameter();
      nextSite =(Location)moveParameters.next();
			doMove(nextSite);
			break;
		case CLONE_EVENT:
			Iterator cloneParameters = ev.getAllParameter();
			nextSite =(Location)cloneParameters.next();
			doClone(nextSite,"clone"+cnt+"of"+getName());
			break;
   	case STOP_EVENT:
		  stopCounter();
		  break;
		case CONTINUE_EVENT:
		  continueCounter();
		  break;
		case REFRESH_EVENT:
		  addBehaviour(new GetAvailableLocationsBehaviour(this));
		  break;
		}

	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
2014亚洲片线观看视频免费| 国产精品三级av| 国产一区二区精品久久99| 欧美一区二区三区的| 一区二区三区在线高清| 欧美日韩免费电影| 极品美女销魂一区二区三区| 国产日韩视频一区二区三区| 91视频xxxx| 偷窥少妇高潮呻吟av久久免费| 7777精品伊人久久久大香线蕉超级流畅 | 久久精品国产**网站演员| 亚洲国产高清aⅴ视频| 欧美日韩在线不卡| 久久97超碰国产精品超碰| 国产精品欧美经典| 欧美一级二级在线观看| 国产99久久久精品| 同产精品九九九| 国产精品不卡在线观看| 精品国产91乱码一区二区三区 | 日韩中文字幕91| 亚洲免费观看视频| 精品国产亚洲在线| 91麻豆国产在线观看| 久99久精品视频免费观看| 一区二区三区久久| 亚洲日本电影在线| 国产精品丝袜黑色高跟| 国产欧美久久久精品影院 | 91美女片黄在线观看91美女| 国产一区二区在线观看免费 | 精品成人私密视频| 久久精品一区二区三区不卡牛牛| 精品国产污网站| 欧美体内she精视频| a在线欧美一区| 一本一道久久a久久精品| 国产一区二区在线看| 国模无码大尺度一区二区三区| 奇米精品一区二区三区在线观看 | 男人的天堂亚洲一区| 亚洲成人午夜影院| 日本美女一区二区三区视频| 天堂精品中文字幕在线| 麻豆精品蜜桃视频网站| 国产一区二区三区在线观看精品| 久久不见久久见免费视频7| 国产成人亚洲综合a∨婷婷| 成人国产亚洲欧美成人综合网| 在线视频观看一区| 久久久亚洲午夜电影| 国产日本欧美一区二区| 亚洲乱码精品一二三四区日韩在线| 夜夜精品视频一区二区 | 亚洲bdsm女犯bdsm网站| 精品亚洲成a人| 91老师片黄在线观看| 久久人人97超碰com| 亚洲gay无套男同| 日本精品一区二区三区高清 | 97久久人人超碰| 久久先锋影音av鲁色资源| 亚洲国产cao| 国产91对白在线观看九色| 欧美高清精品3d| 亚洲aaa精品| 欧美日韩一级片在线观看| 亚洲少妇中出一区| 国产福利91精品一区二区三区| 91精品国产一区二区三区香蕉| 亚洲一区视频在线观看视频| 91麻豆国产福利精品| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲黄色在线视频| 国产精品亚洲第一区在线暖暖韩国| 日韩久久精品一区| 色一情一乱一乱一91av| 韩国中文字幕2020精品| 国产精品色婷婷| 欧美日韩一区二区电影| 懂色av中文一区二区三区| 日韩精品亚洲一区| 亚洲日本在线天堂| 国产丝袜在线精品| 日韩一级二级三级| 国产成人在线视频网址| 欧美一级高清片在线观看| 亚洲综合色噜噜狠狠| 欧美老女人第四色| 丁香五精品蜜臀久久久久99网站| 国产精品电影一区二区三区| 制服丝袜亚洲精品中文字幕| 国产精品夜夜嗨| 亚洲最新在线观看| 精品国产91乱码一区二区三区| 成人av网址在线| 久久成人av少妇免费| 一区二区三区四区五区视频在线观看 | 亚洲日本在线看| 日韩视频在线观看一区二区| 成人精品视频.| 久久电影网电视剧免费观看| 亚洲影院在线观看| 久久久久久久久97黄色工厂| 欧美色视频一区| 色婷婷综合在线| 99久久精品免费看国产| 国产精品原创巨作av| 日韩av在线发布| 免费精品视频在线| 日本午夜一本久久久综合| 一区二区三区国产精华| 亚洲免费视频中文字幕| 亚洲欧洲成人精品av97| 亚洲人成亚洲人成在线观看图片| 久久久精品国产免大香伊| 国产人久久人人人人爽| 国产精品理论在线观看| 亚洲欧美另类综合偷拍| 一区二区三区精品久久久| 午夜精品久久久久久久| 国产成人午夜精品影院观看视频| 婷婷综合五月天| 中文字幕在线一区二区三区| 欧美日韩高清影院| 欧美挠脚心视频网站| 国产成人精品www牛牛影视| 中文字幕亚洲视频| 国产亚洲一二三区| 久久久久久久一区| 久久久精品天堂| 国产日韩精品一区二区浪潮av| 国产精品网站一区| 亚洲成人免费看| 成人午夜碰碰视频| 3d动漫精品啪啪1区2区免费| 日韩精品一区二区在线观看| 国产无人区一区二区三区| 国产精品久久影院| 国产精一品亚洲二区在线视频| 91一区二区三区在线观看| 欧美大尺度电影在线| 中文字幕在线观看一区| 国产又粗又猛又爽又黄91精品| 色综合天天综合网天天看片| 久久久久9999亚洲精品| 天堂一区二区在线| 欧美性大战久久| 国产欧美精品一区| 国产一区二区三区免费| 91黄色免费网站| 国产精品日韩成人| 不卡影院免费观看| 国产亚洲一区二区三区四区 | 色综合久久久久| 日韩毛片在线免费观看| 97久久久精品综合88久久| 欧美国产丝袜视频| caoporn国产精品| 成人免费一区二区三区视频| 东方aⅴ免费观看久久av| 国产欧美一区二区在线| 91亚洲国产成人精品一区二三| 亚洲国产精品二十页| 91视视频在线观看入口直接观看www | 国产成人亚洲综合a∨婷婷| 久久久久九九视频| av激情综合网| 亚洲国产日韩av| 欧美大片一区二区三区| 日韩精品最新网址| 亚洲一区中文在线| 欧美日韩aaaaaa| 美脚の诱脚舐め脚责91| 26uuu成人网一区二区三区| 丰满白嫩尤物一区二区| 亚洲免费资源在线播放| 日韩欧美亚洲一区二区| 成人晚上爱看视频| 午夜精品国产更新| 国产日韩欧美高清在线| 色综合久久88色综合天天| 捆绑变态av一区二区三区| 亚洲欧美在线视频观看| 欧美岛国在线观看| 7777精品伊人久久久大香线蕉完整版 | 成人免费视频app| 日韩av一区二| 日韩精品一二三区| 亚洲欧洲国产日本综合| 精品免费视频一区二区| 欧美日韩视频在线第一区| 91啪在线观看| 成人免费视频视频| 国产精品77777| 成人久久视频在线观看| 国产在线不卡一卡二卡三卡四卡| 一区二区三区波多野结衣在线观看| 久久久99精品免费观看不卡|