本文整理汇总了Java中org.cloudbus.cloudsim.power.models.PowerModel类的典型用法代码示例。如果您正苦于以下问题:Java PowerModel类的具体用法?Java PowerModel怎么用?Java PowerModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PowerModel类属于org.cloudbus.cloudsim.power.models包,在下文中一共展示了PowerModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createPowerHost
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
private PowerHostUtilizationHistory createPowerHost() {
final List<Pe> peList = new ArrayList<>(HOST_PES);
//List of Host's CPUs (Processing Elements, PEs)
for (int i = 0; i < HOST_PES; i++) {
peList.add(new PeSimple(1000, new PeProvisionerSimple()));
}
final PowerModel powerModel = new PowerModelLinear(MAX_POWER, STATIC_POWER_PERCENT);
final long ram = 2048; //in Megabytes
final long bw = 10000; //in Megabits/s
final long storage = 1000000; //in Megabytes
final ResourceProvisioner ramProvisioner = new ResourceProvisionerSimple();
final ResourceProvisioner bwProvisioner = new ResourceProvisionerSimple();
final VmScheduler vmScheduler = new VmSchedulerTimeShared();
final PowerHostUtilizationHistory host = new PowerHostUtilizationHistory(ram, bw, storage, peList);
host.setPowerModel(powerModel);
host
.setRamProvisioner(ramProvisioner)
.setBwProvisioner(bwProvisioner)
.setVmScheduler(vmScheduler);
return host;
}
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:25,代码来源:PowerExample.java
示例2: PowerHostSimple
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
/**
* Creates a PowerHost with the given parameters.
*
* @param id the id of the host
* @param ramProvisioner the ram provisioner with capacity in MEGABYTE
* @param bwProvisioner the bw provisioner with capacity in Megabits/s
* @param storage the storage capacity in MEGABYTE
* @param peList the host's PEs list
* @param vmScheduler the VM scheduler
* @param powerModel the model of power consumption
*
* @deprecated Use the other available constructors with less parameters
* and set the remaining ones using the respective setters.
* This constructor will be removed in future versions.
*/
@Deprecated
public PowerHostSimple(
int id,
ResourceProvisioner ramProvisioner,
ResourceProvisioner bwProvisioner,
long storage,
List<Pe> peList,
VmScheduler vmScheduler,
PowerModel powerModel)
{
this(ramProvisioner.getCapacity(), bwProvisioner.getCapacity(), storage, peList);
setRamProvisioner(ramProvisioner);
setBwProvisioner(bwProvisioner);
setVmScheduler(vmScheduler);
setPowerModel(powerModel);
}
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:32,代码来源:PowerHostSimple.java
示例3: PowerHostUtilizationHistory
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
/**
* Creates a PowerHostUtilizationHistory with the given parameters.
*
* @param id the host id
* @param ramProvisioner the ram provisioner with capacity in MEGABYTE
* @param bwProvisioner the bw provisioner with capacity in Megabits/s
* @param storage the storage capacity in MEGABYTE
* @param peList the host's PEs list
* @param vmScheduler the vm scheduler
* @param powerModel the power consumption model
*
* @deprecated Use the other available constructors with less parameters
* and set the remaining ones using the respective setters.
* This constructor will be removed in future versions.
*/
@Deprecated
public PowerHostUtilizationHistory(
int id,
ResourceProvisioner ramProvisioner,
ResourceProvisioner bwProvisioner,
long storage,
List<Pe> peList,
VmScheduler vmScheduler,
PowerModel powerModel)
{
this(ramProvisioner.getCapacity(), bwProvisioner.getCapacity(), storage, peList);
setRamProvisioner(ramProvisioner);
setBwProvisioner(bwProvisioner);
setVmScheduler(vmScheduler);
setPowerModel(powerModel);
}
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:32,代码来源:PowerHostUtilizationHistory.java
示例4: PowerHost
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
/**
* Instantiates a new host.
*
* @param id the id
* @param ramProvisioner the ram provisioner
* @param bwProvisioner the bw provisioner
* @param storage the storage
* @param peList the pe list
* @param vmScheduler the VM scheduler
*/
public PowerHost(
int id,
RamProvisioner ramProvisioner,
BwProvisioner bwProvisioner,
long storage,
List<? extends Pe> peList,
VmScheduler vmScheduler,
PowerModel powerModel) {
super(id, ramProvisioner, bwProvisioner, storage, peList, vmScheduler);
setPowerModel(powerModel);
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:22,代码来源:PowerHost.java
示例5: setPowerModel
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
@Override
public final PowerHost setPowerModel(PowerModel powerModel) {
Objects.requireNonNull(powerModel);
this.powerModel = powerModel;
this.powerModel.setHost(this);
return this;
}
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:8,代码来源:PowerHostSimple.java
示例6: PowerHostExtra
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
public PowerHostExtra(int id, RamProvisioner ramProvisioner,
BwProvisioner bwProvisioner, long storage,
List<? extends Pe> peList, VmScheduler vmScheduler,
PowerModel powerModel, double staticPower) {
super(id, ramProvisioner, bwProvisioner, storage, peList, vmScheduler,
powerModel);
// TODO Auto-generated constructor stub
this.staticPower = staticPower;
}
开发者ID:StVak,项目名称:cloudsimPowerStats,代码行数:11,代码来源:PowerHostExtra.java
示例7: getPowerModel
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
@Override
public PowerModel getPowerModel() {
return powerModel;
}
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:5,代码来源:PowerHostSimple.java
示例8: getPowerModel
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
@Override public PowerModel getPowerModel() {
return PowerModel.NULL;
}
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:4,代码来源:PowerHostNull.java
示例9: setPowerModel
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
@Override public PowerHost setPowerModel(PowerModel powerModel) {
return PowerHost.NULL;
}
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:4,代码来源:PowerHostNull.java
示例10: getDatacenterPowerUsageForTimeSpan
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
/**
* Gets the total power consumed (in Watts/sec) by all Hosts of the Datacenter since the last time the processing
* of Cloudlets in this Host was updated.
*
* @return the total power consumed (in Watts/sec) by all Hosts in the elapsed time span
*/
private double getDatacenterPowerUsageForTimeSpan() {
final double currentTime = getSimulation().clock();
final double timeSpan = currentTime - getLastProcessTime();
if (timeSpan == 0) {
return 0;
}
double datacenterTimeSpanPowerUse = 0;
final StringBuilder sb = new StringBuilder(this.<PowerHostSimple>getHostList().size()*100);
for (PowerHostSimple host : this.<PowerHostSimple>getHostList()) {
final double previousUseOfCpu = host.getPreviousUtilizationOfCpu();
final double utilizationOfCpu = host.getUtilizationOfCpu();
final double timeFrameHostEnergy =
host.getEnergyLinearInterpolation(previousUseOfCpu, utilizationOfCpu, timeSpan);
datacenterTimeSpanPowerUse += timeFrameHostEnergy;
sb.append(String.format(
"%.2f: [%s] utilization at %.2f was %.2f%%, now is %.2f%%",
currentTime,
host,
getLastProcessTime(),
previousUseOfCpu * 100,
utilizationOfCpu * 100));
if(host.getPowerModel() != PowerModel.NULL) {
sb.append(String.format(
"%.2f: [%s] energy is %.2f Watts/sec",
currentTime,
host,
timeFrameHostEnergy));
}
}
if(datacenterTimeSpanPowerUse > 0) {
println(String.format(
"\nDatacenter %d energy consumption for the last time frame from %.2f to %.2f:",
getId(),
getLastProcessTime(),
currentTime));
println(sb.toString());
println(String.format(
"\n%.2f: Datacenter %d energy is %.2f Watts/sec\n",
currentTime, getId(),
datacenterTimeSpanPowerUse));
}
return datacenterTimeSpanPowerUse;
}
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:54,代码来源:PowerDatacenter.java
示例11: PowerHostUtilizationHistory
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
/**
* Instantiates a new power host utilization history.
*
* @param id the id
* @param ramProvisioner the ram provisioner
* @param bwProvisioner the bw provisioner
* @param storage the storage
* @param peList the pe list
* @param vmScheduler the vm scheduler
* @param powerModel the power model
*/
public PowerHostUtilizationHistory(
int id,
RamProvisioner ramProvisioner,
BwProvisioner bwProvisioner,
long storage,
List<? extends Pe> peList,
VmScheduler vmScheduler,
PowerModel powerModel) {
super(id, ramProvisioner, bwProvisioner, storage, peList, vmScheduler, powerModel);
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:22,代码来源:PowerHostUtilizationHistory.java
示例12: setPowerModel
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
/**
* Sets the power model.
*
* @param powerModel the new power model
*/
protected void setPowerModel(PowerModel powerModel) {
this.powerModel = powerModel;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:9,代码来源:PowerHost.java
示例13: getPowerModel
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
/**
* Gets the power model.
*
* @return the power model
*/
public PowerModel getPowerModel() {
return powerModel;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:9,代码来源:PowerHost.java
示例14: getPowerModel
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
/**
* Gets the power model used by the host
* to define how it consumes power.
*
* @return the power model
*/
PowerModel getPowerModel();
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:8,代码来源:PowerHost.java
示例15: setPowerModel
import org.cloudbus.cloudsim.power.models.PowerModel; //导入依赖的package包/类
/**
* Sets the power model.
*
* @param powerModel the new power model
* @return
*/
PowerHost setPowerModel(PowerModel powerModel);
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:8,代码来源:PowerHost.java
注:本文中的org.cloudbus.cloudsim.power.models.PowerModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论