Gridsim学习笔记(1)--- Gridsim初始化与创建网格资源

  1. Gridsim初始化

  在创建任何实体之前必须先使用Gridsim.init()对Gridsim进行初始化:

  public static void init( int numUser,  

              Calendar cal, 

              boolean traceFlag, 

              String[] excludeFromFile, 

              String[] excludeFromProcessing, 

              String reportWriterName )

在此函数内将创建如下 GridSim 实体:

  • GridSimRandom
  • GridStatistics
  • GridInformationService
  • GridSimShutdown

Since GridSim version 5.0, the simulation does not initialise a GridSimRandom object.

 

参数:
numUser - 创建的用户实体数,This parameters indicates that GridSimShutdown first waits for User Entities's END_OF_SIMULATION signal before issuing terminate signal to other entities
cal - 模拟开始时间. 可使用  Calendar.getInstance() 创建Calendar对象,用来记录摸拟(simulation)开始的时间. This simulation time is very important in handling advanced reservations functionalities.
traceFlag - true if GridSim trace need to be written
excludeFromFile - an array of String containing list of files to be excluded from statistics
excludeFromProcessing - an array of String containing list of processings to be excluded from writing into a file
reportWriterName - a ReportWriter entity name. This entity can be found inside a gridbroker package.

  2.创建网格资源(GridResource)

  1)创建Machine列表

  MachineList mList=new MachineList();

  ......

  mList.add(new Machine(int id, int numPE, int ratingPE) ); //id:Machine id, numPE: PE数, ratingPE:速率

  ......
  2)创建资源属性(ResouceCharacteriistics)

  ResourceCharacteristics resConfig = new ResouceCharacteristics(

    String architecture, //系统架构

    String OS, //操作系统

    MachineList machineList, //Machine列表

    int allocationPolicy, //allocation策略

    double timeZone, //时间区

    double costPerSec//花费

    )

  3)创建网格资源(GridResource)

  GridResource gridRes = new GridResource(

    String name, //资源名称

    double baud_rate, //通迅速度

    long seed, //初始种子

    ResourceCharacteristics resource, //资源属性

    double peakLoad, //高峰负载

    double offPeakLoad, //非高峰负载

    double relativeHolidayLoad, //节假日负载

    LinkedList weekends, //周未

    LinkedList holidays//节假日

  )

转载于:https://www.cnblogs.com/MCNCU/archive/2010/09/08/1821789.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值