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

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

?? resfailureex02.java

?? 中間件開發詳細說明:清華大學J2EE教程講義(ppt)-Tsinghua University J2EE tutorial lectures (ppt) [上載源碼成為會員下載此源碼] [成為VIP會
?? JAVA
字號:
/* * 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.resFailure.*;import gridsim.*;import gridsim.net.*;import java.util.*;import gridsim.util.NetworkReader;import gridsim.util.HyperExponential;/** * This example shows a basic topology with 20 users, 6 resources and 1 GIS. * All of them are connected by a router. * There is only one VO in this example. * @author       Agustin Caminero and Anthony Sulistio * @since        GridSim Toolkit 4.1 */public class ResFailureEx02{    public static void main(String[] args)    {        System.out.println("Starting failure example 2...");        try        {            if (args.length < 1)            {                System.out.println("Usage: java ResFailureEx02 network_ex02.txt");                return;            }            //////////////////////////////////////////            // First step: Initialize the GridSim package. It should be called            // before creating any entities. We can't run this example without            // initializing GridSim first. We will get a run-time exception            // error.            // a flag that denotes whether to trace GridSim events or not.            boolean trace_flag = false;  // dont use SimJava trace            int num_user = 20; //  number of grid users            Calendar calendar = Calendar.getInstance();            // Initialize the GridSim package            System.out.println("Initializing GridSim package");            GridSim.init(num_user, calendar, trace_flag);            trace_flag = true;            //////////////////////////////////////////            // Second step: Builds the network topology among Routers.            String filename = args[0];  // get the network topology            System.out.println("Reading network from " + filename);            LinkedList routerList = NetworkReader.createFIFO(filename);            //////////////////////////////////////////            // Third step: Creates one RegionalGISWithFailure entity,            // linked to a router in the topology            Router router = null;            double baud_rate = 100000000;   // 100Mbps, i.e. baud rate of links            double propDelay = 10;      // propagation delay in milliseconds            int mtu = 1500;             // max. transmission unit in byte            int totalMachines = 16;     // num of machines each resource has            String NAME = "Ex02_";  // a common name            String gisName = NAME + "Regional_GIS";  // GIS name            // a network link attached to this regional GIS entity            Link link = new SimpleLink(gisName + "_link", baud_rate,                                       propDelay, mtu);            // HyperExponential: mean, standard deviation, stream            // how many resources will fail            HyperExponential failureNumResPattern =                    new HyperExponential(totalMachines / 2, totalMachines, 4);            // when they will fail            HyperExponential failureTimePattern =                    new HyperExponential(25, 100, 4);            // how long the failure will be            HyperExponential failureLengthPattern =                    new HyperExponential(20, 25, 4); // big test: (20, 100, 4);            // creates a new Regional GIS entity that generates a resource            // failure message according to these patterns.            RegionalGISWithFailure gis = new RegionalGISWithFailure(gisName,                              link, failureNumResPattern, failureTimePattern,                              failureLengthPattern);            gis.setTrace(trace_flag);   // record this GIS activity            // link these GIS to a router            router = NetworkReader.getRouter("Router0", routerList);            linkNetwork(router, gis);            // print some info messages            System.out.println("Created a REGIONAL GIS with name " + gisName +                    " and id = " + gis.get_id() + ", connected to " +                    router.get_name() );            //////////////////////////////////////////            // Fourth step: Creates one or more GridResourceWithFailure            // entities, linked to a router in the topology            String sched_alg = "SPACE";  // use space-shared policy            int totalResource = 6; // number of resources            ArrayList resList = new ArrayList(totalResource);            // Each resource may have different baud rate,            // totalMachine, rating, allocation policy and the router to            // which it will be connected. However, in this example, we assume            // all have the same properties for simplicity.            int totalPE = 4;        // num of PEs each machine has            int rating = 49000;     // rating (MIPS) of PEs            int GB = 1000000000;    // 1 GB in bits            baud_rate = 2.5 * GB;            for (int i = 0; i < totalResource; i++)            {                // gets the router object from the list                router = NetworkReader.getRouter("Router0", routerList);                // creates a new grid resource                String resName = NAME + "Res_" + i;                GridResourceWithFailure res = createGridResource(resName,                            baud_rate, propDelay, mtu, totalPE, totalMachines,                            rating, sched_alg);                // add a resource into a list                resList.add(res);                res.setRegionalGIS(gis);    // set the regional GIS entity                res.setTrace(trace_flag);   // record this resource activity                // link a resource to this router object                linkNetwork(router, res);                System.out.println("Created a RESOURCE (" + totalMachines +                    " machines, each with " + totalPE + " PEs) with name = " +                    resName + " and id = " + res.get_id() +                    ", connected to router " + router.get_name() +                    " and registered to " + gis.get_name() );            }            //////////////////////////////////////////            // Fifth step: Creates one or more GridUserFailure entities,            // linked to a router of the topology            int totalGridlet = 5;    // total jobs            double pollTime = 100;   // time between polls            int glSize = 100000;     // the size of gridlets (input/output)            int glLength = 42000000; // the length (MI) of gridlets            // gets the router object from the list            router = NetworkReader.getRouter("Router0", routerList);            for (int i = 0; i < num_user; i++)            {                String userName = NAME + "User_" + i;                // a network link attached to this entity                Link link2 = new SimpleLink(userName + "_link", baud_rate,                                            propDelay, mtu);                // only keeps track activities from User_0                if (i != 0) {                    trace_flag = false;                }                GridUserFailureEx02 user = new GridUserFailureEx02(userName, link2,                        pollTime, glLength, glSize, glSize, trace_flag);                user.setRegionalGIS(gis); // set the regional GIS entity                user.setGridletNumber(totalGridlet);                // link a resource to this router object                linkNetwork(router, user);                System.out.println("Created a USER with name " + userName +                        " and id = " + user.get_id() + ", connected to " +                        router.get_name() + ", and with " + totalGridlet +                        " gridlets. Registered to " + gis.get_name() );            }            System.out.println();            //////////////////////////////////////////            // Sixth step: Starts the simulation            GridSim.startGridSimulation();            System.out.println("\nFinish failure example 2... \n");        }        catch (Exception e)        {            e.printStackTrace();            System.out.println("Unwanted errors happen");        }    }    /**     * Links a particular entity with a given Router.     *     * @param router    a Router object     * @param obj       a GridSim entity to be attached to the Router     */    private static void linkNetwork(Router router, GridSimCore obj) throws Exception    {        if (router == null) {            System.out.println("Error - router is NULL.");            return;        }        // get the baud rate of a link        double baud_rate = obj.getLink().getBaudRate();        // create the packet scheduler for this link        PacketScheduler pktObj = new FIFOScheduler(router.get_name() +                                                   "_to_" + obj.get_name() );        // attach this GridSim entity to a Router        router.attachHost(obj, pktObj);    }    /**     * Creates one Grid resource. A Grid resource contains one or more     * Machines. Similarly, a Machine contains one or more PEs (Processing     * Elements or CPUs).     * <p>     * In this simple example, we are simulating one Grid resource with three     * Machines that contains one or more PEs.     *     * @param name          a Grid Resource name     * @param baud_rate     the bandwidth of this entity     * @param delay         the propagation delay     * @param MTU           Maximum Transmission Unit     * @param totalPE       number of PE per machine     * @param totalMachine  number of machines in this resources     * @param rating        rating of mahcines in this resource     * @param sched_alg     the scheduling algorithm of this resource     * @return a GridResource object     */    private static GridResourceWithFailure createGridResource(String name,                        double baud_rate, double delay, int MTU, int totalPE,                        int totalMachine, int rating, String sched_alg)    {        // Here are the steps needed to create a Grid resource:        // 1. We need to create an object of MachineList to store one or more        //    Machines        MachineList mList = new MachineList();        for (int i = 0; i < totalMachine; i++)        {            // 2. A Machine contains one or more PEs or CPUs. Therefore, should            //    create an object of PEList to store these PEs before creating            //    a Machine.            PEList peList = new PEList();            // 3. Create PEs and add these into an object of PEList.            for (int k = 0; k < totalPE; k++)            {                // need to store PE id and MIPS Rating                peList.add( new PE(k, rating) );            }            // 4. Create one Machine with its id and list of PEs or CPUs            mList.add( new Machine(i, peList) );        }        // 5. Create a ResourceCharacteristics object that stores the        //    properties of a Grid resource: architecture, OS, list of        //    Machines, allocation policy: time- or space-shared, time zone        //    and its price (G$/PE time unit).        String arch = "Sun Ultra";      // system architecture        String os = "Solaris";          // operating system        double time_zone = 9.0;         // time zone this resource located        double cost = 3.0;              // the cost of using this resource        // we create Space_Shared_failure or Time_Shared_failure schedulers        int scheduling_alg = 0;         // space_shared or time_shared        if (sched_alg.equals("SPACE") == true) {            scheduling_alg = ResourceCharacteristics.SPACE_SHARED;        }        else if (sched_alg.equals("TIME") == true) {            scheduling_alg = ResourceCharacteristics.TIME_SHARED;        }        ResourceCharacteristics resConfig = new ResourceCharacteristics(                arch, os, mList, scheduling_alg, time_zone, cost);        // 6. Finally, we need to create a GridResource object.        long seed = 11L*13*17*19*23+1;        double peakLoad = 0.0;        // the resource load during peak hour        double offPeakLoad = 0.0;     // the resource load during off-peak hr        double holidayLoad = 0.0;     // the resource load during holiday        // incorporates weekends so the grid resource is on 7 days a week        LinkedList Weekends = new LinkedList();        Weekends.add(new Integer(Calendar.SATURDAY));        Weekends.add(new Integer(Calendar.SUNDAY));        // incorporates holidays. However, no holidays are set in this example        LinkedList Holidays = new LinkedList();        GridResourceWithFailure gridRes = null;        try        {            // creates a GridResource with a link            gridRes = new GridResourceWithFailure(name,                new SimpleLink(name + "_link", baud_rate, delay, MTU),                seed, resConfig, peakLoad, offPeakLoad, holidayLoad,                Weekends, Holidays);        }        catch (Exception e) {            e.printStackTrace();        }        return gridRes;    }} // end class

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品一区二区在线| 色综合久久综合网97色综合| 欧美一区二区黄| 日韩av在线免费观看不卡| 欧美另类变人与禽xxxxx| 奇米影视一区二区三区| 精品国产一区a| 国产suv一区二区三区88区| 国产精品你懂的| 色综合一个色综合亚洲| 色综合视频在线观看| 夜夜爽夜夜爽精品视频| 555www色欧美视频| 韩国女主播成人在线观看| 国产精品国产三级国产三级人妇| 91啪九色porn原创视频在线观看| 亚洲在线成人精品| 日韩欧美在线网站| 国产成人免费在线观看| 亚洲伊人色欲综合网| 欧美一级日韩不卡播放免费| 国产精品白丝jk黑袜喷水| 一区二区三区免费在线观看| 日韩三级视频中文字幕| 岛国av在线一区| 日韩电影在线观看网站| 国产日产欧产精品推荐色| 欧美在线高清视频| 精品一区二区免费视频| 伊人色综合久久天天| 久久久亚洲精品石原莉奈| 欧洲精品一区二区三区在线观看| 蜜臀国产一区二区三区在线播放| 亚洲国产成人一区二区三区| 欧美喷潮久久久xxxxx| 国产精品一区二区三区99| 亚洲午夜三级在线| 国产精品女上位| 欧美xxxx在线观看| 欧美性猛交xxxx黑人交| 国产成人精品aa毛片| 天天操天天色综合| 亚洲嫩草精品久久| 欧美国产日本韩| 日韩欧美国产一区二区在线播放| 在线精品国精品国产尤物884a| 国产乱码字幕精品高清av| 日韩精品一二区| 亚洲综合在线五月| 最新国产精品久久精品| 久久青草国产手机看片福利盒子 | 欧美tickling网站挠脚心| 91蝌蚪porny| 国产91清纯白嫩初高中在线观看| 蜜臀av一区二区在线观看| 亚洲美女偷拍久久| 国产精品久久久一区麻豆最新章节| 欧美一区二区黄| 91精选在线观看| 欧美性一二三区| 91久久国产综合久久| 成人动漫在线一区| 成人免费视频视频在线观看免费| 国产一区二区调教| 狠狠色丁香婷婷综合久久片| 午夜欧美一区二区三区在线播放| 亚洲激情五月婷婷| 亚洲美女免费视频| 亚洲人成网站在线| 亚洲三级视频在线观看| 亚洲欧美综合另类在线卡通| 国产精品视频看| 国产欧美一区二区精品性色超碰| 精品国产自在久精品国产| 日韩欧美色综合网站| 欧美电视剧在线观看完整版| 日韩午夜av一区| 欧美精品一区二区三区视频| 日韩欧美区一区二| 久久免费午夜影院| 国产欧美一区二区三区在线看蜜臀| 国产亚洲成av人在线观看导航 | 中文字幕的久久| 久久精品一区二区| 中文字幕不卡一区| 亚洲欧美日韩中文播放| 亚洲一区二区三区激情| 午夜亚洲福利老司机| 日本不卡视频在线| 精彩视频一区二区三区| 国产盗摄一区二区三区| www.99精品| 欧美视频一区二区三区在线观看 | 男女男精品视频| 美日韩黄色大片| 国产毛片精品一区| av中文字幕在线不卡| 在线视频欧美精品| 制服丝袜激情欧洲亚洲| 欧美精品一区二区三区四区| 国产精品久久二区二区| 一区二区免费在线播放| 日精品一区二区三区| 国产一区在线看| 色婷婷av一区二区三区软件 | 欧美日韩免费电影| 欧美成人猛片aaaaaaa| 国产欧美日韩不卡| 亚洲一区二区三区四区不卡| 蜜桃精品视频在线| 成人av电影观看| 欧美喷潮久久久xxxxx| 国产日韩欧美亚洲| 亚洲动漫第一页| 韩国精品免费视频| 欧美在线小视频| 久久精品水蜜桃av综合天堂| 亚洲永久免费视频| 黄色小说综合网站| 在线这里只有精品| 国产亚洲欧美日韩俺去了| 亚洲第一成年网| 成人久久18免费网站麻豆 | 久久久精品国产免大香伊| 亚洲精品乱码久久久久久久久 | 国产综合成人久久大片91| 91麻豆成人久久精品二区三区| 日韩亚洲欧美成人一区| 激情另类小说区图片区视频区| 色综合天天做天天爱| 精品国产乱码久久久久久久久 | 麻豆91在线播放免费| 色哟哟一区二区三区| 久久影院午夜片一区| 午夜视频一区二区| 99视频在线精品| 久久久久久久综合日本| 日韩av不卡一区二区| 一本大道久久a久久综合| 国产女同互慰高潮91漫画| 丝袜亚洲另类欧美综合| 色婷婷国产精品久久包臀| 日本一区二区三级电影在线观看| 麻豆一区二区三| 欧美精选在线播放| 一区二区三区在线视频播放| 粉嫩在线一区二区三区视频| 538在线一区二区精品国产| 亚洲网友自拍偷拍| 在线观看国产一区二区| 中文欧美字幕免费| 国产aⅴ综合色| 久久综合丝袜日本网| 久久国产精品第一页| 69精品人人人人| 亚欧色一区w666天堂| 欧美性受极品xxxx喷水| 亚洲卡通动漫在线| 91一区二区三区在线观看| 韩国精品在线观看| 欧美xxxx老人做受| 老司机精品视频一区二区三区| 欧美日高清视频| 五月婷婷久久综合| 欧美三级视频在线| 午夜精品久久久| 欧美一区二区黄| 激情图片小说一区| 国产视频一区二区在线观看| 国产一区二区调教| 国产女人18毛片水真多成人如厕| 国产盗摄精品一区二区三区在线| 久久蜜臀精品av| 国产成人av一区| 国产精品乱人伦中文| 色爱区综合激月婷婷| 亚洲午夜视频在线| 日韩一区二区三| 韩国三级中文字幕hd久久精品| 久久久久综合网| a在线欧美一区| 夜夜精品浪潮av一区二区三区| 欧美日韩卡一卡二| 麻豆91在线观看| 欧美高清在线一区| 欧美亚洲国产一区在线观看网站| 亚洲成av人影院| 日韩欧美一区二区不卡| 国产91清纯白嫩初高中在线观看| 中文字幕欧美日本乱码一线二线| 99re免费视频精品全部| 午夜欧美大尺度福利影院在线看| 欧美一级高清大全免费观看| 久久91精品国产91久久小草 | 有码一区二区三区| 欧美日韩亚洲综合| 久88久久88久久久| 亚洲色图丝袜美腿| 欧美人成免费网站| 国产一区二区三区在线观看免费 |