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

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

?? griduserfailureex01.java

?? 中間件開發(fā)詳細(xì)說明:清華大學(xué)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 GridUserFailureEx01 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 */    private 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 GridUserFailureEx01(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.        // The sending will start in a ramdom time within 5 min        Random random = new Random();        int init_time = random.nextInt(5*60);        // sends a reminder to itself        super.send(super.get_id(), init_time, 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 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        // 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,                               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,                               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_;                    // this is to prevent the gridlet from being submitted                    // before its resubmission time.                    // This is different from the FAILED case, because

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久麻豆一区二区| 国产a视频精品免费观看| 中文字幕av资源一区| 亚洲精品在线一区二区| 欧美成人在线直播| 日韩精品一区二区三区视频播放| 欧美少妇xxx| 91精品午夜视频| 日韩欧美国产麻豆| 久久久久久亚洲综合| 国产欧美综合在线| 日韩伦理电影网| 亚洲欧美日韩中文播放| 亚洲一区二区三区美女| 日韩高清欧美激情| 久久97超碰色| 不卡视频在线看| 色婷婷亚洲精品| 在线播放中文一区| 久久久综合视频| 亚洲欧洲日韩在线| 亚洲成人久久影院| 国内久久婷婷综合| 91免费版在线| 欧美一级一区二区| 中文字幕第一区第二区| 尤物视频一区二区| 蜜桃视频一区二区三区| 成人av在线观| 欧美精品在线观看一区二区| 精品国产电影一区二区| 最好看的中文字幕久久| 日本成人在线视频网站| 韩国v欧美v日本v亚洲v| 91亚洲精品久久久蜜桃| 欧美va亚洲va香蕉在线 | 亚洲精品水蜜桃| 午夜精彩视频在线观看不卡| 国产精品羞羞答答xxdd| 欧美亚日韩国产aⅴ精品中极品| 精品少妇一区二区三区免费观看| 丰满岳乱妇一区二区三区| 樱桃视频在线观看一区| 欧美性色aⅴ视频一区日韩精品| 91精品婷婷国产综合久久性色 | 欧美影院一区二区| 日韩一区二区三区电影| 中文字幕亚洲一区二区va在线| 亚洲一区二区三区小说| 国产二区国产一区在线观看| 欧美精品一级二级三级| 中文字幕精品一区二区三区精品| 日本大胆欧美人术艺术动态| 91在线观看视频| 26uuu国产一区二区三区| 亚洲一区二区综合| 91免费观看国产| 国产目拍亚洲精品99久久精品| 日韩精品欧美精品| 欧美在线免费视屏| 亚洲色图在线看| 成人在线视频一区| 久久噜噜亚洲综合| 国产麻豆精品一区二区| 欧美一区二区视频在线观看| 一区二区三区日韩欧美| 99riav一区二区三区| 中文字幕精品一区二区精品绿巨人 | 国产综合成人久久大片91| 色就色 综合激情| 国产伦理精品不卡| 久久综合久久鬼色| 国产精品高潮久久久久无| 五月天激情综合网| 日韩成人免费看| 欧美日韩一级视频| 亚洲综合视频网| 欧美日韩在线播放三区四区| 亚洲免费观看视频| 日本精品一级二级| 亚洲一线二线三线久久久| 色综合一个色综合| 亚洲高清视频中文字幕| 欧美日韩日本视频| 日本成人在线电影网| 欧美一级精品在线| 精品一区二区免费在线观看| 欧美精品一区二区三| 国产精品一区二区久激情瑜伽| 久久久久国产精品麻豆ai换脸 | av一二三不卡影片| 国产精品国产精品国产专区不片| www.66久久| 一区二区欧美精品| 欧美日韩二区三区| 热久久免费视频| 国产喂奶挤奶一区二区三区| 97se狠狠狠综合亚洲狠狠| 亚洲综合视频网| 欧美刺激脚交jootjob| 丁香亚洲综合激情啪啪综合| 亚洲美女一区二区三区| 欧洲精品在线观看| 久久99热国产| 亚洲三级免费观看| 日韩欧美中文字幕一区| 成人午夜视频免费看| 亚洲一区在线免费观看| 欧美成人综合网站| 日本二三区不卡| 久久99日本精品| 一区二区三区蜜桃网| 精品国产一区a| 日本精品免费观看高清观看| 久久精品久久久精品美女| 国产精品九色蝌蚪自拍| 日韩一级片在线播放| 91在线观看成人| 久久99热这里只有精品| 亚洲一区二区欧美激情| 久久夜色精品国产欧美乱极品| 色999日韩国产欧美一区二区| 久久99精品国产麻豆不卡| 亚洲综合免费观看高清完整版在线 | 色综合久久天天| 国产主播一区二区| 丝袜诱惑制服诱惑色一区在线观看| 久久精品网站免费观看| 欧美一卡二卡三卡四卡| 在线观看国产精品网站| 国产电影一区在线| 喷白浆一区二区| 亚洲综合自拍偷拍| 中文字幕在线不卡一区 | 99久久综合99久久综合网站| 青青草伊人久久| 亚洲成av人片在线观看| 亚洲免费看黄网站| 一区精品在线播放| 中文字幕不卡在线播放| 久久伊99综合婷婷久久伊| 在线综合+亚洲+欧美中文字幕| 色综合中文字幕| 色综合久久六月婷婷中文字幕| 高清国产一区二区| 国产盗摄一区二区| 国产一区二区不卡在线| 美女视频黄频大全不卡视频在线播放| 亚洲一区二区三区小说| 亚洲一区免费视频| 亚洲一区二区三区在线看| 国产精品久久三| 中文字幕欧美一区| 自拍av一区二区三区| 亚洲另类在线一区| 亚洲综合免费观看高清完整版在线| 成人免费在线播放视频| 综合色天天鬼久久鬼色| 1024成人网| 亚洲激情图片qvod| 一区二区高清视频在线观看| 亚洲综合在线五月| 亚洲成a人片在线不卡一二三区| 亚洲一区二区三区激情| 日韩av电影天堂| 日韩av在线播放中文字幕| 日本不卡一区二区三区| 久久99精品国产| 成人av资源在线| 在线免费观看成人短视频| 欧美综合色免费| 91精品国产一区二区三区香蕉| 欧美一区二区三区在线视频| 日韩女优av电影| 久久久青草青青国产亚洲免观| 欧美激情一区不卡| 一区二区三区在线播| 三级在线观看一区二区| 麻豆国产精品一区二区三区| 粉嫩蜜臀av国产精品网站| 色综合久久综合网| 日韩一卡二卡三卡| 久久九九99视频| 一区二区在线观看不卡| 日韩成人午夜精品| 成人黄色a**站在线观看| 91成人免费在线| 久久日韩粉嫩一区二区三区| 成人免费一区二区三区在线观看| 午夜不卡av免费| 丁香五精品蜜臀久久久久99网站| 欧美日韩另类一区| 久久天天做天天爱综合色| 亚洲日本韩国一区| 另类综合日韩欧美亚洲| 99久精品国产| 久久久午夜电影| 男男成人高潮片免费网站| 99久久久精品| 亚洲精品一区二区三区影院|