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

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

?? floodingrouter.java

?? 中間件開發詳細說明:清華大學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一区二区三区免费野_久草精品视频
精品久久久久99| 不卡的av电影在线观看| 成人免费观看视频| 国产欧美日本一区视频| 亚洲永久精品大片| 成人99免费视频| 精品国产a毛片| 国产精品久久久久aaaa| 亚洲成人www| 欧美精品免费视频| 久久精品久久99精品久久| 在线不卡欧美精品一区二区三区| 一区二区三国产精华液| 精品视频一区二区三区免费| 日韩美女主播在线视频一区二区三区 | 精品国产91亚洲一区二区三区婷婷| 蜜臀va亚洲va欧美va天堂 | 亚洲午夜精品在线| 欧美日韩1234| 国产精品一级在线| 亚洲国产精品一区二区www在线| 欧美一区二区三区成人| 国内成人自拍视频| 亚洲成av人片在线| 337p亚洲精品色噜噜噜| av欧美精品.com| 日本视频中文字幕一区二区三区| 最新国产精品久久精品| 精品一区二区三区免费视频| 精品少妇一区二区| 国产一二三精品| 中文字幕佐山爱一区二区免费| fc2成人免费人成在线观看播放 | 色欲综合视频天天天| 精品欧美乱码久久久久久| 亚洲综合色在线| 久久综合久久鬼色中文字| 国产精品综合一区二区三区| 久久久久久夜精品精品免费| av在线播放成人| 国产精品资源网| 亚洲sss视频在线视频| 日韩视频在线你懂得| av在线这里只有精品| 石原莉奈在线亚洲二区| 精品国产成人在线影院| 91麻豆swag| 91在线观看美女| 国产精品1024| 国产乱理伦片在线观看夜一区| 亚洲精品中文在线| **性色生活片久久毛片| 精品福利在线导航| 久久先锋影音av| 成人国产精品免费网站| 久久福利资源站| 婷婷综合久久一区二区三区| 亚洲综合免费观看高清完整版| 国产欧美精品在线观看| 国产精品嫩草99a| 中文字幕的久久| 亚洲男女毛片无遮挡| 欧美国产禁国产网站cc| 亚洲一区免费视频| 成人国产精品免费观看动漫| 欧美日韩精品一区二区三区四区| 91久久精品一区二区三| 国产超碰在线一区| 99久久亚洲一区二区三区青草| 国产福利一区在线| 成人免费福利片| 欧美无乱码久久久免费午夜一区| 在线观看国产精品网站| 91精品国产综合久久久久久漫画 | 亚洲欧洲成人自拍| 精品一区二区影视| 精品一区二区三区在线播放| av不卡免费电影| 久久亚洲欧美国产精品乐播| 亚洲va天堂va国产va久| 91在线高清观看| 久久99精品久久久久久久久久久久| 欧美a级理论片| 欧美美女一区二区| 亚洲18女电影在线观看| 91浏览器在线视频| 亚洲一区在线看| 在线观看一区二区精品视频| 亚洲欧美日韩久久精品| 91热门视频在线观看| 亚洲国产精品激情在线观看| 国产欧美一区二区精品性| 亚洲日本韩国一区| 久久国产精品色| 欧美精品精品一区| 亚洲天堂久久久久久久| 九色综合国产一区二区三区| 色一情一伦一子一伦一区| 777亚洲妇女| 亚洲韩国一区二区三区| 成人99免费视频| 国产精品视频九色porn| 国产成人av资源| 久久精品欧美日韩| 伊人婷婷欧美激情| 国产精品99久久久久久久vr| 日韩欧美亚洲国产精品字幕久久久| 亚洲精品中文字幕在线观看| 高清成人在线观看| 亚洲另类在线视频| 欧美系列在线观看| 久久99精品久久久久久国产越南| 亚洲欧美日韩久久精品| 日韩成人午夜电影| 欧美日本一区二区在线观看| 一区二区三区在线免费观看| www.亚洲色图.com| 亚洲免费观看高清完整版在线观看熊 | 日本亚洲电影天堂| 日韩欧美一级片| 不卡av在线网| 极品少妇xxxx偷拍精品少妇| 亚洲美女区一区| 2021中文字幕一区亚洲| 国产成人精品一区二| 成人午夜激情视频| 欧美日韩国产综合一区二区 | 日本aⅴ免费视频一区二区三区 | 午夜精品久久久久影视| 成人性生交大片免费| 国产三级一区二区三区| 国产伦精品一区二区三区免费| 91精选在线观看| 国产一区 二区 三区一级| 欧美成人一区二区三区在线观看 | 韩国v欧美v日本v亚洲v| 日韩精品中文字幕一区二区三区| 亚洲电影一级黄| 精品久久久久一区| 3atv在线一区二区三区| 中文字幕欧美激情| 美女视频一区在线观看| 久久你懂得1024| 欧美日韩高清在线| 欧美图区在线视频| 在线观看www91| 91视频观看视频| 97久久精品人人澡人人爽| 欧美亚洲禁片免费| 丝袜亚洲另类欧美| 国产精品色在线观看| 欧洲生活片亚洲生活在线观看| 蜜桃精品视频在线观看| 亚洲欧美怡红院| 欧美极品aⅴ影院| 久久综合色播五月| 国产91在线观看| 午夜精品成人在线| 久久中文娱乐网| 日韩一区二区三区精品视频| 国产成人日日夜夜| 激情欧美日韩一区二区| 欧美日韩亚洲另类| 日韩国产成人精品| www.亚洲精品| 亚洲va天堂va国产va久| 日韩精品一区第一页| 日产欧产美韩系列久久99| 蜜臀va亚洲va欧美va天堂| 蜜桃精品在线观看| 国产精品一二三四| voyeur盗摄精品| 欧美天堂亚洲电影院在线播放| 91精品欧美一区二区三区综合在| 日韩免费成人网| 亚洲三级理论片| 一区二区三区久久久| 亚洲午夜一区二区| 欧美aa在线视频| 成人激情校园春色| 国产日韩精品视频一区| 精品视频1区2区3区| 欧美高清激情brazzers| 精品日韩99亚洲| 不卡一区二区在线| 国产jizzjizz一区二区| 5566中文字幕一区二区电影 | 久久99精品久久久久久久久久久久| 天堂成人免费av电影一区| 视频一区在线播放| 国产suv精品一区二区三区| 成熟亚洲日本毛茸茸凸凹| 成人性生交大合| 亚洲私人黄色宅男| 亚洲成人免费在线观看| 国产精品456露脸| 91麻豆精品国产综合久久久久久| 亚洲精品国久久99热| 亚洲精品免费一二三区| 五月开心婷婷久久|