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

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

?? floodingrouter.java

?? 實現網格環境下資源調度和分配的仿真
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * ** 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 * * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * * FloodingRouter.java - Simulates a network router with Flooding as * the advertising protocol * */package gridsim.net;import eduni.simjava.*;import gridsim.*;import gridsim.util.*;import java.util.*;/** * This class implements a Router using a form of Flooding for routing. * The routing protocol is run before Gridlets etc. can be * submitted. * <p> * In case there are more than two routes to a destination, the * route with the lower hopcount is used. Since in this simulation routers * relay perfect information and links do not break down, flooding should be a * reliable protocol to use. * * @invariant $none * @since GridSim Toolkit 3.1 * @author Gokul Poduval & Chen-Khong Tham, National University of Singapore */public class FloodingRouter extends Router{    private Hashtable linkTable;    private Hashtable schedTable; // table of schedulers    private Hashtable hostTable;    private Hashtable routerTable;    private Hashtable forwardTable;    private int id;    private static final int BITS = 8;     // 1 byte in bits    /**     * Creates a new FloodingRouter object. By default,     * <b>no recording or logging</b>     * is done for packets' activities. If you want to log operations of this     * entity, please use {@link #FloodingRouter(String, boolean)}.     *     * @param name Name of this router     * @throws NullPointerException This happens when name is empty or null     * @see #FloodingRouter(String, boolean)     * @pre name != null     * @post $none     */    public FloodingRouter(String name) throws NullPointerException {        this(name, false);    }    /**     * Creates a new FloodingRouter object with logging facility if it     * is turned on.     * <br>     * NOTE: If logging facility is turned on, there are some overheads     * in terms of performance and memory consumption.     *     * @param name      Name of this router     * @param trace     <tt>true</tt> if you want to record this router's     *                  activity, <tt>false</tt> otherwise     * @throws NullPointerException This happens when name is empty or null     * @pre name != null     * @post $none     */    public FloodingRouter(String name, boolean trace) throws                          NullPointerException    {        super(name, trace);        init();    }    /**     * Initialises all variables     * @pre $none     * @post $none     */    private void init()    {        this.id = super.get_id();        linkTable = new Hashtable();        hostTable = new Hashtable();        routerTable = new Hashtable();        forwardTable = new Hashtable();        schedTable = new Hashtable();    }    /**     * Informs the registered entities regarding to the end of a simulation.     * @pre $none     * @post $none     */    protected void processEndSimulation() {        // ... empty - maybe need to clean up all the hashtables    }    /**     * Joins two routers with a Link.     * @param router    The router on the other side to which this one will     *                  be attached.     * @param link      This is the link that will be used to connect the two     *                  routers.     * @param thisSched The scheduling policy used on this routers egress port     *                  when sending data through it.     * @param otherSched    The scheduling policy that will be used on the     *                      egress port of the router being connected to when     *                      sending data to this router.     * @pre router != null     * @pre link != null     * @pre thisSched != null     * @pre otherSched != null     * @post $none     */    public void attachRouter(Router router, Link link,                    PacketScheduler thisSched, PacketScheduler otherSched)    {        String msg = super.get_name() + ".attachRouter(): Error - ";        if (router == null)        {            System.out.println(msg + "the router is null.");            return;        }        if (link == null)        {            System.out.println(msg + "the link is null.");            return;        }        if (thisSched == null || otherSched == null)        {            System.out.println(msg +                    "the one or more packet schedulers are null.");            return;        }        thisSched.setBaudRate( link.getBaudRate() );        otherSched.setBaudRate( link.getBaudRate() );        link.attach(this, router);        this.attachRouter(router, link, thisSched);        router.attachRouter(this, link, otherSched);    }    /**     * Joins two routers together. This is called by the routers themselves     * and should not be called by other entities.     *     * @param router    The Router to which this router will be connected.     * @param link      The Link that will be used to join these routers.     * @param sched     The scheduling policy used on the egress port of the     *                  router when sending data through this route.     * @pre router != null     * @pre link != null     * @pre sched != null     * @post $none     */    public void attachRouter(Router router, Link link, PacketScheduler sched)    {        String msg = super.get_name() + ".attachRouter(): Error - ";        if (router == null)        {            System.out.println(msg + "the router is null.");            return;        }        if (link == null)        {            System.out.println(msg + "the link is null.");            return;        }        if (sched == null)        {            System.out.println(msg + "the packet scheduler is null.");            return;        }        linkTable.put(router.get_name(), link.get_name());        if (!schedTable.containsKey( link.get_name()) ) {            schedTable.put(link.get_name(), sched);        }        routerTable.put( link.get_name(), router.get_name() );        hostTable.put( link.get_name(), router.get_name() );        // logging or recording ...        if (reportWriter_ != null)        {            StringBuffer sb = null;            sb = new StringBuffer("attach this ROUTER, with router, ");            sb.append( router.get_name() );            sb.append(", with link, ");            sb.append( link.get_name() );            sb.append(", with packet scheduler, ");            sb.append( sched.getSchedName() );            super.write( sb.toString() );        }    }    /**     * Attaches an entity to this router. The link between the router and the     * entity being attached is taken from     * {@link gridsim.GridSimCore#getLink()}.     *     * @param entity    The entity to be attached.     * @param sched     The scheduling policy that will be used on the egress     *                  port when the router sends data to the entity being     *                  joined.     * @see gridsim.GridSimCore#getLink()     * @pre entity != null     * @pre sched != null     * @post $none     */    public void attachHost(GridSimCore entity, PacketScheduler sched)    {        String msg = super.get_name() + ".attachHost(): Error - ";        if (entity == null)        {            System.out.println(msg + "the entity is null.");            return;        }        if (sched == null)        {            System.out.println(msg + "the packet scheduler is null.");            return;        }        Link link = entity.getLink();        sched.setBaudRate( link.getBaudRate() );        link.attach(this, entity);        linkTable.put( entity.get_name(), link.get_name() );        if (!schedTable.containsKey( link.get_name() )) {            schedTable.put(link.get_name(), sched);        }        hostTable.put( link.get_name(), entity.get_name() );        // recording ...        if (reportWriter_ != null)        {            StringBuffer sb = null;            sb = new StringBuffer("attach this ROUTER, to entity, ");            sb.append( entity.get_name() );            sb.append(", with packet scheduler, ");            sb.append( sched.getSchedName() );            super.write( sb.toString() );        }    }    /**     * Processes incoming events     * @param ev    a Sim_event object     * @pre ev != null     * @post $none     */    protected synchronized void processEvent(Sim_event ev)    {        switch ( ev.get_tag() )        {            case GridSimTags.PKT_FORWARD:            case GridSimTags.JUNK_PKT:                processNetPacket(ev, ev.get_tag());                break;            case GridSimTags.ROUTER_AD:                receiveAd(ev);                break;            case GridSimTags.INSIGNIFICANT:                processInternalEvent(ev);                break;            default:                System.out.println(super.get_name() + ".body(): Unable to " +                        "handle request from GridSimTags " +                        "with constant number " + ev.get_tag() );                break;        }    }    /**     * Processes incoming network packets, one at a time.     * The incoming packet will be split up into smaller pieces if     * the packet size > MTU of the other end.     *     * @param ev    a Sim_event object     * @pre ev != null     * @post $none     */    private synchronized void processNetPacket(Sim_event ev, int tag)    {        double nextTime = 0;        Packet pkt = (Packet) ev.get_data();        PacketScheduler sched = getScheduler(pkt);        // if a packet scheduler is not found, then try reschedule this packet        // in the future        if (sched == null)        {            System.out.println(super.get_name() + ".processNetPacket(): " +                "Warning - can't find a packet scheduler for " + pkt);            System.out.println("-> Will reschedule it again in the future.");            super.sim_schedule(super.get_id(), Router.DELAY, tag, pkt);            return;        }        // process ping() request        if (pkt instanceof InfoPacket)        {            ((InfoPacket) pkt).addHop(id);            ((InfoPacket) pkt).addEntryTime( GridSim.clock() );            ((InfoPacket) pkt).addBaudRate(sched.getBaudRate());        }        // check downlink MTU, and split accordingly        String linkName = getLinkName( pkt.getDestID() );        Link downLink = (Link) Sim_system.get_entity(linkName);        int MTU = downLink.getMTU();        int numPackets = (int) Math.ceil(pkt.getSize() / (MTU * 1.0));        // if no packets at the moment        if (sched.size() == 0)        {            if (numPackets == 1) {                nextTime = (pkt.getSize() * BITS) / sched.getBaudRate();            }            else {                nextTime = (MTU * BITS * 1.0) / sched.getBaudRate();            }            sendInternalEvent(nextTime, sched);        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久女同精品一区二区| 亚洲国产精品激情在线观看 | 国产农村妇女毛片精品久久麻豆 | 国产成人亚洲精品狼色在线| 国产成人av自拍| 91一区在线观看| 欧美日韩精品专区| 精品国产百合女同互慰| 国产精品三级视频| 亚洲国产精品久久艾草纯爱| 日本麻豆一区二区三区视频| 国产乱码精品一区二区三区五月婷 | 精品一区二区免费| 日本欧美加勒比视频| 亚洲欧洲制服丝袜| 亚洲成人动漫在线观看| 久久99久久99精品免视看婷婷| 国产精品亚洲午夜一区二区三区 | 亚洲成人777| 久久成人av少妇免费| 成人av午夜电影| 欧美一区二区三区白人| 亚洲国产精品国自产拍av| 午夜精品视频在线观看| 国产激情一区二区三区四区| 日本高清不卡一区| 欧美精品一区二区三区蜜臀| 亚洲男帅同性gay1069| 国内精品免费**视频| 91成人国产精品| 久久久久久一级片| 婷婷中文字幕一区三区| 成人一区在线观看| 91精品国产福利在线观看| 日韩一区欧美小说| 极品少妇xxxx精品少妇| 欧美自拍偷拍一区| 国产女同性恋一区二区| 日韩高清国产一区在线| 色婷婷综合五月| 国产女人18水真多18精品一级做| 男男成人高潮片免费网站| 日本丰满少妇一区二区三区| 国产日韩欧美激情| 蜜桃免费网站一区二区三区| 在线精品亚洲一区二区不卡| 国产精品欧美综合在线| 国内久久婷婷综合| 欧美精品在线观看一区二区| 亚洲色图欧美偷拍| 成人丝袜高跟foot| 久久一区二区三区四区| 久久黄色级2电影| 久久精品国产第一区二区三区| 成人一区在线看| 日韩免费高清av| 亚洲va韩国va欧美va精品| 色综合久久中文字幕综合网| 国产欧美日韩精品在线| 精品少妇一区二区三区日产乱码 | 欧美三级资源在线| 亚洲色图视频网站| 91一区在线观看| √…a在线天堂一区| 成人午夜短视频| 久久精品在线免费观看| 久久91精品久久久久久秒播| 欧美日韩国产精品自在自线| 欧美成人bangbros| 日韩成人午夜精品| 欧美精选在线播放| 亚洲自拍偷拍综合| 欧美在线不卡视频| 亚洲欧洲制服丝袜| 欧洲av在线精品| 亚洲区小说区图片区qvod| 99久久免费视频.com| 国产亚洲精品aa午夜观看| 国产主播一区二区| 久久综合中文字幕| 国产乱妇无码大片在线观看| 日韩欧美一级在线播放| 美女在线一区二区| 欧美一级艳片视频免费观看| 美国精品在线观看| 欧美一区二区三区四区高清| 日韩不卡一二三区| 69堂精品视频| 久久精品99久久久| 精品国产91洋老外米糕| 国产一区二区91| 久久久久综合网| 成人一区在线观看| 国产精品另类一区| 91女神在线视频| 亚洲欧美激情插| 欧美色综合久久| 亚洲成人资源网| 日韩免费看的电影| 精品伊人久久久久7777人| 国产亚洲一区字幕| 国产精品一区免费视频| 一区免费观看视频| 色哟哟国产精品| 七七婷婷婷婷精品国产| 欧美成va人片在线观看| 国产91精品久久久久久久网曝门| 国产欧美日韩另类一区| 欧美在线视频日韩| 视频一区在线播放| 久久久久青草大香线综合精品| 成人在线综合网| 天天综合天天综合色| 日韩免费成人网| 成av人片一区二区| 一区二区免费在线播放| 欧美v亚洲v综合ⅴ国产v| 国内精品在线播放| 亚洲精品日韩一| 欧美夫妻性生活| 国产馆精品极品| 18涩涩午夜精品.www| 欧美一区二区三区免费| 经典三级一区二区| 综合网在线视频| 色视频欧美一区二区三区| 日本色综合中文字幕| 日韩精品专区在线影院重磅| 国产成人精品亚洲777人妖| 色拍拍在线精品视频8848| 裸体在线国模精品偷拍| 91精品国产一区二区三区香蕉| 北条麻妃一区二区三区| 日本成人在线看| 欧美激情一区二区三区| 欧美一区二区三区喷汁尤物| 国产成人精品一区二区三区网站观看| 亚洲一二三区视频在线观看| 精品国精品国产尤物美女| 欧美在线观看视频一区二区三区| 久久精品国产久精国产爱| 亚洲黄色在线视频| 精品福利av导航| 欧美日韩一级视频| 国产成人在线电影| 蜜臀va亚洲va欧美va天堂| 日本一区二区免费在线观看视频 | 91精品国产高清一区二区三区| 99精品欧美一区| 热久久久久久久| 夜夜嗨av一区二区三区四季av | 老司机精品视频一区二区三区| 亚洲色大成网站www久久九九| 欧美一级理论片| 欧美亚洲综合另类| 国产一区二区三区不卡在线观看 | 亚洲国产日韩一区二区| 国产精品无圣光一区二区| 欧美美女网站色| 在线中文字幕一区二区| 国内国产精品久久| 麻豆精品在线看| 夜夜爽夜夜爽精品视频| 国产日韩欧美一区二区三区综合| 欧美一区二区视频在线观看2020| 国产伦精一区二区三区| 婷婷综合另类小说色区| 亚洲国产日产av| 中文字幕在线一区免费| 久久久久久久久岛国免费| 91精品国产综合久久精品图片 | 精品久久人人做人人爰| 99re这里只有精品首页| 国产精品自拍一区| 亚洲成人av一区二区三区| 亚洲免费av网站| 一区在线观看免费| 国产欧美日韩在线观看| 国产亚洲精品aa| 欧美成人一区二区三区片免费 | 国产亚洲一区二区三区四区| 欧美一级搡bbbb搡bbbb| 一本一道综合狠狠老| 成人精品免费视频| 国产精品一区二区免费不卡| 亚洲在线视频网站| 中文字幕综合网| 亚洲国产精品精华液ab| 久久久99久久精品欧美| 国产喂奶挤奶一区二区三区| 欧美午夜视频网站| 欧美久久一区二区| 91在线播放网址| av中文字幕在线不卡| 91丨porny丨中文| 99久久夜色精品国产网站| 色老汉av一区二区三区| 色婷婷综合久久久| 色婷婷精品久久二区二区蜜臀av| 福利电影一区二区|