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

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

?? floodingrouter.java

?? 中間件開發(fā)詳細說明:清華大學J2EE教程講義(ppt)-Tsinghua University J2EE tutorial lectures (ppt) [上載源碼成為會員下載此源碼] [成為VIP會
?? 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影院| 亚洲国产成人91porn| 99re这里都是精品| 蜜臀久久99精品久久久画质超高清| 欧美国产精品专区| 欧美精品一区二区三区一线天视频| 欧美伊人久久久久久午夜久久久久| 国产成a人亚洲| 国产91露脸合集magnet| 欧美狂野另类xxxxoooo| 欧美乱妇15p| 中文字幕在线观看一区二区| 国产精品视频一二三| 中文字幕av不卡| 经典一区二区三区| 国产乱理伦片在线观看夜一区| 国内精品伊人久久久久影院对白| 蜜臀av一区二区在线观看| 色欲综合视频天天天| 91老司机福利 在线| 欧美午夜一区二区三区| 国产精品你懂的在线| 国内精品免费**视频| 欧美不卡一二三| 精品日产卡一卡二卡麻豆| 性欧美疯狂xxxxbbbb| 美女视频一区二区三区| 欧美群妇大交群中文字幕| 日韩女优av电影| 亚洲国产精品二十页| 精彩视频一区二区| 欧美岛国在线观看| 精品一区二区三区香蕉蜜桃| 日韩欧美一级片| 日本欧美久久久久免费播放网| 婷婷综合久久一区二区三区| 国产一区二区影院| 在线精品视频一区二区三四| 777欧美精品| 国产精品久线观看视频| 亚洲国产精品久久人人爱蜜臀| 9人人澡人人爽人人精品| 欧美日韩精品福利| 亚洲福利视频一区二区| 91精品久久久久久蜜臀| 日韩精品亚洲专区| 不卡电影一区二区三区| 欧美一区二区三区公司| 国产精品久久久久国产精品日日| eeuss鲁片一区二区三区在线观看| 欧美国产精品中文字幕| 一本一道波多野结衣一区二区| 亚洲欧美另类久久久精品2019| 美国av一区二区| 国产婷婷一区二区| 亚洲国产欧美日韩另类综合| 欧美精品在线一区二区三区| 日韩精品一二三区| 久久久久国产精品免费免费搜索| 偷拍与自拍一区| 精品成人一区二区三区四区| 成人精品亚洲人成在线| 精品久久久影院| 成人三级在线视频| 亚洲成人av资源| 国产性做久久久久久| 日本电影亚洲天堂一区| 中文字幕av资源一区| 日本电影欧美片| 精品无人区卡一卡二卡三乱码免费卡| 国产欧美日韩综合精品一区二区| 日本91福利区| 欧美日韩精品三区| 久久国产乱子精品免费女| 色琪琪一区二区三区亚洲区| 青青草伊人久久| 国产精品成人在线观看| 337p亚洲精品色噜噜噜| 国产91精品一区二区麻豆网站| 同产精品九九九| 亚洲欧美日韩国产一区二区三区| 欧美一区日本一区韩国一区| 成人av在线一区二区| 久久精品国产第一区二区三区| 亚洲精品欧美激情| 色婷婷一区二区三区四区| 亚洲欧美日韩国产另类专区| 91麻豆精品国产91久久久久久| 成人黄色电影在线| 国产一区二区三区香蕉| 亚洲第四色夜色| 国产精品女主播av| 精品久久久久99| 777午夜精品视频在线播放| 成人av中文字幕| 国产美女久久久久| 久久99国产精品久久99| 日精品一区二区三区| 亚洲狠狠丁香婷婷综合久久久| 2021中文字幕一区亚洲| 黄页视频在线91| 日韩avvvv在线播放| 亚洲午夜国产一区99re久久| 中文字幕亚洲综合久久菠萝蜜| 久久久久青草大香线综合精品| 制服丝袜亚洲精品中文字幕| 欧美午夜寂寞影院| 在线亚洲人成电影网站色www| 成人av网站在线观看| 国产suv精品一区二区三区| 麻豆精品在线视频| 性欧美疯狂xxxxbbbb| 天涯成人国产亚洲精品一区av| 亚洲小说欧美激情另类| 亚洲日本青草视频在线怡红院| 欧美日韩国产综合一区二区| 色综合久久综合| 91成人网在线| 欧洲av一区二区嗯嗯嗯啊| 色婷婷av一区二区| 欧美日韩激情一区二区| 91精品国产一区二区三区蜜臀| 777久久久精品| 精品国产乱码久久久久久老虎| 日韩一级完整毛片| 91同城在线观看| 欧美影院一区二区| 日韩亚洲国产中文字幕欧美| 日韩免费看的电影| 久久久国产综合精品女国产盗摄| 国产欧美日本一区二区三区| 国产精品久久久久毛片软件| 成人欧美一区二区三区1314| 夜夜精品视频一区二区| 国产日韩欧美亚洲| 日韩一区在线播放| 亚洲欧美aⅴ...| 日韩影院精彩在线| 国产精品1区2区3区| 99久久国产综合精品色伊| 在线精品视频一区二区三四| 91精品欧美一区二区三区综合在 | 成人免费毛片aaaaa**| 成人美女在线观看| 一本一道综合狠狠老| 日韩欧美高清在线| 中文字幕免费不卡| 亚洲午夜电影在线| 久久97超碰国产精品超碰| 国产高清不卡二三区| 日本高清免费不卡视频| 日韩美女主播在线视频一区二区三区| 久久亚区不卡日本| 中文字幕一区二区三区乱码在线| 亚洲图片自拍偷拍| 国产高清不卡一区| 欧美做爰猛烈大尺度电影无法无天| 3atv在线一区二区三区| 国产精品乱人伦一区二区| 三级一区在线视频先锋| 成人精品免费网站| 日韩欧美成人一区| 亚洲精品你懂的| 高清不卡一二三区| 欧美一区欧美二区| 亚洲免费观看高清完整版在线观看 | 色香色香欲天天天影视综合网| 欧美日韩极品在线观看一区| 久久精品一区四区| 日韩国产欧美三级| 91看片淫黄大片一级在线观看| 精品精品国产高清一毛片一天堂| 亚洲精品一卡二卡| 丰满放荡岳乱妇91ww| 欧美久久一区二区| 亚洲欧美激情一区二区| 国产精品18久久久| 日韩一区二区精品葵司在线| 亚洲蜜臀av乱码久久精品| 国产精品911| 欧美tk丨vk视频| 日本色综合中文字幕| 欧美又粗又大又爽| 亚洲欧美日韩电影| 成人av在线影院| 国产免费观看久久| 国产在线精品一区二区夜色| 欧美日韩一本到| 91精品欧美综合在线观看最新| 亚洲色图欧美激情| 91原创在线视频| 国产精品白丝在线| 国产寡妇亲子伦一区二区| 欧美大片在线观看一区| 天天操天天综合网| 欧美日韩aaa| 日本亚洲欧美天堂免费| 欧美二区三区的天堂| 偷拍自拍另类欧美| 日韩欧美一区二区三区在线|