本文整理汇总了Java中org.cloudbus.cloudsim.UtilizationModelStochastic类的典型用法代码示例。如果您正苦于以下问题:Java UtilizationModelStochastic类的具体用法?Java UtilizationModelStochastic怎么用?Java UtilizationModelStochastic使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UtilizationModelStochastic类属于org.cloudbus.cloudsim包,在下文中一共展示了UtilizationModelStochastic类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCloudletList
import org.cloudbus.cloudsim.UtilizationModelStochastic; //导入依赖的package包/类
/**
* Creates the cloudlet list.
*
* @param brokerId the broker id
* @param cloudletsNumber the cloudlets number
*
* @return the list< cloudlet>
*/
public static List<Cloudlet> createCloudletList(int brokerId, int cloudletsNumber) {
List<Cloudlet> list = new ArrayList<Cloudlet>();
long fileSize = 300;
long outputSize = 300;
long seed = RandomConstants.CLOUDLET_UTILIZATION_SEED;
UtilizationModel utilizationModelNull = new UtilizationModelNull();
for (int i = 0; i < cloudletsNumber; i++) {
Cloudlet cloudlet = null;
if (seed == -1) {
cloudlet = new Cloudlet(
i,
Constants.CLOUDLET_LENGTH,
Constants.CLOUDLET_PES,
fileSize,
outputSize,
new UtilizationModelStochastic(),
utilizationModelNull,
utilizationModelNull);
} else {
cloudlet = new Cloudlet(
i,
Constants.CLOUDLET_LENGTH,
Constants.CLOUDLET_PES,
fileSize,
outputSize,
new UtilizationModelStochastic(seed * i),
utilizationModelNull,
utilizationModelNull);
}
cloudlet.setUserId(brokerId);
cloudlet.setVmId(i);
list.add(cloudlet);
}
return list;
}