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

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

?? griduserfailureex03.java

?? 中間件開發詳細說明:清華大學J2EE教程講義(ppt)-Tsinghua University J2EE tutorial lectures (ppt) [上載源碼成為會員下載此源碼] [成為VIP會
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Title:        GridSim Toolkit * Description:  GridSim (Grid Simulation) Toolkit for Modeling and Simulation *               of Parallel and Distributed Systems such as Clusters and Grids *               An example of how to use the failure functionality. * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html * * Author: Agustin Caminero and Anthony Sulistio * Organization: UCLM (Spain) * Created on: August 2007 */import gridsim.*;import gridsim.index.AbstractGIS;import gridsim.net.Link;import java.util.Random;import java.util.ArrayList;import java.io.FileWriter;import gridsim.resFailure.RegionalGISWithFailure;import eduni.simjava.Sim_system;import eduni.simjava.Sim_event;/** * Creates a Grid User that also considers what happens if a resource fails. * @author       Agustin Caminero and Anthony Sulistio * @since        GridSim Toolkit 4.1 */public class GridUserFailureEx03 extends GridUser{    // the base for our constants (chosen at random)    private static final int BASE = 440000;    /** This constant is to tell the user when he should submit a gridlet */    public static final int SUBMIT_GRIDLET = BASE + 1;    private ArrayList GridletSubmittedList_;   // list of submitted Gridlets    private GridletList GridletReceiveList_;   // list of received Gridlets    private int NUM_GRIDLETS;    private double pollingTime_;    // The sizes of gridlets    private int gridletLength;    private int gridletInput;    private int gridletOutput;    // we keep here the time when each gridlet is submitted    private double gridletSubmissionTime [];    private double gridletLatencyTime [];    // a flag that denotes whether to trace GridSim events or not.    private boolean trace_flag;    /**     * Creates a GridUserFailure object     * @param name      this entity name     * @param link      a network link connecting this entity     * @param pollTime  the time between polls     * @param glLength  length (MI) for the gridlets of this user     * @param glIn      input file size for the gridlets of this user     * @param glOut     output file size for the gridlets of this user     * @param trace_flag  a flag that denotes whether to trace this user events     *                    or not.     * @throws java.lang.Exception happens if either name or link is empty     */    public GridUserFailureEx03(String name, Link link, double pollTime,                        int glLength, int glIn, int glOut, boolean trace_flag)                        throws Exception    {        super(name, link);        this.GridletSubmittedList_ = new ArrayList();        this.GridletReceiveList_ = new GridletList();        pollingTime_ = pollTime;        gridletLength = glLength;        gridletInput = glIn;        gridletOutput = glOut;        this.trace_flag = trace_flag;    }    /**     * Sets the number of gridlets that this user has to submit.     * Also, create the submission and reception  times arrays.     * @param gridlet_num the number of gridlets     */    public void setGridletNumber(int gridlet_num)    {        NUM_GRIDLETS = gridlet_num;        gridletSubmissionTime = new double[NUM_GRIDLETS];        gridletLatencyTime = new double[NUM_GRIDLETS];    }    /**     * Handles incoming requests to this entity.     * This method specifies the behaviours and/or scenarios of a user.     */    public void body()    {        initializeResultsFile();        createGridlet(super.get_id(), NUM_GRIDLETS);        // schedule the initial sending of gridlets in the future        // NOTE: if you have many resources and GIS entities, please make sure        // you wait for few minutes to allow GIS to receive registrations from        // resources. Otherwise, the resource does not exist when you submit.        int PAUSE = 10*60;  // 10 mins        Random random = new Random();        int init_time = PAUSE + random.nextInt(5*60);        // sends a reminder to itself        super.send(super.get_id(), init_time, GridUserFailureEx03.SUBMIT_GRIDLET);        System.out.println(super.get_name() +               ": initial SUBMIT_GRIDLET event will be at clock: " +               init_time + ". Current clock: " + GridSim.clock());        ////////////////////////////////////////////////////////////        // Now, we have the framework of the entity:        while (Sim_system.running())        {            Sim_event ev = new Sim_event();            super.sim_get_next(ev); // get the next event in the queue            switch (ev.get_tag())            {                // submit a gridlet                case GridUserFailureEx03.SUBMIT_GRIDLET:                    processGridletSubmission(ev); // process the received event                    break;                // Receive a gridlet back                case GridSimTags.GRIDLET_RETURN:                    processGridletReturn(ev);                    break;                case GridSimTags.END_OF_SIMULATION:                    System.out.println("\n============== " + super.get_name() +                                       ". Ending simulation...");                    break;                default:                    System.out.println(super.get_name() +                                       ": Received an event: " + ev.get_tag());                    break;            } // switch        } //  while        // wait for few seconds before printing the output        super.sim_pause( super.get_id()*2 );        // remove I/O entities created during construction of this entity        super.terminateIOEntities();        // prints the completed gridlets        printGridletList(GridletReceiveList_, super.get_name(), false,                         gridletLatencyTime);    } // body()    /////////////////////////////////////////////////////////////////////////    /**     * This functions process the submission  of a gridlet. We have to get the     * list of available resources from the RegGIS, choose one of them, and     * submit the gridlet.     * @param ev an incoming event     */    private void processGridletSubmission(Sim_event ev)    {        if (trace_flag)        {            System.out.println(super.get_name() +                ": received an SUBMIT_GRIDLET event. Clock: " + GridSim.clock());        }        /***********        We have to submit:             - the gridlet whose id comes with the event             - all the gridlets with the "gridletSub.getSubmitted() == false"        So, set the gridletSub.getSubmitted() to false for the gridlet whose        id comes with the event        ***********/        int i = 0;        GridletSubmission gridletSub;        int resourceID[];        Random random = new Random(5);   // a random generator with a random seed        int index;        Gridlet gl;        Integer obj;        int glID;        // This is because the initial GRIDLET_SUBMIT event, at the beginning        // of sims, does not have any gridlet id. We have to submit        // all the gridlets.        if (ev.get_data() instanceof Integer)        {            obj = (Integer) ev.get_data();            glID = obj.intValue(); // get the gridlet id.        }        else {            glID = 99; // a value at random, not used at all in this case        }        while (i < GridletSubmittedList_.size())        {            gridletSub = (GridletSubmission)GridletSubmittedList_.get(i);            if ( (gridletSub.getGridlet()).getGridletID() == glID )            {                // set this gridlet whose id comes with the event as not submitted,                // so that it is submitted as soon as possible.                ((GridletSubmission) GridletSubmittedList_.get(i)).setSubmitted(false);            }            // Submit the gridlets with the "gridletSub.getSubmitted() == false"            if ( (gridletSub.getSubmitted() == false))            {                // we have to resubmit this gridlet                gl = ((GridletSubmission) GridletSubmittedList_.get(i)).getGridlet();                resourceID = getResList(); // Get list of resources from GIS                // If we have resources in the list                if ((resourceID != null) && (resourceID.length != 0))                {                    index = random.nextInt(resourceID.length);                    // make sure the gridlet will be executed from the begining                    resetGridlet(gl);                    // submits this gridlet to a resource                    super.gridletSubmit(gl, resourceID[index]);                    gridletSubmissionTime[gl.getGridletID()] = GridSim.clock();                    // set this gridlet as submitted                    ((GridletSubmission) GridletSubmittedList_.get(i)).setSubmitted(true);                    if (trace_flag)                    {                        System.out.println(super.get_name() +                               ": Sending Gridlet #" + i + " to " +                               GridSim.getEntityName(resourceID[index]) +                               " at clock: " + GridSim.clock());                        // Write into a results file                        write(super.get_name(), "Sending", gl.getGridletID(),                              GridSim.getEntityName(resourceID[index]),                              gl.getGridletStatusString(), GridSim.clock());                    }                }                // No resources available at this moment, so schedule an event                // in the future. The event wil be in 15 min (900 sec), as                // resource failures may last several hours.                // This event includes the gridletID, so that the user will                // try to submit only this gridlet                else                {                    super.send(super.get_id(), GridSimTags.SCHEDULE_NOW + 900,                               GridUserFailureEx03.SUBMIT_GRIDLET,                               new Integer(gl.getGridletID()) );                }            }// if (gridletSub.getSubmitted() == false)            i++;        } // while (i < GridletSubmittedList_.size())    } // processGridletSubmission    /**     * This functions process the return of a gridlet.     * We pay attention to the status of the gridlet     * and then decide what we have to do the next     * @param ev an incoming event     */    private void processGridletReturn(Sim_event ev)    {        if (trace_flag)        {            System.out.println(super.get_name() +                ": received an GRIDLET_RETURN event. Clock: " + GridSim.clock());        }        Object obj = (Object) ev.get_data();        Gridlet gl = null;        Random random = new Random(5);   // a random generator with a random seed        if (obj instanceof Gridlet)        {            gl = (Gridlet) obj;            gridletLatencyTime[gl.getGridletID()] = GridSim.clock();            // Write into a results file            if (trace_flag)            {                write(super.get_name(), "Receiving", gl.getGridletID(),                      GridSim.getEntityName(gl.getResourceID()),                      gl.getGridletStatusString(), GridSim.clock());            }            ///////////////////////// Gridlet Success            if (gl.getGridletStatusString().compareTo("Success") == 0)            {                System.out.println(super.get_name() + ": Receiving Gridlet #" +                       gl.getGridletID() + " with status Success at time = " +                       GridSim.clock() + " from resource " +                       GridSim.getEntityName(gl.getResourceID()));                this.GridletReceiveList_.add(gl); // add into the received list                gridletLatencyTime[gl.getGridletID()] =                        gridletLatencyTime[gl.getGridletID()] -                        gridletSubmissionTime[gl.getGridletID()];                // We have received all the gridlets. So, finish the simulation.                if (GridletReceiveList_.size() == GridletSubmittedList_.size())                {                    super.finishSimulation();                }            } // if (gl.getGridletStatusString() == "Success")            //////////////////////// Gridlet Failed            else if (gl.getGridletStatusString().compareTo("Failed") == 0)            {                System.out.println(super.get_name() + ": Receiving Gridlet #" +                       gl.getGridletID() + " with status Failed at time = " +                       GridSim.clock() + " from resource " +                       GridSim.getEntityName(gl.getResourceID()));                // Send the gridlet as soon as we have resources available.                // This gridlet will be resend as soon as possible,                // in the first loop.                int pos = findGridletInGridletSubmittedList(gl);                if (pos == -1) {                    System.out.println(super.get_name() +                        ". Gridlet not found in GridletSubmittedList.");                }                else                {                    // set this gridlet as submitted, because otherwise                    // this gridlet may be submitted several times.                    // A gridlet will only be submitted when the event carrying                    // its id reaches the user                    ((GridletSubmission) GridletSubmittedList_.get(pos)).setSubmitted(true);                    // Now, schedule an event to itself to submit the gridlet                    // The gridlet will be sent as soon as possible                    Integer glID_Int = new Integer(gl.getGridletID());                    // This event includes the gridletID, so that the user                    // will try to submit only this gridlet                    super.send(super.get_id(), GridSimTags.SCHEDULE_NOW,                               GridUserFailureEx03.SUBMIT_GRIDLET, glID_Int);                }            } // if (gl.getGridletStatusString() == "Failed")            ////////////////////////////// Gridlet Failed_resource            else if (gl.getGridletStatusString().compareTo("Failed_resource_unavailable") == 0)            {                int pos = findGridletInGridletSubmittedList(gl);                if (pos == -1) {                    System.out.println(super.get_name() +                        ". Gridlet not found in GridletSubmittedList.");                }                else                {                    // Now, set its submission time for a random time between                    // 1 and the polling time                    double resubmissionTime = random.nextDouble() * pollingTime_;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
奇米一区二区三区| 欧美中文字幕一二三区视频| 色综合天天做天天爱| 日韩精品一区二区三区四区| 一区二区三区欧美在线观看| 国产一区二区三区日韩| 欧美群妇大交群的观看方式| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 91亚洲永久精品| 日韩精品一区二区三区中文精品 | 久久精品视频免费观看| 亚洲1区2区3区4区| 91视频国产观看| 日韩欧美123| 亚洲国产视频在线| 色哟哟欧美精品| 中文字幕乱码日本亚洲一区二区| 日韩国产成人精品| 欧美军同video69gay| 一区二区免费视频| 91网站在线观看视频| 欧美激情一区二区三区全黄| 精品制服美女丁香| 精品噜噜噜噜久久久久久久久试看 | 欧美tk丨vk视频| 日韩电影在线观看电影| 欧美丝袜第三区| 亚洲精品免费电影| 欧美午夜精品一区二区三区 | 美女视频一区在线观看| 91精品欧美综合在线观看最新| 亚洲一区二区视频| 色婷婷国产精品| 一二三区精品视频| 欧美人与性动xxxx| 久久精品国产久精国产爱| 日韩精品一区二| 国产精品456| 日本一区二区三区四区在线视频| 国产a久久麻豆| 中文字幕免费观看一区| 91免费精品国自产拍在线不卡| 亚洲精品日日夜夜| 欧美军同video69gay| 老司机免费视频一区二区三区| 日韩一级大片在线观看| 国产在线精品一区二区| 国产精品欧美一区喷水| 一本色道久久综合亚洲aⅴ蜜桃| 亚洲国产精品久久久久秋霞影院 | 久久色视频免费观看| 国产乱码精品1区2区3区| 国产精品美女久久久久久2018 | 一区二区三区中文在线| 欧美日韩国产一二三| 九一久久久久久| 国产精品午夜春色av| 欧美亚洲国产bt| 久久99精品久久只有精品| 国产精品视频一二三| 精品婷婷伊人一区三区三| 国模无码大尺度一区二区三区| 中文字幕亚洲在| 欧美群妇大交群的观看方式| 国产精品18久久久久久久网站| 亚洲男同性视频| 欧美mv和日韩mv国产网站| 成人app网站| 日本麻豆一区二区三区视频| 欧美国产欧美亚州国产日韩mv天天看完整| 国产91高潮流白浆在线麻豆| 天天综合网天天综合色| 中文字幕av免费专区久久| 欧美日韩在线免费视频| 成人中文字幕在线| 奇米精品一区二区三区在线观看 | 久久久国产午夜精品| 欧美视频一区二区三区在线观看| 久久精品国产99国产| 亚洲无线码一区二区三区| 亚洲国产精品v| 日韩精品最新网址| 欧美日韩一级二级| proumb性欧美在线观看| 欧美96一区二区免费视频| 亚洲精品视频在线| 国产精品久久久久婷婷| 欧美成人欧美edvon| 欧美日韩在线播放一区| 91丝袜呻吟高潮美腿白嫩在线观看| 日本vs亚洲vs韩国一区三区 | 欧美精品第一页| 色噜噜夜夜夜综合网| 成人综合日日夜夜| 国产乱人伦精品一区二区在线观看 | 亚洲精品亚洲人成人网在线播放| 一区二区三区日韩| 亚洲欧洲日本在线| 国产欧美一二三区| 久久精品人人做人人综合| 日韩视频一区二区三区在线播放| 欧美中文字幕一二三区视频| 97精品久久久午夜一区二区三区 | 久久精品一区蜜桃臀影院| 在线播放中文一区| 欧美性高清videossexo| 91香蕉视频mp4| 色婷婷国产精品| 欧美性色黄大片| 国产三区在线成人av| 欧美日韩二区三区| 欧美午夜精品一区二区三区| 在线一区二区观看| 色婷婷综合久色| 色综合天天天天做夜夜夜夜做| 波多野结衣中文字幕一区 | 91美女片黄在线观看91美女| 国产精品资源站在线| 国产一区二区美女诱惑| 国产露脸91国语对白| 国产宾馆实践打屁股91| 成人免费看的视频| 91在线看国产| 91久久精品国产91性色tv| 欧美日韩大陆在线| 欧美不卡一区二区三区四区| 日韩精品最新网址| 国产亚洲一区二区在线观看| 中文字幕制服丝袜成人av| 亚洲欧美视频在线观看视频| 亚洲国产视频一区二区| 蜜桃视频一区二区| 国产mv日韩mv欧美| 欧美视频中文一区二区三区在线观看| 91亚洲大成网污www| 欧美色网站导航| 欧美v亚洲v综合ⅴ国产v| 亚洲国产精品二十页| 一区二区高清在线| 日韩1区2区日韩1区2区| 国产69精品久久99不卡| 欧美在线短视频| 日韩欧美色综合网站| 国产精品视频你懂的| 一区二区三区蜜桃网| 精品一区二区国语对白| 91农村精品一区二区在线| 91精品国产综合久久小美女| 中文字幕免费不卡| 人人爽香蕉精品| 99久久精品国产麻豆演员表| 91精品欧美久久久久久动漫| 国产精品色在线观看| 日产精品久久久久久久性色| 国产99精品国产| 7777精品伊人久久久大香线蕉超级流畅 | 中文字幕一区二区三区不卡在线| 亚洲成人黄色影院| 丁香婷婷综合色啪| 91精品国产91热久久久做人人| 国产精品理论在线观看| 免费高清在线一区| 色网站国产精品| 久久久精品欧美丰满| 视频在线观看一区| 色婷婷综合久久久中文字幕| www激情久久| 日本午夜精品视频在线观看| 99久久精品国产一区二区三区| 精品美女一区二区| 日韩影视精彩在线| 欧美色窝79yyyycom| 中文在线资源观看网站视频免费不卡 | 成人国产精品视频| 日韩欧美国产高清| 日韩精品福利网| 色综合天天综合色综合av | 2021国产精品久久精品| 亚洲高清不卡在线观看| 国产99久久久精品| 久久久久一区二区三区四区| 日韩制服丝袜av| 欧美日韩国产乱码电影| 亚洲一区在线电影| 99久久久无码国产精品| 国产精品麻豆视频| 福利电影一区二区| 2021久久国产精品不只是精品| 日本亚洲电影天堂| 日韩欧美视频在线| 捆绑变态av一区二区三区| 91国产精品成人| 亚洲精品久久久蜜桃| 色综合色狠狠天天综合色| ㊣最新国产の精品bt伙计久久| 国产成人精品aa毛片| 国产日本亚洲高清| 国产91精品免费| 国产精品不卡一区二区三区| av中文字幕一区|