本文整理汇总了Java中org.cloudbus.cloudsim.provisioners.RamProvisionerSimple类的典型用法代码示例。如果您正苦于以下问题:Java RamProvisionerSimple类的具体用法?Java RamProvisionerSimple怎么用?Java RamProvisionerSimple使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RamProvisionerSimple类属于org.cloudbus.cloudsim.provisioners包,在下文中一共展示了RamProvisionerSimple类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createHostList
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的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: createHostList
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的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;
}
示例3: createHostList
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的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;
}
示例4: createHost
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的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;
}
示例5: createHostList
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的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;
}
示例6: createHost
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的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
示例7: createHost
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的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
示例8: createHostList
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的package包/类
/**
* Creates the host list.
*
* @param hostsNumber
* the hosts number
*/
public void createHostList(int hostsNumber) {
for (int i = 1; i <= hostsNumber; i++) {
hostList.add(new PowerHost(i, new RamProvisionerSimple(MyConstants.HOST_RAM), new BwProvisionerSimple(
MyConstants.HOST_BW), MyConstants.HOST_STORAGE, peList, new VmSchedulerTimeSharedOverSubscription(
peList), MyConstants.HOST_POWER_MODEL));
}
}
示例9: createHost
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的package包/类
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++) peList.add(new Pe(peId++,new PeProvisionerSimple(mips)));
RamProvisioner ramPro = new RamProvisionerSimple(ram);
BwProvisioner bwPro = new BwProvisionerSimple(bw);
VmScheduler vmScheduler = new VmSchedulerTimeSharedEnergy(peList);
SDNHost newHost = new SDNHost(ramPro, bwPro, storage, peList, vmScheduler, this);
return newHost;
}
示例10: DynamicHost
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的package包/类
public DynamicHost(int id, int ram, long bandwidth, long io, long storage, double numberOfCusPerPe, int numberOfPes, double mipsPerPe) {
super(id, new RamProvisionerSimple(ram), new BwProvisionerFull(bandwidth), storage, new ArrayList<Pe>(), null);
setIo(io);
setMipsPerPe(mipsPerPe);
setNumberOfCusPerPe(numberOfCusPerPe);
List<Pe> peList = new ArrayList<>();
for (int i = 0; i < numberOfPes; i++) {
peList.add(new Pe(i, new PeProvisionerSimple(mipsPerPe)));
}
setPeList(peList);
setVmScheduler(new VmSchedulerTimeShared(peList));
setFailed(false);
localFiles = new HashSet<>();
}
示例11: createHost
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的package包/类
private static List<Host> createHost(int numberHosts){
List<Host> hostList = new ArrayList<Host>();
for(int i = 0 ; i < numberHosts ; i++){
List<Pe> peList = new ArrayList<Pe>();
int mips = Processors.Intel.Core_i7_Extreme_Edition_3960X.mips;
int cores = Processors.Intel.Core_i7_Extreme_Edition_3960X.cores;
for (int j = 0; j < cores; j++) {
peList.add(new Pe(j, new PeProvisionerSimple(mips / cores)));
}
int host_ID = 1+i;
int host_ram = 16384; //16 GB
long host_storage = 4194304; // 4 TB
int host_bw = 15360; // 15 GB ... Amazon EC2
hostList.add(new Host(host_ID, new RamProvisionerSimple(host_ram),
new BwProvisionerSimple(host_bw), host_storage,
//peList, new VmSchedulerSpaceShared(peList)));
peList, new VmSchedulerTimeShared(peList)));
//peList, new VmSchedulerTimeSharedOverSubscription(peList)));
}
return hostList;
}
示例12: must_execute_an_experiment_with_one_datacenter
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的package包/类
@Test
public void must_execute_an_experiment_with_one_datacenter()
{
// Experiment experiment = new ExperimentBuilder()
// .with(new DatacenterBuilder().with(5).hosts(
// new HostBuilder()
// .with(4, new CoreBuilder())
// .with(new RamBuilder().with().capacity(512))
// .with(new StorageBuilder().with().capacity(1000))))
// .build();
// experiment.run();
Host host = new HostBuilder().with(4).cores().with(1000).mips().using().provisioner(PeProvisionerSimple.class)
.with(512).ram().using().provisioner(RamProvisionerSimple.class)
.with(1000).storage().with(1000).bw().using().provisioner(BwProvisionerSimple.class)
.using().vm().scheduler(VmSchedulerSpaceShared.class).build();
Datacenter datacenter = new DatacenterBuilder().characteristics()
.os().linux().xen()
.costs().bw(1).cpu(1).memory(1).storage(1).timezone(1)
.storage().zero().build();
System.out.println(host);
// new ExperimentBuilder()
// .with(1)
// .dataCenter()
// .each()
// .with(5).hosts(with(4).cpu().and().with(512).ram().and().with(1).storage(with().capacity(1000)))
// .architecture(xen()).cost(cpu(2.3).and().memory(2.8).and().storage(3.2).and().bw(2.8));
}
示例13: createHosts
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的package包/类
private List<EdgeHost> createHosts(Element datacenterElement){
// Here are the steps needed to create a PowerDatacenter:
// 1. We need to create a list to store one or more Machines
List<EdgeHost> hostList = new ArrayList<EdgeHost>();
Element location = (Element)datacenterElement.getElementsByTagName("location").item(0);
String attractiveness = location.getElementsByTagName("attractiveness").item(0).getTextContent();
int wlan_id = Integer.parseInt(location.getElementsByTagName("wlan_id").item(0).getTextContent());
int x_pos = Integer.parseInt(location.getElementsByTagName("x_pos").item(0).getTextContent());
int y_pos = Integer.parseInt(location.getElementsByTagName("y_pos").item(0).getTextContent());
SimSettings.PLACE_TYPES placeType = SimUtils.stringToPlace(attractiveness);
NodeList hostNodeList = datacenterElement.getElementsByTagName("host");
for (int j = 0; j < hostNodeList.getLength(); j++) {
Node hostNode = hostNodeList.item(j);
Element hostElement = (Element) hostNode;
int numOfCores = Integer.parseInt(hostElement.getElementsByTagName("core").item(0).getTextContent());
double mips = Double.parseDouble(hostElement.getElementsByTagName("mips").item(0).getTextContent());
int ram = Integer.parseInt(hostElement.getElementsByTagName("ram").item(0).getTextContent());
long storage = Long.parseLong(hostElement.getElementsByTagName("storage").item(0).getTextContent());
long bandwidth = SimSettings.getInstance().getWlanBandwidth() / hostNodeList.getLength();
// 2. A Machine contains one or more PEs or CPUs/Cores. Therefore, should
// create a list to store these PEs before creating
// a Machine.
List<Pe> peList = new ArrayList<Pe>();
// 3. Create PEs and add these into the list.
//for a quad-core machine, a list of 4 PEs is required:
for(int i=0; i<numOfCores; i++){
peList.add(new Pe(i, new PeProvisionerSimple(mips))); // need to store Pe id and MIPS Rating
}
//4. Create Hosts with its id and list of PEs and add them to the list of machines
EdgeHost host = new EdgeHost(
hostIdCounter,
new RamProvisionerSimple(ram),
new BwProvisionerSimple(bandwidth), //kbps
storage,
peList,
new VmSchedulerSpaceShared(peList)
);
host.setPlace(new Location(placeType, wlan_id, x_pos, y_pos));
hostList.add(host);
hostIdCounter++;
}
return hostList;
}
示例14: createFogDevice
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的package包/类
private static FogDevice createFogDevice(String nodeName, long mips,
int ram, long upBw, long downBw, int level, double ratePerMips) {
List<Pe> peList = new ArrayList<Pe>();
// 3. Create PEs and add these into a list.
peList.add(new Pe(0, new PeProvisionerOverbooking(mips))); // need to store Pe id and MIPS Rating
int hostId = FogUtils.generateEntityId();
long storage = 1000000; // host storage
int bw = 10000;
PowerHost host = new PowerHost(
hostId,
new RamProvisionerSimple(ram),
new BwProvisionerOverbooking(bw),
storage,
peList,
new StreamOperatorScheduler(peList),
new PowerModelLinear(107.339, 83.4333)
);
List<Host> hostList = new ArrayList<Host>();
hostList.add(host);
String arch = "x86"; // system architecture
String os = "Linux"; // operating system
String vmm = "Xen";
double time_zone = 10.0; // time zone this resource located
double cost = 3.0; // the cost of using processing in this resource
double costPerMem = 0.05; // the cost of using memory in this resource
double costPerStorage = 0.001; // the cost of using storage in this
// resource
double costPerBw = 0.0; // the cost of using bw in this resource
LinkedList<Storage> storageList = new LinkedList<Storage>(); // we are not adding SAN
// devices by now
FogDeviceCharacteristics characteristics = new FogDeviceCharacteristics(
arch, os, vmm, host, time_zone, cost, costPerMem,
costPerStorage, costPerBw);
FogDevice fogdevice = null;
try {
fogdevice = new FogDevice(nodeName, characteristics,
new AppModuleAllocationPolicy(hostList), storageList, 10, upBw, downBw, 0, ratePerMips);
} catch (Exception e) {
e.printStackTrace();
}
fogdevice.setLevel(level);
return fogdevice;
}
示例15: createFogDevice
import org.cloudbus.cloudsim.provisioners.RamProvisionerSimple; //导入依赖的package包/类
public static FogDevice createFogDevice(String name, int mips, double uplinkBandwidth, double downlinkBandwidth, double latency, double ratePerMips) {
List<Pe> peList = new ArrayList<Pe>();
peList.add(new Pe(0, new PeProvisionerOverbooking(mips))); // need to store Pe id and MIPS Rating
int hostId = FogUtils.generateEntityId();
int ram = 2048; // host memory (MB)
long storage = 1000000; // host storage
int bw = 10000;
PowerHost host = new PowerHost(
hostId,
new RamProvisionerSimple(ram),
new BwProvisionerOverbooking(bw),
storage,
peList,
new StreamOperatorScheduler(peList),
new PowerModelLinear(100, 40)
);
List<Host> hostList = new ArrayList<Host>();
hostList.add(host);
String arch = "x86"; // system architecture
String os = "Linux"; // operating system
String vmm = "Xen";
double time_zone = 10.0; // time zone this resource located
double cost = 3.0; // the cost of using processing in this resource
double costPerMem = 0.05; // the cost of using memory in this resource
double costPerStorage = 0.001; // the cost of using storage in this
// resource
double costPerBw = 0.0; // the cost of using bw in this resource
LinkedList<Storage> storageList = new LinkedList<Storage>(); // we are not adding SAN
// devices by now
FogDeviceCharacteristics characteristics = new FogDeviceCharacteristics(
arch, os, vmm, host, time_zone, cost, costPerMem,
costPerStorage, costPerBw);
FogDevice fogdevice = null;
try {
fogdevice = new FogDevice(name, characteristics,
new AppModuleAllocationPolicy(hostList), storageList, 10, uplinkBandwidth, downlinkBandwidth, latency, ratePerMips);
} catch (Exception e) {
e.printStackTrace();
}
return fogdevice;
}