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

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

?? ratecontrolledrouter.java

?? 實現網格環境下資源調度和分配的仿真
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
            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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产色产综合色产在线视频 | 欧美成人精品高清在线播放| 久久嫩草精品久久久久| 国产老妇另类xxxxx| 国产农村妇女毛片精品久久麻豆| 国产精品第四页| 亚洲午夜三级在线| 高清国产一区二区三区| 99久久久久免费精品国产| 欧美日韩综合不卡| 国产亚洲制服色| 亚洲综合一区二区| 国产精品夜夜爽| 欧美精选在线播放| 亚洲一区在线播放| 国产不卡视频在线播放| 欧美日韩不卡一区| 亚洲特黄一级片| 欧美日韩国产电影| 一区二区高清在线| 99国产精品99久久久久久| 欧美一级视频精品观看| 丝袜a∨在线一区二区三区不卡| 99久久伊人久久99| 国产欧美日韩另类视频免费观看 | 国产一区二区三区日韩| 在线观看中文字幕不卡| 亚洲精品中文在线观看| 99视频有精品| 国产精品久久久久婷婷| 成人免费视频播放| 国产精品水嫩水嫩| 国产福利一区在线| 久久色.com| 成人精品鲁一区一区二区| 国产欧美一区二区精品性| 欧美亚洲国产bt| 日日夜夜一区二区| 欧美夫妻性生活| 精品一区二区三区免费视频| 欧美本精品男人aⅴ天堂| 日本特黄久久久高潮| 欧美不卡123| 不卡视频一二三| 亚洲午夜精品17c| 欧美精品一区二区三区在线播放| 国产综合久久久久影院| 国产婷婷色一区二区三区四区| 国产a精品视频| 亚洲123区在线观看| 久久精品男人天堂av| 一本大道综合伊人精品热热| 午夜精品一区二区三区免费视频 | 国产成人免费在线观看| 亚洲婷婷综合久久一本伊一区| 欧美日韩一区二区三区免费看| 另类小说色综合网站| 亚洲日本一区二区| 久久久久国产免费免费| 欧美在线观看一区| 成人黄色软件下载| 久久99久久久久久久久久久| 亚洲欧洲精品天堂一级| 久久综合网色—综合色88| 欧美性xxxxxx少妇| 床上的激情91.| 久久超碰97中文字幕| 亚洲成人av免费| 亚洲日穴在线视频| 国产精品乱码一区二区三区软件| 日韩一区二区三区视频| 91精品国模一区二区三区| 欧美性大战久久久久久久| 色94色欧美sute亚洲13| 91社区在线播放| 91麻豆成人久久精品二区三区| 不卡的av电影在线观看| 成人app网站| 91传媒视频在线播放| 色综合色狠狠天天综合色| 91蝌蚪porny成人天涯| 色综合视频在线观看| 在线国产电影不卡| 91精品国产入口| 精品三级在线观看| 2014亚洲片线观看视频免费| 久久你懂得1024| 伊人色综合久久天天人手人婷| 一区二区三区四区不卡在线| 亚洲成人高清在线| 国产一区二区三区免费播放| 成人小视频在线| 欧美理论在线播放| 日韩欧美成人激情| 国产精品三级在线观看| 肉丝袜脚交视频一区二区| 国产精品亚洲一区二区三区在线| 成人开心网精品视频| 在线综合视频播放| 中文欧美字幕免费| 五月天亚洲精品| 91色porny蝌蚪| 欧美大片一区二区| 亚洲亚洲人成综合网络| 成人午夜精品一区二区三区| 91精品国产免费久久综合| 亚洲同性gay激情无套| 国产在线视频一区二区| 7777精品伊人久久久大香线蕉超级流畅 | 亚洲第一在线综合网站| 波多野结衣的一区二区三区| 欧美一区二区视频在线观看2022| 亚洲欧美日韩国产一区二区三区 | 日韩精品自拍偷拍| 婷婷一区二区三区| 欧美日韩一级二级| 亚洲线精品一区二区三区八戒| av午夜一区麻豆| 中文字幕亚洲在| 北条麻妃国产九九精品视频| 精品处破学生在线二十三| 亚洲h精品动漫在线观看| 欧美性三三影院| 日日摸夜夜添夜夜添国产精品| 精品视频在线视频| 天天影视网天天综合色在线播放| 欧美丝袜丝交足nylons图片| 一区二区三区91| 欧美一区二区视频免费观看| 免费人成精品欧美精品| 精品国产露脸精彩对白| 国产精品自拍三区| 国产精品初高中害羞小美女文| 成人国产一区二区三区精品| 国产精品不卡一区二区三区| 91高清视频免费看| 美女视频黄免费的久久| 久久精品一区二区三区四区| 99这里只有精品| 日韩成人免费看| 日本一区二区成人| 欧美巨大另类极品videosbest| 国产一区二区剧情av在线| 亚洲欧洲日韩女同| 精品卡一卡二卡三卡四在线| 91亚洲男人天堂| 久久99在线观看| 亚洲制服丝袜在线| 欧美激情一区二区在线| 欧美福利电影网| 欧美亚洲国产一区二区三区va| 国产在线精品免费| 午夜精品aaa| 亚洲精品免费在线观看| 久久综合久久综合九色| 91首页免费视频| 国产精品白丝jk白祙喷水网站| 日韩va欧美va亚洲va久久| 日韩理论片网站| 国产精品久久久久久久久久久免费看 | 国产精品国产自产拍高清av | 91福利在线看| av资源网一区| 岛国av在线一区| 韩国午夜理伦三级不卡影院| 蜜桃视频在线观看一区| 蜜桃精品在线观看| 蓝色福利精品导航| 九一久久久久久| 激情综合色综合久久综合| 久久精工是国产品牌吗| 免费久久99精品国产| 久久精品av麻豆的观看方式| 久久激情五月激情| 国产乱码精品一区二区三区忘忧草| 蜜臀精品久久久久久蜜臀| 久久99久久99| 成人国产精品免费观看动漫| 波多野结衣视频一区| 色av综合在线| 日韩免费看网站| 国产午夜一区二区三区| 亚洲男同性视频| 免费人成在线不卡| 国产成人精品网址| 欧美亚洲一区三区| 成人免费小视频| 午夜精品免费在线| 成人网男人的天堂| 91精品国产综合久久久蜜臀粉嫩| 久久久综合激的五月天| 亚洲午夜私人影院| 国产ts人妖一区二区| 欧美日韩久久久| 中文一区在线播放| 久久国产尿小便嘘嘘尿| 91国产成人在线| 国产精品美女一区二区| 久久精品国产99| 日韩一区二区在线免费观看|