本文整理汇总了Java中org.cloudbus.cloudsim.provisioners.PeProvisioner类的典型用法代码示例。如果您正苦于以下问题:Java PeProvisioner类的具体用法?Java PeProvisioner怎么用?Java PeProvisioner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PeProvisioner类属于org.cloudbus.cloudsim.provisioners包,在下文中一共展示了PeProvisioner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HostBuilder
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
private HostBuilder(int numberOfCores, double mips, int ramSize, long bw, long storageCapacity,
Class<? extends PeProvisioner> cpuProvisionerClass, Class<? extends RamProvisioner> ramProvisionerClass,
Class<? extends VmScheduler> vmSchedulerClass,
Class<? extends BwProvisioner> bwProvisionerClass)
{
this.numberOfCores_ = numberOfCores;
this.mips_ = mips;
this.ramSize_ = ramSize;
this.bw_ = bw;
this.storageCapacity_ = storageCapacity;
this.cpuProvisionerClass_ = cpuProvisionerClass;
this.ramProvisionerClass_ = ramProvisionerClass;
this.vmSchedulerClass_ = vmSchedulerClass;
this.bwProvisionerClass_ = bwProvisionerClass;
}
示例2: create
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
public List<Pe> create(final double amount, final double mipsOfEachPe) {
try {
validateAmount(amount);
final List<Pe> peList = new ArrayList<>();
final Constructor cons =
provisionerClass.getConstructor();
for (int i = 0; i < amount; i++) {
peList.add(new PeSimple(mipsOfEachPe, (PeProvisioner) cons.newInstance()));
}
return peList;
} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
throw new RuntimeException("It wasn't possible to instantiate a list of Pe", ex);
}
}
示例3: getMaxAvailableMips
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
@Override
public double getMaxAvailableMips() {
return getWorkingPeList().stream()
.map(Pe::getPeProvisioner)
.mapToDouble(PeProvisioner::getAvailableResource)
.max().orElse(0.0);
}
示例4: setPeProvisioner
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
@Override
public final Pe setPeProvisioner(PeProvisioner peProvisioner) {
Objects.requireNonNull(peProvisioner);
this.peProvisioner = peProvisioner;
this.peProvisioner.setPe(this);
return this;
}
示例5: getMaxUtilization
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
/**
* Gets the max utilization percentage (between [0 and 1]) among all PEs.
*
* @param peList the pe list
* @return the max utilization percentage (between [0 and 1])
*/
public static double getMaxUtilization(List<? extends Pe> peList) {
return peList.stream()
.map(Pe::getPeProvisioner)
.mapToDouble(PeProvisioner::getUtilization)
.max().orElse(0);
}
示例6: getMaxUtilizationAmongVmsPes
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
/**
* Gets the max utilization percentage among all PEs allocated to a VM.
*
* @param vm the vm to get the maximum utilization percentage
* @param peList the pe list
* @return the max utilization percentage
*/
public static double getMaxUtilizationAmongVmsPes(List<? extends Pe> peList, Vm vm) {
return peList.stream()
.map(Pe::getPeProvisioner)
.filter(pv -> pv.getAllocatedResourceForVm(vm) > 0)
.mapToDouble(PeProvisioner::getUtilization)
.max().orElse(0);
}
示例7: provisioner
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
@Override
public WithRam provisioner(Class<? extends PeProvisioner> cpuProvisionerType)
{
cpuProvisionerClass_ = cpuProvisionerType;
return new WithRam()
{
@Override
public RamBuilder with(int ram)
{
ramSize_ = ram;
return new RamBuilderImpl();
}
};
}
示例8: getProvisionerClass
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
public Class<? extends PeProvisioner> getProvisionerClass() {
return provisionerClass;
}
示例9: setProvisioner
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
public PeBuilder setProvisioner(Class<? extends PeProvisioner> defaultProvisioner) {
this.provisionerClass = defaultProvisioner;
return this;
}
示例10: getPeProvisioner
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
@Override public PeProvisioner getPeProvisioner() {
return new PeProvisionerSimple();
}
示例11: setPeProvisioner
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
@Override public Pe setPeProvisioner(PeProvisioner peProvisioner) {
return Pe.NULL;
}
示例12: createPe
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
private PeSimple createPe(PeProvisioner peProvisioner) {
return new PeSimple(0, peProvisioner);
}
示例13: newPeProvisioner
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
public static PeProvisioner newPeProvisioner(final HostRegistry hr) throws RuntimeException {
return resourceProvisioner("Pe", hr.getPeProvisioner());
}
示例14: Pe
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
/**
* Allocates a new Pe object.
*
* @param id the Pe ID
* @param peProvisioner the pe provisioner
* @pre id >= 0
* @pre peProvisioner != null
* @post $none
*/
public Pe(int id, PeProvisioner peProvisioner) {
setId(id);
setPeProvisioner(peProvisioner);
// when created it should be set to FREE, i.e. available for use.
status = FREE;
}
示例15: Pe
import org.cloudbus.cloudsim.provisioners.PeProvisioner; //导入依赖的package包/类
/**
* 一个新的PE
* Allocates a new Pe object.
*
* @param id the Pe ID
* @param peProvisioner the pe provisioner
* @pre id >= 0
* @pre peProvisioner != null
* @post $none
*/
public Pe(int id, PeProvisioner peProvisioner) {
setId(id);
setPeProvisioner(peProvisioner);
// when created it should be set to FREE, i.e. available for use.
status = FREE;
}