本文整理汇总了Java中org.cloudbus.cloudsim.Pe类的典型用法代码示例。如果您正苦于以下问题:Java Pe类的具体用法?Java Pe怎么用?Java Pe使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Pe类属于org.cloudbus.cloudsim包,在下文中一共展示了Pe类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createHostList
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
/**
* Creates the host list.
*
* @param hostsNumber the hosts number
*
* @return the list< power host>
*/
public static List<PowerHost> createHostList(int hostsNumber) {
List<PowerHost> hostList = new ArrayList<PowerHost>();
for (int i = 0; i < hostsNumber; i++) {
int hostType = i % Constants.HOST_TYPES;
List<Pe> peList = new ArrayList<Pe>();
for (int j = 0; j < Constants.HOST_PES[hostType]; j++) {
peList.add(new Pe(j, new PeProvisionerSimple(Constants.HOST_MIPS[hostType])));
}
hostList.add(new PowerHostUtilizationHistory(
i,
new RamProvisionerSimple(Constants.HOST_RAM[hostType]),
new BwProvisionerSimple(Constants.HOST_BW),
Constants.HOST_STORAGE,
peList,
new VmSchedulerTimeSharedOverSubscription(peList),
Constants.HOST_POWER[hostType]));
}
return hostList;
}
示例2: setStatusFailed
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
/**
* Sets the status of PEs of this machine to FAILED. NOTE: <tt>resName</tt> and
* <tt>machineID</tt> are used for debugging purposes, which is <b>ON</b> by default. Use
* {@link #setStatusFailed(boolean)} if you do not want this information.
*
* @param resName the name of the resource
* @param hostId the id of this machine
* @param failed the new value for the "failed" parameter
*/
public static <T extends Pe> void setStatusFailed(
List<T> peList,
String resName,
int hostId,
boolean failed) {
String status = null;
if (failed) {
status = "FAILED";
} else {
status = "WORKING";
}
Log.printLine(resName + " - Machine: " + hostId + " is " + status);
setStatusFailed(peList, failed);
}
示例3: createHostList
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
/**
* Creates a list of hosts
*
* @param hostsNumber
* the quantity of hosts
* @return the list of hosts
*/
public static List<Host> createHostList(int hostsNumber) {
List<Host> hostList = new LinkedList<Host>();
for (int i = 0; i < hostsNumber; i++) {
List<Pe> peList = new ArrayList<Pe>();
for (int j = 0; j < SimulationConstants.HOST_NUMBER_OF_PES; j++) {
peList.add(new Pe(j, new PeProvisionerSimple(SimulationConstants.HOST_MIPS)));
}
try {
hostList.add(new PSHost(i, new RamProvisionerSimple(SimulationConstants.HOST_RAM),
new BwProvisionerSimple(SimulationConstants.HOST_BW), SimulationConstants.HOST_STORAGE, peList,
SimulationConstants.BROKER_VM_SCHEDULER.getConstructor(List.class).newInstance(peList)));
} catch (Exception e) {
e.printStackTrace();
}
}
return hostList;
}
示例4: createHostList
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
/**
* Creates a list of hosts
*
* @param numHosts
* how many hosts to be created
* @return the list of hosts
* @throws SimulationCreationException
*/
public static List<Host> createHostList(int numHosts) throws SimulationCreationException {
List<Host> hostList = new LinkedList<Host>();
for (int i = 0; i < numHosts; i++) {
List<Pe> peList = new ArrayList<Pe>();
for (int j = 0; j < SimulationConstants.HOST_NUMBER_OF_PES; j++) {
peList.add(new Pe(j, new PeProvisionerSimple(SimulationConstants.HOST_MIPS)));
}
try {
hostList.add(new PSHost(i, new RamProvisionerSimple(SimulationConstants.HOST_RAM),
new BwProvisionerSimple(SimulationConstants.HOST_BW), SimulationConstants.HOST_STORAGE, peList,
SimulationConstants.BROKER_VM_SCHEDULER.getConstructor(List.class).newInstance(peList)));
} catch (Exception e) {
throw new SimulationCreationException(e.getMessage(), e);
}
}
return hostList;
}
示例5: createHost
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
@Override
public SDNHost createHost(int ram, long bw, long storage, long pes, double mips) {
LinkedList<Pe> peList = new LinkedList<Pe>();
int peId=0;
for(int i=0;i<pes;i++) {
PeProvisionerOverbooking prov = new PeProvisionerOverbooking(mips);
Pe pe = new Pe(peId++, prov);
peList.add(pe);
}
RamProvisioner ramPro = new RamProvisionerSimple(ram);
BwProvisioner bwPro = new BwProvisionerOverbooking(bw);
VmScheduler vmScheduler = new VmSchedulerTimeSharedOverSubscriptionDynamicVM(peList);
// VmScheduler vmScheduler = new VmSchedulerTimeSharedOverSubscriptionDynamicCloudlets(peList);
SDNHost newHost = new SDNHost(ramPro, bwPro, storage, peList, vmScheduler, this);
((VmSchedulerTimeSharedOverSubscriptionDynamicVM)vmScheduler).debugSetHost(newHost);
return newHost;
}
示例6: createHostList
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
/**
* Creates the host list.
*
* @param hostsNumber the hosts number
*
* @return the list< power host>
*/
public static List<PowerHost> createHostList(int hostsNumber) {
List<PowerHost> hostList = new ArrayList<PowerHost>();
for (int i = 0; i < hostsNumber; i++) {
int hostType = i % Constants.HOST_TYPES;
List<Pe> peList = new ArrayList<Pe>();
//HOST_PES 每台物理机中的处理单元个数
for (int j = 0; j < Constants.HOST_PES[hostType]; j++) {
peList.add(new Pe(j, new PeProvisionerSimple(Constants.HOST_MIPS[hostType])));
}
hostList.add(new PowerHostUtilizationHistory(
i,
new RamProvisionerSimple(Constants.HOST_RAM[hostType]),
new BwProvisionerSimple(Constants.HOST_BW),
Constants.HOST_STORAGE,
peList,
new VmSchedulerTimeSharedOverSubscription(peList),
// 设置能耗模型
Constants.HOST_POWER[hostType]));
}
return hostList;
}
示例7: _internalCreateDatacenter
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
private void _internalCreateDatacenter()
{
int pe_index = 0;
for (Vm vm :application.getAllVms())
{
// create the pe
List<Pe> peList = new ArrayList<Pe>();
double expected_mips = vm.getMips();
Pe pe = new Pe(pe_index++, new PeProvisionerSimple(expected_mips+1));
peList.add(pe);
// create the host
HostProfile profile = HostProfile.getDefault();
profile.set(HostParams.RAM_AMOUNT_MB, vm.getCurrentRequestedRam()+"");
Host host = HostFactory.get(profile, peList);
hostList.add(host);
}
}
示例8: NetworkHost
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
public NetworkHost(
int id,
RamProvisioner ramProvisioner,
BwProvisioner bwProvisioner,
long storage,
List<? extends Pe> peList,
VmScheduler vmScheduler) {
super(id, ramProvisioner, bwProvisioner, storage, peList, vmScheduler);
packetrecieved = new ArrayList<NetworkPacket>();
packetTosendGlobal = new ArrayList<NetworkPacket>();
packetTosendLocal = new ArrayList<NetworkPacket>();
}
示例9: PowerHost
import org.cloudbus.cloudsim.Pe; //导入依赖的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);
}
示例10: VmSchedulerSpaceSharedEnergy
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
/**
* Instantiates a new vm scheduler space shared.
*
* @param pelist the pelist
*/
public VmSchedulerSpaceSharedEnergy(List<? extends Pe> pelist) {
super(pelist);
setPeAllocationMap(new HashMap<String, List<Pe>>());
setFreePes(new ArrayList<Pe>());
getFreePes().addAll(pelist);
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:12,代码来源:VmSchedulerSpaceSharedEnergy.java
示例11: allocatePesForVm
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
@Override
public boolean allocatePesForVm(Vm vm, List<Double> mipsShare) {
// if there is no enough free PEs, fails
if (getFreePes().size() < mipsShare.size()) {
return false;
}
List<Pe> selectedPes = new ArrayList<Pe>();
Iterator<Pe> peIterator = getFreePes().iterator();
Pe pe = peIterator.next();
double totalMips = 0;
for (Double mips : mipsShare) {
if (mips <= pe.getMips()) {
selectedPes.add(pe);
totalMips += mips;
if (!peIterator.hasNext()) {
break;
}
pe = peIterator.next();
}
}
if (mipsShare.size() > selectedPes.size()) {
return false;
}
getFreePes().removeAll(selectedPes);
getPeAllocationMap().put(vm.getUid(), selectedPes);
getMipsMap().put(vm.getUid(), mipsShare);
setAvailableMips(getAvailableMips() - totalMips);
return true;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:33,代码来源:VmSchedulerSpaceSharedEnergy.java
示例12: createHost
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
@Override
protected Host createHost(int hostId, int ram, long bw, long storage, long pes, double mips) {
LinkedList<Pe> peList = new LinkedList<Pe>();
int peId=0;
for(int i=0;i<pes;i++) peList.add(new Pe(peId++,new PeProvisionerOverbooking(mips)));
RamProvisioner ramPro = new RamProvisionerSimple(ram);
BwProvisioner bwPro = new BwProvisionerOverbooking(bw);
VmScheduler vmScheduler = new VmSchedulerTimeSharedOverbookingEnergy(peList);
Host newHost = new Host(hostId, ramPro, bwPro, storage, peList, vmScheduler);
return newHost;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:14,代码来源:OverbookingNetworkOperatingSystem.java
示例13: createHost
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
protected Host createHost(int hostId, int ram, long bw, long storage, long pes, double mips) {
LinkedList<Pe> peList = new LinkedList<Pe>();
int peId=0;
for(int i=0;i<pes;i++) peList.add(new Pe(peId++,new PeProvisionerSimple(mips)));
RamProvisioner ramPro = new RamProvisionerSimple(ram);
BwProvisioner bwPro = new BwProvisionerSimple(bw);
VmScheduler vmScheduler = new VmSchedulerTimeSharedEnergy(peList);
Host newHost = new Host(hostId, ramPro, bwPro, storage, peList, vmScheduler);
return newHost;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:13,代码来源:NetworkOperatingSystem.java
示例14: getMaxUtilization
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
/**
* Gets the max utilization among by all PEs.
*
* @param peList the pe list
* @return the utilization
*/
public static <T extends Pe> double getMaxUtilization(List<T> peList) {
double maxUtilization = 0;
for (Pe pe : peList) {
double utilization = pe.getPeProvisioner().getUtilization();
if (utilization > maxUtilization) {
maxUtilization = utilization;
}
}
return maxUtilization;
}
示例15: getMaxUtilizationAmongVmsPes
import org.cloudbus.cloudsim.Pe; //导入依赖的package包/类
/**
* Gets the max utilization among by all PEs allocated to the VM.
*
* @param vm the vm
* @param peList the pe list
* @return the utilization
*/
public static <T extends Pe> double getMaxUtilizationAmongVmsPes(List<T> peList, Vm vm) {
double maxUtilization = 0;
for (Pe pe : peList) {
if (pe.getPeProvisioner().getAllocatedMipsForVm(vm) == null) {
continue;
}
double utilization = pe.getPeProvisioner().getUtilization();
if (utilization > maxUtilization) {
maxUtilization = utilization;
}
}
return maxUtilization;
}