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

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

?? router.java

?? 中間件開發(fā)詳細說明:清華大學J2EE教程講義(ppt)-Tsinghua University J2EE tutorial lectures (ppt) [上載源碼成為會員下載此源碼] [成為VIP會
?? JAVA
字號:
/* * ** 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 * * Router.java - Simulates a network router * */package gridsim.net;import eduni.simjava.*;import gridsim.*;import gridsim.util.SimReport;import java.util.*;/** * This class implements a Router which forwards data from one entity to * another. * <p> * This abstract class only contains abstract methods to connect other * routers and hosts. In addition, common functionalities are available * in this class for its children classes to use. * However, this class does not provide methods on how to setup forwarding * tables, so the design of that is left to the user if he/she wants to * create a Router with some specific routing algorithm. * <p> * Few important notes to consider when extending from this class: * <ul> * <li>do not override {@link #body()} method as *     it contains code/functionality to register this entity to *     {@link gridsim.GridInformationService} entity, and finalizing *     logging information before exiting the simulation. * <li>must overridden {@link #advertiseHosts()} method. It is *     needed for advertising all hosts or *     entities connected to this entity to adjacent routers. * <li>{@link #registerOtherEntity()} method : for registering other *     event type/tag to {@link gridsim.GridInformationService}. *     This is optional. * <li>must overridden {@link #processEvent(Sim_event)} method. *     It is needed for processing incoming events. * <li>do not forget to implement logging or recording functionalities *     for incoming and outgoing packets. <br> *     {@link gridsim.util.SimReport} object is created in this class, *     hence, you only need to use {@link #write(String)} method. * </ul> * * @invariant $none * @since GridSim Toolkit 3.1 * @author Gokul Poduval & Chen-Khong Tham, National University of Singapore */public abstract class Router extends Sim_entity{    /** An attribute that logs incoming and outgoing packets into a file.     * Use {@link #write(String)} to log or record the information.     */    protected SimReport reportWriter_;    /** Denotes a time delay (in second) for sending events in the future. */    protected static int DELAY = 2;  // in seconds    /**     *Creates a new RIPRouter 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 #Router(String, boolean)}.     *     * @param name Name of this router     * @throws NullPointerException This happens when name is empty or null     * @see #Router(String, boolean)     * @pre name != null     * @post $none     */    public Router(String name) throws NullPointerException    {        super(name);        reportWriter_ = null;    }    /**     * Creates a new Router 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 Router(String name, boolean trace) throws NullPointerException    {        super(name);        try        {            if (trace == true) {                reportWriter_ = new SimReport(name + "_report");            }            else {                reportWriter_ = null;            }        }        catch (Exception e)        {            System.out.println(name + "(): Exception error.");            System.out.println( e.getMessage() );            reportWriter_ = null;        }    }    /**     * 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 abstract void attachRouter(Router router, Link link,                PacketScheduler thisSched, PacketScheduler 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 abstract void attachRouter(Router router, Link link,                PacketScheduler sched);    /**     * 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 abstract void attachHost(GridSimCore entity, PacketScheduler sched);    /**     * Returns the Scheduler associated with a packet. Each packet has a     * destination. The router returns the scheduler that it would use to     * scheduler this packet if it were traversing this router. Once a     * reference to the scheduler is obtained, different parameters     * (like priorities, weights etc.) could be modified.     *     * @param np    NetPacket for which the associated scheduler is to be     *              returned. This can be used to set weigths, priorities, etc.     *              as the case may be on the Scheduler.     * @return the packet's scheduler     * @pre np != null     * @post $none     */    public abstract PacketScheduler getScheduler(Packet np);    /**     * Returns the Scheduler that the router would use to reach a particular     * destination. Once a reference to the scheduler is obtained, different     * parameters (like priorities, weights etc.) could be modified.     *     * @param dest  id of the destination for which the Scheduler is required.     * @return the packet's scheduler     * @pre dest > 0     * @post $none     */    public abstract PacketScheduler getScheduler(int dest);    /**     * 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 the packet's scheduler     * @pre dest != null     * @post $none     */    public abstract PacketScheduler getScheduler(String dest);    /**     * This method prints out the forwarding table of the router in a human     * readable form.     * @pre $none     * @post $none     */    public abstract void printRoutingTable();    /**     * Handles incoming requests. <b>DO NOT</b> overrides this method as     * it contains code/functionality to register this entity to     * {@link gridsim.GridInformationService} entity, and finalizing     * logging information before exiting the simulation.     * <p>     * This method also calls these methods in the following order:     * <ol>     * <li>must overridden {@link #advertiseHosts()} method. It is     *     needed for advertising all hosts or     *     entities connected to this entity to adjacent routers.     * <li> {@link #registerOtherEntity()} method : for registering other     *      event type/tag to {@link gridsim.GridInformationService}.     *      This is optional.     * <li>must overridden {@link #processEvent(Sim_event)} method.     *     It is needed for processing incoming events.     * </ol>     *     * @pre $none     * @post $none     */    public void body()    {        //register oneself        write("register this entity to GridInformationService entity.");        super.sim_schedule(GridSim.getGridInfoServiceEntityId(),                GridSimTags.SCHEDULE_NOW, GridSimTags.REGISTER_ROUTER,                new Integer(super.get_id()) );        // methods to be overriden by children classes        advertiseHosts();        registerOtherEntity();        // Process incoming events        Sim_event ev = new Sim_event();        while ( Sim_system.running() )        {            //Sim_event ev = new Sim_event();            super.sim_get_next(ev);            // if the simulation finishes then exit the loop            if (ev.get_tag() == GridSimTags.END_OF_SIMULATION)            {                write("receives, END_OF_SIMULATION, signal, from, " +                      GridSim.getEntityName(ev.get_src()) );                processEndSimulation();                break;            }            // process the received event            processEvent(ev);        }        // finalize logging before exiting        if (reportWriter_ != null) {            reportWriter_.finalWrite();        }    }    /**     * All hosts connected to this router are advertised to adjacent routers     * @pre $none     * @post $none     */    protected abstract void advertiseHosts();    /**     * Overrides this method when creating a new type of router.     * This method is called by {@link #body()} for incoming unknown tags.     * <p>     * The services or tags available for this resource are:     * <ul>     * <li> {@link gridsim.GridSimTags#PKT_FORWARD}     * <li> {@link gridsim.GridSimTags#JUNK_PKT}     * <li> {@link gridsim.GridSimTags#ROUTER_AD}     * </ul>     *     * @param ev   a Sim_event object     * @pre ev != null     * @post $none     */    protected abstract void processEvent(Sim_event ev);    /**     * Overrides this method when making a type of router.     * This method is called by {@link #body()} to register other type to     * {@link gridsim.GridInformationService} entity. In doing so, you     * need to create a new child class extending from     * {@link gridsim.GridInformationService}.     * <br>     * <b>NOTE:</b> You do not need to override {@link #body()} method, if     * you use this method.     *     * @pre $none     * @post $none     * @see gridsim.GridInformationService     */    protected void registerOtherEntity() {        // ... empty    }    /**     * Writes a debug information to a file.     * The format of information is left to the coder.     *     * @param str  a string message     * @pre str != null     * @post $none     */    protected void write(String str)    {        if (reportWriter_ != null) {            reportWriter_.write(str);        }    }    /**     * Informs the registered entities regarding to the end of a simulation.     * @pre $none     * @post $none     */    protected abstract void processEndSimulation();} // end class

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日本亚洲高清| 亚洲激情图片qvod| 色婷婷激情综合| 精品制服美女久久| 亚洲欧美日韩国产中文在线| 久久色在线视频| 欧美丰满一区二区免费视频| av一区二区久久| 国产一区不卡视频| 青青草原综合久久大伊人精品 | 国产精品色在线观看| 3d成人动漫网站| 91色porny在线视频| 国产福利电影一区二区三区| 日本中文字幕一区| 一区二区在线观看免费| 国产精品妹子av| 国产欧美日韩激情| 日韩精品中文字幕一区| 欧美美女网站色| 一本色道久久综合狠狠躁的推荐| 国产精品1区2区| 国精产品一区一区三区mba视频| 亚洲午夜久久久久久久久久久 | 欧美一二三区精品| 91麻豆国产在线观看| 成人黄色网址在线观看| 国产麻豆精品在线| 久久国产精品露脸对白| 五月天婷婷综合| 天堂蜜桃91精品| 亚洲国产美国国产综合一区二区| 亚洲视频综合在线| 亚洲欧美日韩小说| 亚洲摸摸操操av| 亚洲精品大片www| 亚洲欧美日韩一区二区三区在线观看| 综合精品久久久| 亚洲欧洲综合另类| 亚洲精品综合在线| 亚洲永久免费av| 三级久久三级久久久| 婷婷国产在线综合| 日韩在线一二三区| 蜜臀久久99精品久久久久久9| 日韩福利电影在线| 麻豆精品国产传媒mv男同| 免费成人在线播放| 色av一区二区| 欧美精品色一区二区三区| 欧美高清视频www夜色资源网| 91精品国产91热久久久做人人 | 欧美性受xxxx| 538prom精品视频线放| 日韩视频免费观看高清完整版在线观看| 欧美精品丝袜久久久中文字幕| 日韩欧美区一区二| 国产欧美一区二区精品忘忧草| 中文字幕一区av| 亚洲成人av资源| 国产在线精品视频| 不卡视频一二三| 欧美麻豆精品久久久久久| 欧美岛国在线观看| 中文字幕一区二区三区在线播放| 一区二区三区四区不卡视频| 日韩一区精品字幕| 黄色精品一二区| 91亚洲精品久久久蜜桃| 欧美日韩亚洲不卡| 久久久国产精品麻豆| 日韩美女久久久| 日本va欧美va欧美va精品| 国产999精品久久久久久绿帽| 色综合久久88色综合天天| 6080午夜不卡| 亚洲同性gay激情无套| 日韩精品一级二级| 成人黄色在线看| 91精品国产综合久久久久久| 欧美国产1区2区| 亚洲成人av福利| 成人v精品蜜桃久久一区| 欧美另类高清zo欧美| 国产日韩欧美激情| 日韩国产精品大片| 成人性视频网站| 在线不卡的av| 亚洲欧美欧美一区二区三区| 美女视频一区二区| 日本丰满少妇一区二区三区| 精品国产三级电影在线观看| 色婷婷久久综合| 国产精品888| 国产一区二区三区在线看麻豆 | 99视频精品在线| 在线播放中文一区| 综合电影一区二区三区| 久久精品国产色蜜蜜麻豆| 在线免费观看不卡av| 国产欧美综合在线| 日本不卡视频一二三区| 91麻豆成人久久精品二区三区| 久久久久国产成人精品亚洲午夜| 午夜精品一区二区三区电影天堂| 99在线精品视频| 久久日一线二线三线suv| 日本vs亚洲vs韩国一区三区二区 | 久久精品国产秦先生| 在线中文字幕不卡| 中文字幕在线不卡视频| 国产精品996| 亚洲v日本v欧美v久久精品| jlzzjlzz欧美大全| 国产视频亚洲色图| 久久国产精品72免费观看| 88在线观看91蜜桃国自产| 一区二区三区高清在线| 99久久综合狠狠综合久久| 欧美经典一区二区三区| 极品少妇一区二区三区精品视频| 欧美剧在线免费观看网站| 亚洲电影中文字幕在线观看| 色噜噜夜夜夜综合网| 亚洲日韩欧美一区二区在线| www.色综合.com| 国产精品毛片久久久久久| 国产黑丝在线一区二区三区| 久久综合五月天婷婷伊人| 久久精品国产99| 欧美成人一区二区三区| 蜜桃91丨九色丨蝌蚪91桃色| 日韩天堂在线观看| 免费成人结看片| 日韩欧美一区二区视频| 裸体歌舞表演一区二区| 精品日韩欧美一区二区| 国产精品资源在线观看| 国产三级三级三级精品8ⅰ区| 国产精品99久久久久久有的能看| 国产偷国产偷精品高清尤物 | 亚洲婷婷综合色高清在线| www.99精品| 亚洲品质自拍视频网站| 在线视频亚洲一区| 亚洲福利视频三区| 69成人精品免费视频| 男人操女人的视频在线观看欧美| 日韩一区二区免费在线电影| 国内精品免费在线观看| 国产午夜久久久久| 不卡高清视频专区| 亚洲综合色在线| 欧美一区二区三区免费在线看 | 亚洲国产成人av好男人在线观看| 欧美三级日韩在线| 免费在线欧美视频| 精品处破学生在线二十三| 国产伦精一区二区三区| 中文字幕免费观看一区| 色狠狠综合天天综合综合| 日韩av一区二区三区四区| 精品国产麻豆免费人成网站| 成人激情视频网站| 成人在线一区二区三区| 亚洲精品国产精品乱码不99| 欧美久久高跟鞋激| 国产成人aaa| 亚洲一区二区三区在线| 欧美大片在线观看一区| 不卡av在线网| 丝袜美腿高跟呻吟高潮一区| 久久久久久一级片| 色狠狠av一区二区三区| 蜜桃精品在线观看| 国产精品成人网| 69堂亚洲精品首页| www.欧美亚洲| 久久成人18免费观看| 成人欧美一区二区三区| 欧美一区二区三区在线看| 成人av中文字幕| 免费成人av在线播放| 国产精品久久国产精麻豆99网站| 正在播放亚洲一区| www.久久久久久久久| 免费不卡在线观看| 亚洲精品国产一区二区三区四区在线 | 亚洲成a人在线观看| 国产日韩欧美电影| 7777精品伊人久久久大香线蕉 | 91美女片黄在线| 极品尤物av久久免费看| 亚洲一区二区三区精品在线| 国产亚洲欧美色| 欧美一区二区三区免费视频| 91视频国产资源| 国v精品久久久网| 美女被吸乳得到大胸91| 一区二区欧美视频|