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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? infopacket.java

?? 中間件開發(fā)詳細(xì)說明:清華大學(xué)J2EE教程講義(ppt)-Tsinghua University J2EE tutorial lectures (ppt) [上載源碼成為會員下載此源碼] [成為VIP會
?? JAVA
字號:
/* * ** Network and Service Differentiation Extensions to GridSim 3.0 ** * * Gokul Poduval & Chen-Khong Tham * Computer Communication Networks (CCN) Lab * Dept of Electrical & Computer Engineering * National University of Singapore * August 2004 * NOTE: this is an experimental implementation subject to continuous * modification and enhancement, and is not an official release * * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * * InfoPacket.java - Implementation of a Information Packet. * */package gridsim.net;import java.text.DecimalFormat;import java.util.* ;import gridsim.* ;/** * InfoPacket class can be used to gather information from the network layer. * An InfoPacket traverses the network topology similar to a * {@link gridsim.net.NetPacket}, * but it collects information like bandwidths, and Round Trip Time etc. It is * the equivalent of ICMP in physical networks. * <p> * You can set all the parameters to an InfoPacket that can be applied to a * NetPacket. So if you want to find out the kind of information that a * particular type of NetPacket is experiencing, set the size and network * class of an InfoPacket to the same as the NetPacket, and send it to the same * destination from the same source. * * @since GridSim Toolkit 3.1 * @author Gokul Poduval & Chen-Khong Tham, National University of Singapore * @invariant $none */public class InfoPacket implements Packet{    private String name_;   // packet name    private long size_;     // size of this packet    private int packetID_;  // id of this packet    private int srcID_;     // original sender id    private int destID_;    // destination id    private int last_;      // last hop    private int tag_;       // whether going or returning    private int numHop_;    // number of hops    private long pingSize_; // original ping size    private int netServiceType_;    // level of service type    private double bandwidth_;      // bottleneck    private Vector entities_;       // list of entity IDs    private Vector entryTimes_;     // list of entry times    private Vector exitTimes_;      // list of exit times    private Vector baudRates_;      // list of entity's baud rate    private DecimalFormat num_;     // formatting the decimal points    /**     * Constructs a new Information packet.     *     * @param name   Name of this packet     * @param packetID  The ID of this packet     * @param size   size of the packet     * @param srcID  The ID of the entity that sends out this packet     * @param destID The ID of the entity to which this packet is destined     * @param netServiceType the class of traffic this packet belongs to     *     * @pre name != null     * @post $none     */    public InfoPacket(String name, int packetID, long size, int srcID,                      int destID, int netServiceType)    {        this.name_ = name;        this.packetID_ = packetID;        this.srcID_ = srcID;        this.destID_ = destID;        this.size_ = size;        this.netServiceType_ = netServiceType;        init();    }    /**     * Initialises common attributes     * @pre $none     * @post $none     */    private void init()    {        this.last_ = srcID_;        this.tag_ = GridSimTags.INFOPKT_SUBMIT;        this.bandwidth_ = -1;        this.numHop_ = 0;        this.pingSize_ = size_;        if (name_ != null)        {            this.entities_ = new Vector();            this.entryTimes_ = new Vector();            this.exitTimes_ = new Vector();            this.baudRates_ = new Vector();            num_ = new DecimalFormat("#0.000#");   // 4 decimal spaces        }    }    /**     * Returns the ID of this packet     * @return packet ID     * @pre $none     * @post $none     */    public int getID() {        return packetID_;    }    /**     * Sets original size of ping request     * @param size  ping data size (in bytes)     * @pre size >= 0     * @post $none     */    public void setOriginalPingSize(long size) {        this.pingSize_ = size;    }    /**     * Gets original size of ping request     * @return original size     * @pre $none     * @post $none     */    public long getOriginalPingSize() {        return pingSize_;    }    /**     * Returns a human-readable information of this packet.     *     * @return description of this packet     * @pre $none     * @post $none     */    public String toString()    {        if (name_ == null) {            return "Empty InfoPacket that contains no ping information.";        }        int SIZE = 1000;   // number of chars        StringBuffer sb = new StringBuffer(SIZE);        sb.append("Ping information for " + name_ + "\n");        sb.append("Entity Name\tEntry Time\tExit Time\t Bandwidth\n");        sb.append("----------------------------------------------------------\n");        String tab = "    ";  // 4 spaces        for (int i = 0 ; i < entities_.size(); i++)        {            int resID = ( (Integer) entities_.get(i) ).intValue();            sb.append(GridSim.getEntityName(resID) + "\t\t");            String entry = getData(entryTimes_, i);            String exit = getData(exitTimes_, i);            String bw = getData(baudRates_, i);            sb.append(entry + tab + tab + exit + tab + tab + bw + "\n");        }        sb.append("\nRound Trip Time : " +                  num_.format(this.getTotalResponseTime()) );        sb.append(" seconds");        sb.append("\nNumber of Hops  : " + this.getNumHop() );        sb.append("\nBottleneck Bandwidth : " + bandwidth_ + " bits/s");        return sb.toString();    }    /**     * Gets relevant data from a list     * @param v  a list     * @param index   the location in a list     * @pre v != null     * @post index > 0     */    private String getData(Vector v, int index)    {        String result;        try        {            Double obj = (Double) v.get(index);            double id = obj.doubleValue();            result = num_.format(id);        }        catch (Exception e) {            result = "    N/A" ;        }        return result;    }    /**     * Gets the size of this packet.     *     * @return size of the packet.     * @pre $none     * @post $none     */    public long getSize() {        return size_;    }    /**     * Sets the size of this packet     * @param size  size of the packet     * @return <tt>true</tt> if it is successful, <tt>false</tt> otherwise     * @pre size >= 0     * @post $none     */    public boolean setSize(long size)    {        if (size < 0) {            return false;        }        this.size_ = size;        return true;    }    /**     * Gets the id of the entity to which the packet is destined.     *     * @return the desination ID     * @pre $none     * @post $none     */    public int getDestID() {        return destID_;    }    /**     * Gets the id of the entity that sent out this packet     *     * @return the source ID     * @pre $none     * @post $none     */    public int getSrcID() {        return srcID_;    }    /**     * Returns the number of hops that this packet has traversed. Since the     * packet takes a round trip, the same router may have been traversed     * twice.     *     * @return the number of hops this packet has traversed     * @pre $none     * @post $none     */    public int getNumHop()    {        int PAIR = 2;        return ((numHop_ - PAIR) + 1) / PAIR;    }    /**     * Gets the total time that this packet has spent in the network. This is     * basically the RTT. Dividing this by half should be the approximate     * latency.     * <p>     * RTT is taken as the final entry time - first exit time.     * @return total round time     * @pre $none     * @post $none     */    public double getTotalResponseTime()    {        if (exitTimes_ == null || entryTimes_ == null) {            return 0;        }        double time = 0;        try        {            double startTime = ((Double)exitTimes_.firstElement()).doubleValue();            double receiveTime = ((Double)entryTimes_.lastElement()).doubleValue();            time = receiveTime - startTime;        }        catch(Exception e) {            time = 0;        }        return time;    }    /**     * Returns the bottleneck bandwidth between the source and the destination     *     * @return the bottleneck bandwidth     * @pre $none     * @post $none     */    public double getBaudRate() {        return bandwidth_;    }    /**     * This method should be called by network entities that count as hops, for     * e.g. Routers or GridResources. It should not be called by links etc.     *     * @param id    the id of the hop that this InfoPacket is traversing     * @pre id > 0     * @post $none     */    public void addHop(int id)    {        if (entities_ == null) {            return;        }        numHop_++;        entities_.add( new Integer(id) );    }    /**     * This method should be called by routers and other entities     * when this InfoPacket reaches them along with the current simulation time.     *     * @param time  current simulation time, use     *              {@link gridsim.GridSim#clock()} to obtain this     * @pre time >= 0     * @post $none     */    public void addEntryTime(double time)    {        if (entryTimes_ == null) {            return;        }        if (time < 0) {            time = 0.0;        }        entryTimes_.add( new Double(time) );    }    /**     * This method should be called by routers and other entities     * when this InfoPacket is leaving them. It should also supply the current     * simulation time.     *     * @param time  current simulation time, use     *              {@link gridsim.GridSim#clock()} to obtain this     * @pre time >= 0     * @post $none     */    public void addExitTime(double time)    {        if (exitTimes_ == null) {            return;        }        if (time < 0) {            time = 0.0;        }        exitTimes_.add( new Double(time) );    }    /**     * Every entity that the InfoPacket traverses should add the baud rate of     * the link on which this packet will be sent out next.     * @param baudRate  the entity's baud rate in bits/s     * @pre baudRate > 0     * @post $none     */    public void addBaudRate(double baudRate)    {        if (baudRates_ == null) {            return;        }        baudRates_.add( new Double(baudRate) );        if (bandwidth_ < 0 || baudRate < this.bandwidth_) {            this.bandwidth_ = baudRate;        }    }    /**     * Returns the list of all the bandwidths that this packet has traversed     *     * @return a Double Array of links bandwidths     * @pre $none     * @post $none     */    public Object[] getDetailBaudRate()    {        if (baudRates_ == null) {            return null;        }        return baudRates_.toArray();    }    /**     * Returns the list of all the hops that this packet has traversed.     *     * @return an Integer Array of hop ids     * @pre $none     * @post $none     */    public Object[] getDetailHops()    {        if (entities_ == null) {            return null;        }        return entities_.toArray();    }    /**     * Returns the list of all entry time that this packet has traversed.     * @return an Integer Array of entry time     * @pre $none     * @post $none     */    public Object[] getDetailEntryTimes()    {        if (entryTimes_ == null) {            return null;        }        return entryTimes_.toArray();    }    /**     * Returns the list of all exit time that this packet has traversed.     * @return an Integer Array of exit time     * @pre $none     * @post $none     */    public Object[] getDetailExitTimes()    {        if (exitTimes_ == null) {            return null;        }        return exitTimes_.toArray();    }    /**     * Gets an entity ID from the last hop that this packet has traversed.     * @return an entity ID     * @pre $none     * @post $none     */    public int getLast() {        return last_;    }    /**     * Sets an entity ID from the last hop that this packet has traversed.     * @param last  an entity ID from the last hop     * @pre last > 0     * @post $none     */    public void setLast(int last) {        this.last_ = last;    }    /**     * Gets the network service type of this packet     * @return the network service type     * @pre $none     * @post $none     */    public int getNetServiceType() {        return netServiceType_ ;    }    /**     * Sets the network service type of this packet     * @param netServiceType    the packet's network service type     * @pre netServiceType >= 0     * @post $none     */    public void setNetServiceType(int netServiceType) {        this.netServiceType_ = netServiceType ;    }    /**     * Gets this packet tag     * @return this packet tag     * @pre $none     * @post $none     */    public int getTag() {        return tag_ ;    }    /**     * Sets the tag of this packet     * @param tag   the packet's tag     * @return <tt>true</tt> if successful, <tt>false</tt> otherwise     * @pre tag > 0     * @post $none     */    public boolean setTag(int tag)    {        boolean flag = false;        switch(tag)        {            case GridSimTags.INFOPKT_SUBMIT:            case GridSimTags.INFOPKT_RETURN:                this.tag_ = tag;                flag = true;                break;            default:                flag = false;                break;        }        return flag;    }    /**     * Sets the destination ID for this packet     * @param id    this packet's destination ID     * @pre id > 0     * @post $none     */    public void setDestID(int id) {        this.destID_ = id;    }} // end class

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美丰满少妇xxxxx高潮对白 | 欧美精品久久一区二区三区| 国产精品亚洲一区二区三区在线| 亚洲黄色性网站| 亚洲欧美日韩国产综合| 国产三级三级三级精品8ⅰ区| 337p亚洲精品色噜噜| 欧美女孩性生活视频| 3d成人动漫网站| 精品国产人成亚洲区| 久久九九国产精品| 亚洲激情第一区| 一区二区成人在线视频| 精品国产乱码久久久久久牛牛| 欧美精品777| 久久久亚洲精品一区二区三区| 久久精品视频在线免费观看 | 国产精品久久久久影院亚瑟| 欧美精品一区二区在线播放| 日韩午夜激情免费电影| 欧美一区二区三区喷汁尤物| 日韩一区二区高清| 91精品国产麻豆| 精品剧情v国产在线观看在线| 日韩精品自拍偷拍| 中文幕一区二区三区久久蜜桃| 懂色av一区二区在线播放| 国产乱子伦视频一区二区三区| 国产精品77777| 成人高清视频免费观看| 欧美日韩国产小视频| 这里是久久伊人| 777久久久精品| 91在线视频网址| 成人中文字幕电影| 日韩精品一二三四| 麻豆高清免费国产一区| 激情五月播播久久久精品| 国产成人亚洲精品狼色在线 | 亚洲激情图片小说视频| 免费在线观看不卡| 大胆欧美人体老妇| 欧美日韩视频第一区| 日韩欧美在线网站| 亚洲人成网站色在线观看| 美女脱光内衣内裤视频久久影院| 国产精品一线二线三线精华| 色www精品视频在线观看| 欧美美女黄视频| 日本一区二区三区视频视频| 日韩精品1区2区3区| 一区二区视频在线| 国产98色在线|日韩| 欧美日韩久久久久久| www.在线成人| 91精品国产综合久久精品| 欧美日韩三级一区| 91精品91久久久中77777| 国产乱码精品1区2区3区| 欧美大片免费久久精品三p| 亚洲一区二区美女| 亚洲国产成人高清精品| 亚洲国产精品久久久久秋霞影院| 日本成人在线一区| 亚洲国产精品视频| 国产在线视频精品一区| 国产成都精品91一区二区三| 精品视频在线免费观看| 亚洲视频一区二区免费在线观看| 久久精品国产成人一区二区三区| 69久久99精品久久久久婷婷 | 制服.丝袜.亚洲.另类.中文| 久久视频一区二区| 五月激情综合色| 色婷婷av一区二区三区gif| 国产精品乱码一区二区三区软件| 亚洲另类中文字| 成人黄色小视频在线观看| 久久免费的精品国产v∧| 捆绑变态av一区二区三区| 欧美一区三区二区| 五月天中文字幕一区二区| 欧美片在线播放| 亚洲va国产天堂va久久en| 欧美色综合天天久久综合精品| 亚洲综合自拍偷拍| 色婷婷av一区二区三区gif | 亚洲一区二区在线播放相泽| 一本大道av伊人久久综合| 1024国产精品| 欧美高清你懂得| 五月婷婷综合在线| 91色porny| 亚洲最色的网站| 国产一区二区美女| 国产欧美一区二区精品久导航| 国产一区999| 国产精品高潮呻吟| 欧美性xxxxxx少妇| 三级欧美韩日大片在线看| 日韩欧美色综合| av在线不卡电影| 香蕉乱码成人久久天堂爱免费| 日韩免费视频线观看| 成人动漫一区二区在线| 午夜久久久久久| 国产视频在线观看一区二区三区| 99久久99久久久精品齐齐| 亚洲大尺度视频在线观看| 精品999久久久| 日本丶国产丶欧美色综合| 国产最新精品免费| 亚洲综合一区二区三区| 亚洲精品一区二区在线观看| 在线视频国产一区| 久久超碰97人人做人人爱| 亚洲欧美偷拍卡通变态| 精品久久99ma| 欧美三级资源在线| 成人黄页在线观看| 久久成人综合网| 亚洲高清免费视频| 日韩一区中文字幕| 国产欧美日韩精品a在线观看| 欧美精品18+| 欧美中文字幕一区二区三区亚洲 | 色噜噜久久综合| 国产激情一区二区三区四区| 天堂午夜影视日韩欧美一区二区| 亚洲色图19p| 国产亚洲自拍一区| 国产亚洲午夜高清国产拍精品 | 欧美久久免费观看| 色乱码一区二区三区88| 91福利视频在线| 欧美三级日韩三级| 精品婷婷伊人一区三区三| 欧美午夜片在线观看| 在线免费观看成人短视频| 日本二三区不卡| 6080国产精品一区二区| 日韩一区二区三区视频在线| 日韩欧美一卡二卡| 欧美精品一区二区三区在线播放| 久久五月婷婷丁香社区| 欧美国产一区在线| 成人欧美一区二区三区| 亚洲国产精品久久艾草纯爱| 欧美激情资源网| 久久综合久久综合久久| 国产日本欧美一区二区| 久久亚区不卡日本| 久久久高清一区二区三区| 日本一区二区免费在线观看视频 | 亚洲精品在线免费播放| 日韩一区二区免费在线观看| 精品国产乱码久久久久久图片| 精品剧情v国产在线观看在线| 国产成人精品免费| 国产成人自拍网| 99精品国产视频| 国产成人在线视频免费播放| 国产一区二区成人久久免费影院| 激情欧美一区二区三区在线观看| 国产综合成人久久大片91| 成人激情电影免费在线观看| 欧美性生活久久| 精品剧情在线观看| 亚洲色图欧洲色图| 免费高清在线一区| 成人午夜电影久久影院| 在线观看欧美日本| 欧美成人性福生活免费看| 精品国产一区二区亚洲人成毛片| 欧美一区二区三区日韩| 欧美国产视频在线| 三级影片在线观看欧美日韩一区二区 | 日韩亚洲欧美在线观看| 中文字幕一区不卡| 久久精品99国产国产精| 99久久国产综合精品麻豆| 欧美一区二区三区四区在线观看| 日本一区二区免费在线观看视频| 调教+趴+乳夹+国产+精品| 国产乱码字幕精品高清av | 国产一区在线观看视频| 9l国产精品久久久久麻豆| 欧美午夜精品久久久久久孕妇| 欧美变态tickling挠脚心| 中文字幕高清不卡| 天堂va蜜桃一区二区三区漫画版| 激情文学综合插| 欧美久久久久久久久中文字幕| 国产区在线观看成人精品| 欧美日韩一区三区| 日韩一区二区精品葵司在线| 亚洲精品国产精品乱码不99| 激情小说欧美图片| 69堂国产成人免费视频| 一区二区激情小说|