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

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

?? riprouter.java

?? 實(shí)現(xiàn)網(wǎng)格環(huán)境下資源調(diào)度和分配的仿真
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
        // log / record ....        if (super.reportWriter_ != null)        {            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(id);            super.write("enqueing, " + np);            sched.enque(np);  // put the packet into the scheduler        }        // put the actual packet into the last one and resize it accordingly        pkt.setLast(id);        pkt.setSize(pkt.getSize() - MTU * (numPackets - 1));        super.write("enqueing, " + pkt);        sched.enque(pkt);  // put the packet into the scheduler    }    /**     * 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;        }        return sched;    }    /**     * Processes internal event     * @param ev    a Sim_event object     * @pre ev != null     * @post $none     */    private synchronized void processInternalEvent(Sim_event ev)    {        PacketScheduler sched = (PacketScheduler) ev.get_data();        dequeue(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(PacketScheduler sched)    {        Packet np = sched.deque();        // process ping() packet        if (np instanceof InfoPacket) {            ((InfoPacket) np).addExitTime( GridSim.clock() );        }        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);        // process the next packet in the scheduler        if ( !sched.isEmpty() )        {            double nextTime = (np.getSize() * BITS) / sched.getBaudRate();            sendInternalEvent(nextTime, sched);        }    }    /**     * Sends an internal event to itself     * @param time  the delay time period     * @param data  the data to be sent     * @return <tt>true</tt> if it is successful, <tt>false</tt> otherwise     * @pre time >= 0     * @post $none     */    private synchronized boolean sendInternalEvent(double time, Object data)    {        if (time < 0.0) {            return false;        }        super.sim_schedule(id, time, GridSimTags.INSIGNIFICANT, data);        return true;    }    /**     * 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() )        {            RIPAdPack ad = new RIPAdPack(super.get_name(), hosts);            String router = (String) routers.nextElement();            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(RIPAdPack)} is used for that     * @param ev  a Sim_event object     * @pre ev != null     * @post $none     */    private synchronized void receiveAd(Sim_event ev)    {        super.write("receive router ad from, "+GridSim.getEntityName(ev.get_src()));        // what to do when an ad is received        RIPAdPack ad = (RIPAdPack)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 RIPAdPack object     * @pre ad != null     * @post $none     */    private synchronized void forwardAd(RIPAdPack ad)    {        String sender = ad.getSender();        ad.incrementHopCount();        RIPAdPack newad = new RIPAdPack(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);            }        }    }} // end class

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区视频免费观看| 亚洲欧洲99久久| 欧美日韩一区二区电影| 91丨九色porny丨蝌蚪| 懂色av一区二区三区蜜臀| 国产在线国偷精品免费看| 捆绑变态av一区二区三区| 亚洲成av人综合在线观看| 亚洲一区二区三区视频在线播放| 国产精品高清亚洲| 国产欧美一区二区精品性色超碰| 欧美成人精品1314www| 91精品欧美福利在线观看| 欧美夫妻性生活| 欧美日本免费一区二区三区| 欧美日韩免费电影| 欧美精品vⅰdeose4hd| 7777精品伊人久久久大香线蕉超级流畅| 在线观看日韩毛片| 欧美视频精品在线观看| 欧美日本韩国一区| 91精品国产丝袜白色高跟鞋| 91精品国产欧美日韩| 欧美α欧美αv大片| 91麻豆精品国产综合久久久久久| 欧美一级高清大全免费观看| 精品国产一二三区| 久久精品欧美一区二区三区不卡| 久久久不卡网国产精品二区| 中文字幕免费不卡| 亚洲人成伊人成综合网小说| 亚洲综合色丁香婷婷六月图片| 午夜a成v人精品| 青青草国产精品亚洲专区无| 久88久久88久久久| 国产精品一级二级三级| 不卡的av在线播放| 欧美午夜宅男影院| 日韩欧美一级二级| 国产视频亚洲色图| 亚洲视频每日更新| 午夜精品久久久久久久蜜桃app| 日本v片在线高清不卡在线观看| 国产综合色在线视频区| 国产99久久久精品| 欧洲另类一二三四区| 日韩一级黄色大片| 国产精品午夜久久| 亚洲电影欧美电影有声小说| 久久精品国产秦先生| 99热在这里有精品免费| 欧美二区乱c少妇| 国产亚洲视频系列| 亚洲综合激情另类小说区| 麻豆一区二区三区| 99精品国产视频| 欧美一级二级三级蜜桃| 国产精品日韩成人| 亚洲国产欧美在线| 国产suv一区二区三区88区| 精品1区2区3区| 久久久精品免费观看| 亚洲国产乱码最新视频 | 亚洲gay无套男同| 国内精品久久久久影院色| 99久久er热在这里只有精品66| 欧美精品免费视频| 国产性色一区二区| 婷婷一区二区三区| 国产99精品国产| 欧美电影在哪看比较好| 国产精品乱码一区二区三区软件 | 亚洲午夜精品在线| 精品中文av资源站在线观看| 91黄色小视频| 精品日产卡一卡二卡麻豆| 亚洲黄色尤物视频| 成人国产精品免费观看| 日韩一级欧美一级| 亚洲国产另类精品专区| 91色在线porny| 久久亚区不卡日本| 日日夜夜精品视频免费| 91高清在线观看| 日本一区二区不卡视频| 国内精品第一页| 91麻豆精品国产91久久久资源速度 | 69堂国产成人免费视频| 欧美在线视频你懂得| 在线亚洲一区二区| 欧美性生交片4| 欧美日本国产一区| 日韩午夜在线播放| 久久亚洲免费视频| 日韩精品午夜视频| 亚洲韩国一区二区三区| 亚洲影院久久精品| 亚洲成人一区二区| 蜜臀久久久99精品久久久久久| 成人欧美一区二区三区小说| 奇米四色…亚洲| 欧美影视一区在线| 亚洲靠逼com| 北条麻妃一区二区三区| 国产精品视频线看| 国产精品一区二区久久精品爱涩| 久久影音资源网| 国产精品中文字幕欧美| 国产午夜精品一区二区三区视频| 国产麻豆精品久久一二三| 精品国产一区久久| 国产在线麻豆精品观看| 久久综合久久久久88| 国产在线视频不卡二| 国产亚洲va综合人人澡精品| 国产精品资源网| 久久毛片高清国产| 国产精品99久| 中文字幕免费在线观看视频一区| 成人小视频免费在线观看| 国产精品亲子乱子伦xxxx裸| 成人三级在线视频| 中文字幕日本乱码精品影院| 色婷婷久久久久swag精品| 亚洲午夜精品一区二区三区他趣| 欧美日韩色综合| 日韩中文字幕麻豆| 欧美tickling网站挠脚心| 国产成人自拍在线| 中文字幕日本不卡| 欧美日韩中字一区| 蜜桃视频免费观看一区| 久久色在线观看| 成人免费毛片高清视频| 亚洲女人****多毛耸耸8| 欧美亚洲愉拍一区二区| 日韩在线播放一区二区| 欧美变态凌虐bdsm| 成人午夜视频福利| 一区二区理论电影在线观看| 欧美一区二区三区四区五区| 久久av中文字幕片| 国产精品欧美经典| 在线观看欧美精品| 美国毛片一区二区三区| 亚洲国产成人午夜在线一区| 91九色最新地址| 亚洲成人福利片| 精品久久久影院| 91论坛在线播放| 天天色天天操综合| 久久精品欧美一区二区三区不卡 | 国内精品伊人久久久久av一坑| 国产女同互慰高潮91漫画| 一本久久综合亚洲鲁鲁五月天 | 亚洲成a人片在线观看中文| 这里只有精品电影| 538prom精品视频线放| 亚洲色图制服诱惑| 国产高清一区日本| 日韩精品一区二区三区中文不卡| 五月天亚洲婷婷| 在线观看不卡一区| 中文字幕一区二区三区视频 | 天天操天天综合网| 在线免费av一区| 亚洲精选视频免费看| 99久久99久久精品免费观看 | 在线看不卡av| 国模娜娜一区二区三区| 亚洲午夜成aⅴ人片| 久久精品视频一区| 欧美一三区三区四区免费在线看| 91网站最新地址| 久久精品国产在热久久| 亚洲午夜久久久久久久久久久 | 久久国产精品区| 亚洲美女区一区| 国产亚洲精品久| 欧美一区二区三区免费在线看| caoporen国产精品视频| 久久机这里只有精品| 亚洲一区二区三区美女| 中文字幕不卡三区| 精品欧美一区二区在线观看| 欧美日韩高清在线播放| 91社区在线播放| 高清国产一区二区三区| 裸体健美xxxx欧美裸体表演| 夜夜嗨av一区二区三区四季av| 国产精品免费久久| 欧美不卡视频一区| 欧美蜜桃一区二区三区| 91黄色激情网站| 99精品欧美一区二区三区综合在线| 国产成人精品一区二| 国产综合久久久久影院| 青草av.久久免费一区| 一区二区三区美女| 成人免费小视频|