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

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

?? output.java

?? 中間件開發(fā)詳細(xì)說明:清華大學(xué)J2EE教程講義(ppt)-Tsinghua University J2EE tutorial lectures (ppt) [上載源碼成為會(huì)員下載此源碼] [成為VIP會(huì)
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Title:        GridSim Toolkit * Description:  GridSim (Grid Simulation) Toolkit for Modeling and Simulation *               of Parallel and Distributed Systems such as Clusters and Grids * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html * * $Id: Output.java,v 1.7 2005/09/02 04:12:04 anthony Exp $ */package gridsim.net;import gridsim.*;import gridsim.net.*;import gridsim.util.*;import eduni.simjava.*;import java.util.*;/** * GridSim Output defines a port through which a simulation entity sends * data to the simulated network. * <p> * It maintains an event queue to serialize * the data-out-flow and delivers to the destination entity. * It works along with Input entity to simulate network * communication delay. Simultaneous outputs can be modeled by using multiple * instances of this class * * @author       Manzur Murshed and Rajkumar Buyya * @since        GridSim Toolkit 1.0 * @invariant $none */public class Output extends Sim_entity{    private Sim_port outPort_;      // output port    private Link link_;             // a link to this output entity    private double baudRate_;       // baud rate of this entity    private final int SIZE = 8;     // 1 byte in bits    private int pktID_;             // packet ID counter    private Vector packetList_;     // store a list of packets    private Random random_;         // selects to which junk packets go to    private TrafficGenerator gen_;  // background traffic generator    private ArrayList list_;        // list of resources + user entities    private boolean hasStarted_;    // a flag for background traffic has started    private static final int BITS = 8;      // 1 byte = 8 bits    /**     * Allocates a new Output object     * @param name         the name of this object     * @param baudRate     the communication speed     * @throws NullPointerException This happens when creating this entity     *                  before initializing GridSim package or this entity name     *                  is <tt>null</tt> or empty     * @pre name != null     * @pre baudRate >= 0.0     * @post $none     */    public Output(String name, double baudRate) throws NullPointerException    {        super(name);        this.baudRate_ = baudRate;        link_ = null;        packetList_ = null;        pktID_ = 0;        outPort_ = new Sim_port("output_buffer");        super.add_port(outPort_);        // for sending background traffic        gen_  = null;        list_ = null;        random_ = null;        hasStarted_ = false;    }    /**     * Sets the background traffic generator for this entity.     * <p>     * When simulation starts, this entity will automatically sends junk     * packets to resource entities.     * @param gen   a background traffic generator     * @return <tt>true</tt> if successful, <tt>false</tt> otherwise     * @pre gen != null     * @post $none     */    public boolean setBackgroundTraffic(TrafficGenerator gen)    {        if (gen == null) {            return false;        }        gen_ = gen;        if (list_ == null) {            list_ = new ArrayList();        }        return true;    }    /**     * Sets the background traffic generator for this entity.     * <p>     * When simulation starts, this entity will automatically sends junk     * packets to resource entities and other entities. <br>     * NOTE: Sending background traffic to itself is not supported.     *     * @param gen       a background traffic generator     * @param userName  a collection of user entity name (in String object).     * @return <tt>true</tt> if successful, <tt>false</tt> otherwise     * @pre gen != null     * @pre userName != null     * @post $none     */    public boolean setBackgroundTraffic(TrafficGenerator gen,                                        Collection userName)    {        if (gen == null || userName == null) {            return false;        }        boolean flag = true;        try        {            gen_ = gen;            if (list_ == null) {                list_ = new ArrayList();            }            // iterates through each list to check whether it is a valid            // entity name or not            Iterator it = userName.iterator();            int id = -1;            while( it.hasNext() )            {                String name = (String) it.next();                // check whether it is sending to itself                id = GridSim.getEntityId("Output_" + name);                if (id == super.get_id())                {                    System.out.println(super.get_name() +                        ".setBackgroundTraffic(): Warning - can not send " +                        "junk packets to itself.");                    continue;                }                // get the ID of other entity                id = GridSim.getEntityId(name);                if (id > 0)                {                    Integer obj = new Integer(id);                    list_.add(obj);                }                // ignore for invalid entity                else                {                    System.out.println(super.get_name() +                        ".setBackgroundTraffic(): Warning - invalid entity " +                        "name for \"" + name + "\".");                }            }        }        catch(Exception e) {            flag = false;        }        return flag;    }    /**     * Sets this entity's link. This should be used only if the network     * extensions are being used.     *     * @param link the link to which this Output entity should send data     * @pre link != null     * @post $none     */    public void addLink(Link link)    {        this.link_ = link;        packetList_ = new Vector();    }    /**     * Gets the baud rate     * @return the baud rate     * @deprecated As of GridSim 2.1, replaced by {@link #getBaudRate()}     * @pre $none     * @post $result >= 0.0     */    public double GetBaudRate() {        return this.getBaudRate();    }    /**     * Gets the baud rate     * @return the baud rate     * @pre $none     * @post $result >= 0.0     */    public double getBaudRate() {        return baudRate_;    }    /**     * Gets the I/O real number based on a given value     * @param value  the specified value     * @return real number     * @deprecated As of GridSim 2.1, replaced by {@link #realIO(double)}     * @pre $none     * @post $result >= 0.0     */    public double real_io(double value) {        return this.realIO(value);    }    /**     * Gets the I/O real number based on a given value     * @param value  the specified value     * @return real number     * @pre $none     * @post $result >= 0.0     */    public double realIO(double value) {        return GridSimRandom.realIO(value);    }    /**     * A method that gets one process event at one time until the end     * of a simulation, then delivers an event to the entity (its parent)     * @pre $none     * @post $none     */    public void body()    {        // find out ids for entities that are not part of simulation network        // topology, such as GIS, GridSimShutdown and GridStatistics        int gisID = GridSim.getGridInfoServiceEntityId();        int statID = GridSim.getGridStatisticsEntityId();        int shutdownID = GridSim.getGridSimShutdownEntityId();        // start generating some junk packets or background traffic        startBackgroundTraffic();        // Process incoming events        while ( Sim_system.running() )        {            Sim_event ev = new Sim_event();            super.sim_get_next(ev);     // get the next event in the queue            // if the simulation finishes then exit the loop            if (ev.get_tag() == GridSimTags.END_OF_SIMULATION) {                break;            }            // handle different types of incoming events            switch ( ev.get_tag() )            {                case GridSimTags.SEND_PACKET:                    sendPacket();                    break;                // submit ping() request                case GridSimTags.INFOPKT_SUBMIT:                    sendInfoPacket(ev);                    break;                // replying ping() request from another entity                case GridSimTags.INFOPKT_RETURN:                    returnInfoPacket(ev);                    break;                // activate background traffic                case GridSimTags.JUNK_PKT:                    generateBackgroundTraffic();                    break;                default:                    defaultSend(ev, gisID, statID, shutdownID);                    break;            }        }    }    /**     * Generates few junk packets at the given interval     * @pre $none     * @post $none     */    private synchronized void generateBackgroundTraffic()    {        // get the next inter-arrival time for these junk packets        long time = gen_.getNextPacketTime();        // get the sending pattern        int pattern = gen_.getPattern();        // for initial start-up, get the list of all resources first        if (hasStarted_ == false)        {            // get list of resource IDs from GIS            LinkedList resList = GridSim.getGridResourceList();            // if the list is empty then schedule the next time            if (resList == null && list_.size() == 0)            {                super.sim_schedule(super.get_id(), time, GridSimTags.JUNK_PKT);                return;            }            hasStarted_ = true;            list_.addAll(resList);  // add resource IDs into the current list            // sets the sending pattern            if (pattern == TrafficGenerator.SEND_ONE_ONLY && random_ == null) {                random_ = new Random();            }        }        // get the required info for generating this background traffic        long size = gen_.getNextPacketSize();   // packet size        long freq = gen_.getNextPacketFreq();   // packet freq        int type = gen_.getServiceType();       // packet type        int tag = GridSimTags.JUNK_PKT;         // packet tag        // we need to packetsize the data, all packets are sent with size MTU.        // only the last packet contains the data, the receiver should        // throw away all other packets        int MTU = link_.getMTU();        int numPackets = (int) Math.ceil( size / (MTU * 1.0) );        /*********   // DEBUG info        System.out.println();        System.out.println(super.get_name() +                ": START GENERATE BG traffic... at time "+ GridSim.clock());        System.out.println(super.get_name() +                ": NEXT background traffic will start at " + time);        System.out.println(super.get_name() +                " num PACKETS = " + numPackets + ", freq = " + freq);        *********/        int i = 0;        int destId = -1;        // send to one of the entity using uniform distribution        if (pattern == TrafficGenerator.SEND_ONE_ONLY)        {            int index = random_.nextInt( list_.size() );            destId = ((Integer) list_.get(index)).intValue();            /*********   // DEBUG info            System.out.println(super.get_name() + ": Destination id = " +

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久婷婷国产综合精品青草| 欧美日韩一本到| 久久日韩精品一区二区五区| 国产在线视频一区二区三区| 久久一区二区三区四区| 丁香网亚洲国际| 国产精品1024久久| 国产精品剧情在线亚洲| 在线视频中文字幕一区二区| 一区二区三区影院| 欧美一区二区三区在线视频| 国产激情一区二区三区桃花岛亚洲| 国产亚洲精品中文字幕| 一本大道av一区二区在线播放| 亚洲在线一区二区三区| 日韩欧美中文字幕公布| 成人免费视频免费观看| 亚洲一区免费在线观看| 精品日韩欧美在线| 99精品欧美一区二区三区综合在线| 亚洲一区二区三区四区在线观看| 日韩精品在线网站| 91年精品国产| 久久不见久久见中文字幕免费| 国产精品免费久久久久| 欧美无人高清视频在线观看| 国内成人精品2018免费看| 中文字幕一区二区三区蜜月| 欧美美女bb生活片| 成人毛片在线观看| 奇米四色…亚洲| 国产精品动漫网站| 日韩一区二区三区四区五区六区| 99久精品国产| 久久精品二区亚洲w码| 亚洲精品伦理在线| 久久综合网色—综合色88| 欧美写真视频网站| 成人爽a毛片一区二区免费| 免费观看在线综合| 亚洲一区二区影院| 亚洲国产高清在线观看视频| 欧美精品第1页| 99精品视频免费在线观看| 精品亚洲成a人| 日韩精品成人一区二区三区| 日韩毛片在线免费观看| 久久久www成人免费毛片麻豆 | 久久噜噜亚洲综合| 欧美日韩精品电影| thepron国产精品| 国产精品一二三在| 久久99精品一区二区三区三区| 亚洲一级二级三级在线免费观看| 欧美韩国日本综合| 久久在线免费观看| 欧美哺乳videos| 欧美男生操女生| 欧美亚洲综合另类| 在线免费观看日本欧美| 久久久久久久久久久久电影| 欧美日韩国产免费| 色综合久久六月婷婷中文字幕| 懂色av中文字幕一区二区三区| 久久国产综合精品| 日本vs亚洲vs韩国一区三区 | 精品成人一区二区三区四区| 欧美精品丝袜中出| 欧美日韩精品三区| 在线精品视频免费观看| av男人天堂一区| 99精品久久只有精品| 成a人片国产精品| 成人性生交大合| 成人午夜激情在线| a在线播放不卡| 97久久精品人人爽人人爽蜜臀 | 亚洲主播在线播放| 一区二区三区蜜桃网| 亚洲精品国久久99热| 夜夜精品浪潮av一区二区三区| 亚洲欧美区自拍先锋| 夜夜爽夜夜爽精品视频| 亚洲福利视频导航| 日韩国产精品久久| 久久99热这里只有精品| 国内精品久久久久影院薰衣草 | 免费看欧美女人艹b| 精品一区二区三区免费播放| 国产精品资源网站| 成人午夜短视频| 欧美亚洲综合一区| 日韩精品中文字幕在线不卡尤物| 久久一二三国产| 亚洲少妇屁股交4| 亚洲制服丝袜av| 久久草av在线| av激情亚洲男人天堂| 欧美日韩视频一区二区| 日韩亚洲欧美综合| 中文成人av在线| 亚洲一区二区欧美| 国内精品免费**视频| a在线欧美一区| 91精品久久久久久久久99蜜臂| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 99久久免费精品| 欧美在线播放高清精品| 欧美一卡在线观看| 国产视频视频一区| 亚洲一区二区在线免费观看视频 | 国产精品99久久久久| 91片在线免费观看| 日韩视频一区二区三区 | 亚洲一区在线播放| 精品影视av免费| 色域天天综合网| 日韩免费观看高清完整版在线观看| 国产欧美日韩综合精品一区二区| 亚洲影院免费观看| 国产精品影视网| 欧美高清视频不卡网| 国产女主播在线一区二区| 亚洲国产综合色| 成人成人成人在线视频| 91精品国产综合久久久久久漫画 | 国产成人啪免费观看软件| 欧美亚洲国产bt| 精品一区二区三区在线观看 | 国产一区二区不卡在线| 欧美色成人综合| 中文子幕无线码一区tr| 日本免费在线视频不卡一不卡二| 成人国产精品免费网站| 日韩欧美第一区| 五月天久久比比资源色| 97精品电影院| 欧美高清在线精品一区| 久久精品国产秦先生| 69堂成人精品免费视频| 亚洲另类在线制服丝袜| 成人影视亚洲图片在线| 日韩欧美一级二级| 午夜精品爽啪视频| 91福利国产精品| 国产精品国产自产拍高清av王其| 精久久久久久久久久久| 欧美蜜桃一区二区三区| 一区二区三区久久| 91婷婷韩国欧美一区二区| 欧美激情资源网| 国产精品一区二区三区网站| 日韩精品一区二区在线| 日本欧美一区二区三区| 欧美丰满少妇xxxxx高潮对白 | 国产精品久久久久久久久晋中 | 看电影不卡的网站| 欧美一级专区免费大片| 三级精品在线观看| 91 com成人网| 婷婷成人综合网| 欧美精品乱码久久久久久| 亚洲va欧美va人人爽午夜| 欧美日韩一区三区四区| 偷拍亚洲欧洲综合| 91精品国产品国语在线不卡| 日本伊人色综合网| 91精品国产高清一区二区三区蜜臀 | 性久久久久久久久| 欧美中文字幕一二三区视频| 亚洲精品国产视频| 欧美性做爰猛烈叫床潮| 亚洲成人免费视频| 3atv在线一区二区三区| 毛片基地黄久久久久久天堂| 精品免费99久久| 国产不卡视频在线播放| 中文字幕一区免费在线观看| 色综合久久九月婷婷色综合| 一区二区三区成人| 91精品国产全国免费观看| 国内精品不卡在线| 国产精品久久久一本精品| 91成人免费电影| 日韩二区三区四区| 国产日韩精品一区| 一本到三区不卡视频| 日韩电影一区二区三区四区| 欧美精品一区二区三区一线天视频| 国产电影精品久久禁18| 亚洲日本在线观看| 欧美浪妇xxxx高跟鞋交| 国产毛片一区二区| 亚洲欧美在线另类| 3d成人动漫网站| 成人app在线观看| 日韩国产欧美三级| 中文字幕av一区二区三区高| 欧美影院一区二区三区| 国精产品一区一区三区mba桃花 |