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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? ratecontrolledrouter.java

?? 中間件開(kāi)發(fā)詳細(xì)說(shuō)明:清華大學(xué)J2EE教程講義(ppt)-Tsinghua University J2EE tutorial lectures (ppt) [上載源碼成為會(huì)員下載此源碼] [成為VIP會(huì)
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
            super.write("");            super.write("receive incoming, " + pkt + ", delay, " + nextTime);            super.write("break this packet into, " + numPackets);        }        // break a large packet into smaller ones that fit into MTU        // by making null or empty packets except for the last one        for (int i = 0; i < numPackets - 1; i++)        {            NetPacket np = new NetPacket(null, pkt.getID(), MTU, tag,                                         pkt.getSrcID(), pkt.getDestID(),                                         pkt.getNetServiceType(),i+1,numPackets);            np.setLast( super.get_id() );            if (super.reportWriter_ != null) {                super.write("enqueing, " + np);            }            // put the packet into the scheduler            super.sim_schedule(sched.getSchedID(),0,GridSimTags.SCHEDULER_ENQUE, np);        }        // put the actual packet into the last one and resize it accordingly        pkt.setLast( super.get_id() );        pkt.setSize(pkt.getSize() - MTU * (numPackets - 1));        if (super.reportWriter_ != null) {            super.write("enqueing, " + pkt);        }        // put the packet into the scheduler        super.sim_schedule(sched.getSchedID(),0,GridSimTags.SCHEDULER_ENQUE,pkt);    }    /**     * Gets the link's name for a given id     * @param destID    a destination id     * @return the link's man     * @pre destID > 0     * @post $none     */    private synchronized String getLinkName(int destID)    {        String destName = GridSim.getEntityName(destID);        String linkName = null;        //directly connected        if (hostTable_.containsValue(destName)) {            linkName = (String)linkTable_.get(destName);        }        else        {            // need to forward to another router            Object[] data = (Object[]) forwardTable_.get(destName);            String router = (String) data[0];            linkName = (String) linkTable_.get(router);        }        return linkName;    }    /**     * Returns the Scheduler associated with a packet.     *     * @param np NetPacket for which the associated scheduler is to be returned     * @return the packet's scheduler or <tt>null</tt> if the packet is empty     * @pre np != null     * @post $none     */    public PacketScheduler getScheduler(Packet np)    {        if (np == null) {            return null;        }        String destName = GridSim.getEntityName( np.getDestID() );        return getScheduler(destName);    }    /**     * Returns the Scheduler that the router would use to reach a particular     * destination. This can be used to set weigths, priorities etc. as the     * case may be on the Scheduler     *     * @param dest id of the destination for which the Scheduler is required.     * @return the destination's packet scheduler     * @pre dest > 0     * @post $none     */    public PacketScheduler getScheduler(int dest)    {        if (dest < 0) {            return null;        }        String destName = GridSim.getEntityName(dest);        return getScheduler(destName);    }    /**     * Returns the Scheduler that the router would use to reach a particular     * destination. This can be used to set weigths, priorities etc. as the     * case may be on the Scheduler     *     * @param dest Name of the destination for which the Scheduler is required.     * @return destination's packet scheduler or <tt>null</tt> if destination     *         name is invalid.     * @pre dest != null     * @post $none     */    public PacketScheduler getScheduler(String dest)    {        if (dest == null || dest.length() == 0) {            return null;        }        PacketScheduler sched = null;        try        {            if ( hostTable_.containsValue(dest) )            {                String linkName = (String) linkTable_.get(dest);                sched = (PacketScheduler) schedTable_.get(linkName);            }            else            {                // need to forward to another router                Object[] data = (Object[]) forwardTable_.get(dest);                // in case the forwarding table is incomplete                if (data == null) {                    return null;                }                String router = (String) data[0];                String linkName = (String) linkTable_.get(router);                sched = (PacketScheduler) schedTable_.get(linkName);            }        }        catch (Exception e)        {            sched = null;            System.out.println(super.get_name() + ".getScheduler(): exception");        }        return sched;    }    /**     * Dequeue a packet from the scheduler and sends it to the next     * destination via a link.     * @param sched  the packet scheduler     * @pre sched != null     * @post $none     */    private synchronized void dequeue(Sim_event ev)    {        Packet np = (Packet)ev.get_data();        // process ping() packet        if (np instanceof InfoPacket) {            ((InfoPacket) np).addExitTime( GridSim.clock() );        }        if (super.reportWriter_ != null) {            super.write("dequeuing, " + np);        }        // must distinguish between normal and junk packet        int tag = GridSimTags.PKT_FORWARD;        if (np.getTag() == GridSimTags.JUNK_PKT) {            tag = GridSimTags.JUNK_PKT;        }        // sends the packet via the link        String linkName = getLinkName( np.getDestID() );        super.sim_schedule(GridSim.getEntityId(linkName),                           GridSimTags.SCHEDULE_NOW, tag, np);    }    /**     * Prints this router's routing table in a nice-formatted layout     * @pre $none     * @post $none     */    public synchronized void printRoutingTable()    {        synchronized (System.out)        {            System.out.println();            System.out.println("--- Routing Table for " +                               super.get_name() + " ---");            for (Enumeration e = hostTable_.keys(); e.hasMoreElements(); )            {                String link = (String) e.nextElement();                System.out.println(hostTable_.get(link) + "\t\t" + link);            }            for (Enumeration e = forwardTable_.keys(); e.hasMoreElements(); )            {                String host = (String)e.nextElement();                Object[] data = (Object[])forwardTable_.get(host);                String nextHop = (String)data[0];                System.out.println(host + "\t\t" + nextHop);            }            System.out.println("-------------------------------------");            System.out.println();        }    }    //----------- ADVERTISING FUNCTIONS --------------//    /**     * All hosts connected to this router are advertised to adjacent routers     * @pre $none     * @post $none     */    protected synchronized void advertiseHosts()    {        Collection hosts = hostTable_.values(); // who to advertise        Enumeration routers = routerTable_.elements();        while ( routers.hasMoreElements() )        {            FloodAdPack ad = new FloodAdPack(super.get_name(), hosts);            String router = (String) routers.nextElement();            if (super.reportWriter_ != null) {                super.write("advertise to router, " + router);            }            sim_schedule(Sim_system.get_entity_id(router),                         GridSimTags.SCHEDULE_NOW, GridSimTags.ROUTER_AD, ad);        }        super.sim_pause(5);   // wait for 5 secs to gather the results    }    /**     * When an ad is recieved, the forwarding table is updated. After that we     * need to propogate this ad along all links except the incoming one.     * {@link #forwardAd(FloodAdPack)} is used for that     * @param ev  a Sim_event object     * @pre ev != null     * @post $none     */    private synchronized void receiveAd(Sim_event ev)    {        if (super.reportWriter_ != null) {            super.write("receive router ad from, " +                GridSim.getEntityName(ev.get_src()) );        }        // what to do when an ad is received        FloodAdPack ad = (FloodAdPack) ev.get_data();        // prevent count-to-infinity        if (ad.getHopCount() > 15) {            return;        }        String sender = ad.getSender();        Iterator it = ad.getHosts().iterator();        while ( it.hasNext() )        {            String host = (String) it.next();            if ( host.equals(super.get_name()) ) {                continue;            }            if (hostTable_.containsValue(host)) { // direct connection                continue;            }            if (forwardTable_.containsKey(host))            {                Object[] data = (Object[])forwardTable_.get(host);                int hop = ((Integer)data[1]).intValue();                if ((hop) > ad.getHopCount())                {                    Object[] toPut = { sender, new Integer(ad.getHopCount()) };                    forwardTable_.put(host, toPut);                }            }            else            {                Object[] toPut = { sender, new Integer(ad.getHopCount()) };                forwardTable_.put(host, toPut);            }        }        forwardAd(ad);    }    /**     * Received ads should be forwarded along all links except the incoming     * one. Also need to change id to onself     *     * @param ad    a FloodAdPack object     * @pre ad != null     * @post $none     */    private synchronized void forwardAd(FloodAdPack ad)    {        String sender = ad.getSender();        ad.incrementHopCount();        FloodAdPack newad = new FloodAdPack(super.get_name(), ad.getHosts());        newad.setHopCount(ad.getHopCount());        Enumeration routers = routerTable_.elements();        while ( routers.hasMoreElements() )        {            String router = (String)routers.nextElement();            if (!router.equals(sender))            {                sim_schedule(Sim_system.get_entity_id(router),                      GridSimTags.SCHEDULE_NOW, GridSimTags.ROUTER_AD, newad);            }        }    }    /**     * Informs the registered entities regarding to the end of a simulation.     * @pre $none     * @post $none     */    protected void processEndSimulation()    {        Enumeration scheds = schedTable_.elements();        while (scheds.hasMoreElements())        {            PacketScheduler sched = (PacketScheduler) scheds.nextElement();            sim_schedule(sched.getSchedID(), 0, GridSimTags.END_OF_SIMULATION);        }    }} // end class

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91视频在线观看| 国产精品欧美一级免费| 在线亚洲人成电影网站色www| 国产成人在线色| 韩国成人在线视频| 国内不卡的二区三区中文字幕 | 日韩午夜小视频| 在线不卡中文字幕| 91精品久久久久久蜜臀| 91精品国产日韩91久久久久久| 欧美另类videos死尸| 91精品国产91综合久久蜜臀| 91精品国产91热久久久做人人 | 国产三级三级三级精品8ⅰ区| 精品捆绑美女sm三区| 2017欧美狠狠色| 国产欧美视频一区二区三区| 一区二区中文视频| 亚洲制服丝袜一区| 亚洲国产综合人成综合网站| 亚瑟在线精品视频| 九九热在线视频观看这里只有精品| 黄色小说综合网站| 成人av电影免费观看| 99re成人在线| 欧美日韩视频在线一区二区| 欧美高清激情brazzers| 久久天天做天天爱综合色| 中文av一区二区| 一区二区三区免费在线观看| 日韩精品亚洲一区二区三区免费| 久久国产精品第一页| 国产99久久久国产精品免费看| 99精品视频在线播放观看| 欧美午夜在线观看| 日韩免费观看高清完整版在线观看| 国产欧美日韩视频一区二区| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲成人一区在线| 国产一区二区三区在线观看免费视频| 成人精品国产福利| 欧美日韩成人综合在线一区二区 | 亚洲欧美另类综合偷拍| 午夜日韩在线电影| 国产大片一区二区| 91丨九色丨国产丨porny| 91精品国产乱| 亚洲欧洲av在线| 日本成人中文字幕| 成人av电影在线观看| 91精品欧美久久久久久动漫| 欧美激情一区二区三区全黄| 天天操天天综合网| 不卡视频一二三| 日韩一区二区免费视频| 成人免费小视频| 韩国精品一区二区| 欧美视频一区二区三区四区| 久久久久久久久久久久久夜| 亚洲成人福利片| 丰满少妇久久久久久久| 欧美精品色一区二区三区| 欧美国产精品劲爆| 男女男精品网站| 91免费观看视频| 久久精品人人做人人爽人人| 亚洲成a人v欧美综合天堂| 国产不卡在线视频| 91精品国产免费| 亚洲九九爱视频| 国产不卡视频在线播放| 日韩欧美在线123| 亚洲一区二区三区在线| 成人福利电影精品一区二区在线观看| 欧美精品电影在线播放| 一区二区三区四区在线播放| 国产高清不卡二三区| 欧美岛国在线观看| 同产精品九九九| 在线区一区二视频| 17c精品麻豆一区二区免费| 国产一区二区女| 日韩欧美国产综合一区| 丝袜国产日韩另类美女| 一本大道久久a久久综合婷婷| 国产三级欧美三级日产三级99 | 一本色道久久加勒比精品 | 一区二区三区中文免费| 国产成人超碰人人澡人人澡| 精品区一区二区| 蜜芽一区二区三区| 欧美日本韩国一区二区三区视频| 亚洲啪啪综合av一区二区三区| 国产成人免费在线视频| 久久综合久久综合九色| 久久成人av少妇免费| 日韩欧美中文字幕一区| 麻豆一区二区在线| 欧美一区二区播放| 免费一级欧美片在线观看| 欧美精品第1页| 日韩精品一二三区| 欧美一区二区视频网站| 美女一区二区视频| 日韩欧美国产精品| 精品一区二区影视| 欧美精品一区二区在线播放| 久久99精品久久久久久动态图| 日韩一区二区精品葵司在线| 手机精品视频在线观看| 欧美日韩国产大片| 日精品一区二区三区| 4438x亚洲最大成人网| 日韩**一区毛片| 欧美一级一级性生活免费录像| 蜜臀av性久久久久蜜臀aⅴ四虎 | 久久久精品免费免费| 国产高清不卡一区二区| 中文字幕一区二区在线观看| 91麻豆蜜桃一区二区三区| 亚洲激情图片一区| 欧美精选一区二区| 国产一区二区三区黄视频 | 福利视频网站一区二区三区| 亚洲欧洲成人精品av97| 欧美综合天天夜夜久久| 香蕉加勒比综合久久| 欧美成人一级视频| 成人黄色小视频在线观看| 亚洲视频精选在线| 欧美军同video69gay| 免费的国产精品| 国产亚洲欧美中文| 色伊人久久综合中文字幕| 丝袜诱惑亚洲看片| 精品国产网站在线观看| www.欧美.com| 亚洲va欧美va人人爽午夜| 7799精品视频| 成人一级视频在线观看| 亚洲国产精品久久艾草纯爱 | 亚洲在线视频一区| 欧美不卡一区二区三区四区| 成人三级伦理片| 亚洲一区影音先锋| 欧美va亚洲va香蕉在线| 成人在线一区二区三区| 亚洲高清免费在线| 国产日韩精品一区二区三区在线| 91福利在线看| 国产精品主播直播| 亚洲一区精品在线| 久久先锋影音av| 欧美视频在线不卡| 国产福利一区二区三区在线视频| 亚洲一区二区三区自拍| 国产偷国产偷亚洲高清人白洁 | 亚洲午夜免费电影| www久久久久| 欧美视频日韩视频在线观看| 国产专区综合网| 亚洲成人精品影院| 国产精品短视频| 日韩欧美亚洲一区二区| 色激情天天射综合网| 国产美女一区二区| 天堂一区二区在线免费观看| 亚洲国产高清在线观看视频| 7777精品伊人久久久大香线蕉超级流畅| 成人激情文学综合网| 久久疯狂做爰流白浆xx| 亚洲五码中文字幕| 国产精品久久毛片a| 日韩无一区二区| 91国产免费观看| 粉嫩av亚洲一区二区图片| 麻豆成人91精品二区三区| 亚洲国产精品一区二区www| 国产精品无人区| 精品国产一区二区三区久久久蜜月| 欧美日韩一级大片网址| 一本到不卡免费一区二区| 成人av在线一区二区三区| 黄色日韩三级电影| 日本成人在线视频网站| 亚洲电影第三页| 亚洲狠狠丁香婷婷综合久久久| 日本一区二区视频在线| 26uuu亚洲| 日韩美女一区二区三区四区| 精品视频免费在线| 色爱区综合激月婷婷| www.色综合.com| 成人高清视频免费观看| 国产a级毛片一区| 国产91精品一区二区麻豆网站 | 国产精品综合在线视频| 麻豆精品久久精品色综合| 视频在线观看91| 性做久久久久久免费观看欧美|