/*
* Title: CloudSim Toolkit
* Description: CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
*
* Copyright (c) 2009-2012, The University of Melbourne, Australia
*/
package org.cloudbus.cloudsim;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import org.cloudbus.cloudsim.core.CloudSim;
/**
* Cloudlet is an extension to the cloudlet. It stores, despite all the information encapsulated in
* the Cloudlet, the ID of the VM running it.
*
* @author Rodrigo N. Calheiros
* @author Anton Beloglazov
* @since CloudSim Toolkit 1.0
*/
public class Cloudlet {
/**
* The User or Broker ID. It is advisable that broker set this ID with its own ID, so that
* CloudResource returns to it after the execution.
**/
private int userId;
/**
* The size of this Cloudlet to be executed in a CloudResource (unit: in MI).
*/
private long cloudletLength;
/**
* The input file size of this Cloudlet before execution (unit: in byte). in byte = program +
* input data size
*/
private final long cloudletFileSize;
/** The output file size of this Cloudlet after execution (unit: in byte). */
private final long cloudletOutputSize;
/** The num of Pe required to execute this job. */
private int numberOfPes;
/** The cloudlet ID. */
private final int cloudletId;
/** The status of this Cloudlet. */
private int status;
/** The format of decimal numbers. */
private DecimalFormat num;
/** The time where this Cloudlet completes. */
private double finishTime;
/**
* Start time of executing this Cloudlet. With new functionalities, such as CANCEL, PAUSED and
* RESUMED, this attribute only stores the latest execution time. Previous execution time are
* ignored.
*/
private double execStartTime;
/** The ID of a reservation made for this cloudlet. */
private int reservationId = -1;
/** The records the transaction history for this Cloudlet. */
private final boolean record;
/** The newline. */
private String newline;
/** The history. */
private StringBuffer history;
/** The res list. */
private final List<Resource> resList;
/** The index. */
private int index;
/** The class type of Cloudlet for resource scheduling. */
private int classType;
/** The ToS for sending Cloudlet over the network. */
private int netToS;
// //////////////////////////////////////////
// Below are CONSTANTS attributes
/** The Cloudlet has been created and added to the CloudletList object. */
public static final int CREATED = 0;
/** The Cloudlet has been assigned to a CloudResource object as planned. */
public static final int READY = 1;
/** The Cloudlet has moved to a Cloud node. */
public static final int QUEUED = 2;
/** The Cloudlet is in execution in a Cloud node. */
public static final int INEXEC = 3;
/** The Cloudlet has been executed successfully. */
public static final int SUCCESS = 4;
/** The Cloudlet is failed. */
public static final int FAILED = 5;
/** The Cloudlet has been canceled. */
public static final int CANCELED = 6;
/**
* The Cloudlet has been paused. It can be resumed by changing the status into <tt>RESUMED</tt>.
*/
public static final int PAUSED = 7;
/** The Cloudlet has been resumed from <tt>PAUSED</tt> state. */
public static final int RESUMED = 8;
/** The cloudlet has failed due to a resource failure. */
public static final int FAILED_RESOURCE_UNAVAILABLE = 9;
/** The vm id. */
protected int vmId;
/** The cost per bw. */
protected double costPerBw;
/** The accumulated bw cost. */
protected double accumulatedBwCost;
// Utilization
/** The utilization of cpu model. */
private UtilizationModel utilizationModelCpu;
/** The utilization of memory model. */
private UtilizationModel utilizationModelRam;
/** The utilization of bw model. */
private UtilizationModel utilizationModelBw;
// Data cloudlet
/** The required files. */
private List<String> requiredFiles = null; // list of required filenames
/**
* Allocates a new Cloudlet object. The Cloudlet length, input and output file sizes should be
* greater than or equal to 1. By default this constructor sets the history of this object.
*
* @param cloudletId the unique ID of this Cloudlet
* @param cloudletLength the length or size (in MI) of this cloudlet to be executed in a
* PowerDatacenter
* @param cloudletFileSize the file size (in byte) of this cloudlet <tt>BEFORE</tt> submitting
* to a PowerDatacenter
* @param cloudletOutputSize the file size (in byte) of this cloudlet <tt>AFTER</tt> finish
* executing by a PowerDatacenter
* @param pesNumber the pes number
* @param utilizationModelCpu the utilization model cpu
* @param utilizationModelRam the utilization model ram
* @param utilizationModelBw the utilization model bw
* @pre cloudletID >= 0
* @pre cloudletLength >= 0.0
* @pre cloudletFileSize >= 1
* @pre cloudletOutputSize >= 1
* @post $none
*/
public Cloudlet(
final int cloudletId,
final long cloudletLength,
final int pesNumber,
final long cloudletFileSize,
final long cloudletOutputSize,
final UtilizationModel utilizationModelCpu,
final UtilizationModel utilizationModelRam,
final UtilizationModel utilizationModelBw) {
this(
cloudletId,
cloudletLength,
pesNumber,
cloudletFileSize,
cloudletOutputSize,
utilizationModelCpu,
utilizationModelRam,
utilizationModelBw,
false);
vmId = -1;
accumulatedBwCost = 0.0;
costPerBw = 0.0;
requiredFiles = new LinkedList<String>();
}
/**
* Allocates a new Cloudlet object. The Cloudlet length, input and output file sizes should be
* greater than or equal to 1.
*
* @param cloudletId the unique ID of this cloudlet
* @param cloudletLength the length or size (in MI) of this cloudlet to be executed in a
* PowerDatacenter
* @param cloudletFileSize the file size (in byte) of this cloudlet <tt>BEFORE</tt> submitting
* to a PowerDatacenter
* @param cloudletOutputSize the file size (in byte) of this cloudlet <tt>AFTER</tt> finish
* executing by a PowerDatacenter
* @param record record the history of this object or not
* @param fileList list of files required by this cloudlet
* @param pesNumber the pes number
* @param utilizationModelCpu the utilization model cpu
* @param utilizationModelRam the utilization model ram
* @param utilizationModelBw the utilization model bw
* @pre cloudletID >= 0
* @pre cloudletLength >= 0.0
* @pre cloudletFileSize >= 1
* @pre cloudletOutputSize >= 1
* @post $none
*/
public Cloudlet(
final int cloudletId,
final long cloudletLength,
final int pesNumber,
final long cloudletFileSize,
final long cloudletOutputSize,
final UtilizationModel utilizationModelCpu,
final UtilizationModel utilizationModelRam,
final UtilizationModel utilizationModelBw,
final boolean record,
final List<String> fileList) {
this(
cloudletId,
cloudletLength,
pesNumber,
cloudletFileSize,
cloudletOutputSize,
utilizationModelCpu,
utilizationModelRam,
utilizationModelBw,
record);
vmId = -1;
accumulatedBwCost = 0.0;
costPerBw = 0.0;
requiredFiles = fileList;
}
/**
* Allocates a new Cloudlet object. The Cloudlet length, input and output file sizes should be
* greater than or equal to 1. By default this constructor sets the history of this object.
*
* @param cloudletId the unique ID of this Cloudlet
* @param cloudletLength the length or size (in MI) of this cloudlet to be executed in a
* PowerDatacenter
* @param cloudletFileSize the file size (in byte) of this cloudlet <tt>BEFORE</tt> submitting
* to a PowerDatacenter
* @param cloudletOutputSize the file size (in byte) of this cloudlet <tt>AFTER</tt> finish
*
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 1、该资源内项目代码都是经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载使用,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能。 基于Java的云计算工作流调度算法可视化源码.zip 基于Java的云计算工作流调度算法可视化源码.zip 基于Java的云计算工作流调度算法可视化源码.zip 基于Java的云计算工作流调度算法可视化源码.zip
资源推荐
资源详情
资源评论
收起资源包目录
基于Java的云计算工作流调度算法可视化源码.zip (2000个子文件)
146-179_surfsnel_dsl_internl_net_arizona_beta 694B
146-179_surfsnel_dsl_internl_net_colostate_557 862B
146-179_surfsnel_dsl_internl_net_rnp_dcc_ufjf 860B
146-179_surfsnel_dsl_internl_net_root 785B
146-179_surfsnel_dsl_internl_net_tsinghua_xyz 864B
146-179_surfsnel_dsl_internl_net_uka_p2pns 581B
146-179_surfsnel_dsl_internl_net_uw_oneswarm 854B
147-179_surfsnel_dsl_internl_net_irisaple_HEAP 625B
147-179_surfsnel_dsl_internl_net_root 606B
147-179_surfsnel_dsl_internl_net_tsinghua_xyz 581B
147-179_surfsnel_dsl_internl_net_ucr_crawler 864B
147-179_surfsnel_dsl_internl_net_uw_oneswarm 580B
147-179_surfsnel_dsl_internl_net_uw_seattle 578B
147-179_surfsnel_dsl_internl_net_uw_trs2 615B
75-130-96-12_static_oxfr_ma_charter_com_irisaple_wup 577B
75-130-96-12_static_oxfr_ma_charter_com_root 591B
75-130-96-12_static_oxfr_ma_charter_com_tsinghua_xyz 862B
75-130-96-12_static_oxfr_ma_charter_com_tum_i2p 629B
75-130-96-12_static_oxfr_ma_charter_com_uw_oneswarm 827B
75-130-96-13_static_oxfr_ma_charter_com_rnp_alua 576B
75-130-96-13_static_oxfr_ma_charter_com_root 605B
75-130-96-13_static_oxfr_ma_charter_com_utokyo_sora 576B
75-130-96-13_static_oxfr_ma_charter_com_uw_seattle 577B
adam_ee_ntu_edu_tw_root 597B
adrastea_mcs_suffolk_edu_uka_p2pns 576B
aladdin_planetlab_extranet_uni-passau_de_ rnp_dcc_ufjf 864B
aladdin_planetlab_extranet_uni-passau_de_tsinghua_xyz 576B
aladdin_planetlab_extranet_uni-passau_de_uw_oneswarm 702B
aladdin_planetlab_extranet_uni-passau_de_uw_trs2 580B
chimay_infonet_fundp_ac_be_irisaple_HEAP 581B
chimay_infonet_fundp_ac_be_tsinghua_xyz 584B
chimay_infonet_fundp_ac_be_tum_i2p 586B
chimay_infonet_fundp_ac_be_uw_oneswarm 644B
chronos_disy_inf_uni-konstanz_de_root 590B
chronos_disy_inf_uni-konstanz_de_tsinghua_xyz 580B
chronos_disy_inf_uni-konstanz_de_tum_i2p 588B
chronos_disy_inf_uni-konstanz_de_upmc_ts 609B
chronos_disy_inf_uni-konstanz_de_uw_oneswarm 693B
mvnw.cmd 6KB
cs-planetlab3_cs_surrey_sfu_ca_root 594B
cs-planetlab3_cs_surrey_sfu_ca_tsinghua_xyz 644B
cs-planetlab3_cs_surrey_sfu_ca_tsinghua_xyz 589B
cs-planetlab3_cs_surrey_sfu_ca_uw_oneswarm 637B
cs-planetlab4_cs_surrey_sfu_ca_irisaple_wup 578B
cs-planetlab4_cs_surrey_sfu_ca_root 864B
cs-planetlab4_cs_surrey_sfu_ca_tsinghua_xyz 593B
cs-planetlab4_cs_surrey_sfu_ca_upmc_ts 593B
cs-planetlab4_cs_surrey_sfu_ca_uw_oneswarm 692B
cs-planetlab4_cs_surrey_sfu_ca_uw_oneswarm 655B
csplanetlab2_kaist_ac_kr_tsinghua_xyz 845B
csplanetlab4_kaist_ac_kr_princeton_codeen 577B
layui.css 71KB
layui.css 71KB
font-awesome.css 37KB
font-awesome.min.css 32KB
layuimini.css 20KB
wangEditor.css 17KB
wangEditor.min.css 15KB
layer.css 14KB
layer.css 14KB
layui.mobile.css 10KB
layui.mobile.css 10KB
zyupload-1.0.0.min.css 9KB
laydate.css 7KB
laydate.css 7KB
default.css 4KB
public.css 1KB
step.css 1KB
code.css 1KB
code.css 1KB
treetable.css 294B
CONTROL.CTL 814B
dannan_disy_inf_uni-konstanz_de_princeton_codeen 586B
dannan_disy_inf_uni-konstanz_de_root 590B
dannan_disy_inf_uni-konstanz_de_upmc_ts 595B
dannan_disy_inf_uni-konstanz_de_uw_oneswarm 673B
dannan_disy_inf_uni-konstanz_de_uw_trs2 603B
ds-pl3_technion_ac_il_neclabs_neclc 737B
ds-pl3_technion_ac_il_root 586B
ds-pl3_technion_ac_il_tsinghua_xyz 688B
ds-pl3_technion_ac_il_uw_oneswarm 822B
dschinni_planetlab_extranet_uni-passau_de_ rnp_dcc_ufjf 864B
dschinni_planetlab_extranet_uni-passau_de_uw_oneswarm 658B
earth_cs_brown_edu_uka_p2pns 576B
earth_cs_brown_edu_utokyo_sora 576B
ebb_colgate_edu_uw_oneswarm 647B
fontawesome-webfont.eot 162KB
iconfont.eot 41KB
iconfont.eot 41KB
eve_ee_ntu_edu_tw_colostate_557 864B
eve_ee_ntu_edu_tw_tsinghua_xyz 741B
eve_ee_ntu_edu_tw_uw_oneswarm 740B
evghu4_colbud_hu_uw_oneswarm 721B
evghu7_colbud_hu_uw_oneswarm 814B
fobos_cecalc_ula_ve_google_highground 599B
fobos_cecalc_ula_ve_root 582B
fobos_cecalc_ula_ve_tsinghua_xyz 619B
fobos_cecalc_ula_ve_uw_oneswarm 830B
fobos_cecalc_ula_ve_uw_seattle 583B
freedom_informatik_rwth-aachen_de_tsinghua_xyz 861B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- regoo0292024-03-13这个资源内容超赞,对我来说很有价值,很实用,感谢大佬分享~
Make程序设计
- 粉丝: 5725
- 资源: 3570
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功