本文整理汇总了Java中org.cloudbus.cloudsim.Storage类的典型用法代码示例。如果您正苦于以下问题:Java Storage类的具体用法?Java Storage怎么用?Java Storage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Storage类属于org.cloudbus.cloudsim包,在下文中一共展示了Storage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createDatacenters
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
@Override
public List<FederationDatacenter> createDatacenters()
{
List<FederationDatacenter> list = new ArrayList<FederationDatacenter>();
List<Storage> storageList = new ArrayList<Storage>(); // if empty, no SAN attached
// create the DCs, for now one host per DC
for (Host h: hostList)
{
List<Host> tmpList = new ArrayList<Host>();
tmpList.add(h);
list.add(FederationDatacenterFactory.getDefault(tmpList, storageList));
}
datacenters = list;
return list;
}
开发者ID:ecarlini,项目名称:smartfed,代码行数:19,代码来源:PreciseDataset.java
示例2: PowerDatacenter
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
/**
* Instantiates a new datacenter.
*
* @param name the name
* @param characteristics the res config
* @param schedulingInterval the scheduling interval
* @param utilizationBound the utilization bound
* @param vmAllocationPolicy the vm provisioner
* @param storageList the storage list
* @throws Exception the exception
*/
public PowerDatacenter(
String name,
DatacenterCharacteristics characteristics,
VmAllocationPolicy vmAllocationPolicy,
List<Storage> storageList,
double schedulingInterval) throws Exception {
super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
setPower(0.0);
setDisableMigrations(false);
setCloudletSubmitted(-1);
setMigrationCount(0);
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:25,代码来源:PowerDatacenter.java
示例3: createSDNDatacenter
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
protected static SDNDatacenter createSDNDatacenter(String name, String physicalTopology, NetworkOperatingSystem snos, VmAllocationPolicyFactory vmAllocationFactory) {
// In order to get Host information, pre-create NOS.
nos=snos;
List<Host> hostList = nos.getHostList();
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
DatacenterCharacteristics characteristics = new DatacenterCharacteristics(
arch, os, vmm, hostList, time_zone, cost, costPerMem,
costPerStorage, costPerBw);
// Create Datacenter with previously set parameters
SDNDatacenter datacenter = null;
try {
VmAllocationPolicy vmPolicy = vmAllocationFactory.create(hostList);
maxHostHandler = (PowerUtilizationMaxHostInterface)vmPolicy;
datacenter = new SDNDatacenter(name, characteristics, vmPolicy, storageList, 0, nos);
nos.setDatacenter(datacenter);
} catch (Exception e) {
e.printStackTrace();
}
return datacenter;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:38,代码来源:SDNExample.java
示例4: createSDNDatacenter
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
private SDNDatacenter createSDNDatacenter(String name, String physicalTopology) {
// In order to get Host information, pre-create NOS.
nos = new SimpleNetworkOperatingSystem(physicalTopology);
List<Host> hostList = nos.getHostList();
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
DatacenterCharacteristics characteristics = new DatacenterCharacteristics(
arch, os, vmm, hostList, time_zone, cost, costPerMem,
costPerStorage, costPerBw);
// Create Datacenter with previously set parameters
SDNDatacenter datacenter = null;
try {
datacenter = new SDNDatacenter(name, characteristics, new VmAllocationPolicyCombinedLeastFullFirst(hostList), storageList, 0, nos);
//datacenter = new SDNDatacenter(name, characteristics, new VmAllocationPolicyCombinedMostFullFirst(hostList), storageList, 0, nos);
//datacenter = new SDNDatacenter(name, characteristics, new VmAllocationPolicyMipsLeastFullFirst(hostList), storageList, 0, nos);
nos.setDatacenter(datacenter);
} catch (Exception e) {
e.printStackTrace();
}
return datacenter;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:39,代码来源:GraphicSDNExample.java
示例5: SDNDatacenter
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
public SDNDatacenter(String name, DatacenterCharacteristics characteristics, VmAllocationPolicy vmAllocationPolicy, List<Storage> storageList, double schedulingInterval, NetworkOperatingSystem nos) throws Exception {
super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
this.nos=nos;
this.requestsTable = new HashMap<Integer, Request>();
//nos.init();
}
开发者ID:jayjmin,项目名称:cloudsimsdn,代码行数:9,代码来源:SDNDatacenter.java
示例6: createDatacenter
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
private FederationDatacenter createDatacenter(int dc_id, Properties prop, String place, String cost_per_mem, int ram){
FederationDatacenterProfile prof = FederationDatacenterProfile.getDefault();
prof.set(DatacenterParams.COST_PER_MEM, cost_per_mem);
prof.set(DatacenterParams.COUNTRY, Country.Italy.toString());
int hostListSize = Integer.parseInt(prop.getProperty(Constant.DATACENTER_SIZE));
List<Host> hostList = new ArrayList<Host>();
for(int i=0; i< hostListSize; i++){
hostList.add(createHost(prop, ram));
}
List<Storage> storageList = new ArrayList<Storage>();
return FederationDatacenterFactory.get(prof, hostList, storageList);
}
开发者ID:ecarlini,项目名称:smartfed,代码行数:14,代码来源:SimpleTest.java
示例7: createDatacenter
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
private FederationDatacenter createDatacenter(int dc_id, Properties prop, String place, long maxBw){
FederationDatacenterProfile prof = FederationDatacenterProfile.getDefault();
// prof.set(DatacenterParams.COST_PER_MEM, cost_per_mem);
prof.set(DatacenterParams.COUNTRY, place);
prof.set(DatacenterParams.MAX_BW_FOR_VM, + maxBw +"");
int hostListSize = Integer.parseInt(prop.getProperty(Constant.DATACENTER_SIZE));
List<Host> hostList = new ArrayList<Host>();
for(int i=0; i< hostListSize; i++){
hostList.add(createHost(prop));
}
List<Storage> storageList = new ArrayList<Storage>();
return FederationDatacenterFactory.get(prof, hostList, storageList);
}
开发者ID:ecarlini,项目名称:smartfed,代码行数:15,代码来源:EdgeTest.java
示例8: createDatacenter
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
private FederationDatacenter createDatacenter(int dc_id, Properties prop, String place){
double cost = Double.parseDouble(prop.getProperty("higher_cost_per_mem")); //in GB
String costStorage = prop.getProperty(Constant.COST_STORAGE);
final int factor = 1000;
double random_cost_per_gb_mem = ((cost*factor) - decrement--) / factor ;
double random_cost_per_mb_mem = random_cost_per_gb_mem ; // for simplicity
random_cost_per_mb_mem = (random_cost_per_mb_mem < 0) ? cost/1024 : random_cost_per_mb_mem;
// double random_cost_per_mb_mem_year = random_cost_per_mb_mem * 24 * 365; // from hour to year
System.out.println("Random cost per mb " + random_cost_per_mb_mem);
FederationDatacenterProfile prof = FederationDatacenterProfile.getDefault();
prof.set(DatacenterParams.COST_PER_MEM, Double.toString(random_cost_per_mb_mem));
prof.set(DatacenterParams.COST_PER_STORAGE, costStorage);
prof.set(DatacenterParams.COUNTRY, place);
// int randInt = Math.abs( (rand.nextInt() % numDatacenters) );
// randInt++; // exclude 0
double ram = Double.parseDouble(prop.getProperty(Constant.HRAM));// / randInt;
double mips = Double.parseDouble(prop.getProperty(Constant.MIPS));
int hostListSize = numHostPerDc;
List<Host> hostList = new ArrayList<Host>();
for(int i=0; i < hostListSize; i++){
hostList.add(createSimplerHost(ram, mips));
}
List<Storage> storageList = new ArrayList<Storage>();
return FederationDatacenterFactory.get(prof, hostList, storageList);
}
开发者ID:ecarlini,项目名称:smartfed,代码行数:31,代码来源:DataSetMS.java
示例9: getUniformDistribution
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
public static List<FederationDatacenter> getUniformDistribution(int numOfDatacenters, int numOfHost, FederationDatacenterProfile profile)
{
Random r = new Random(13213);
int core_variance = maxNumOfCores - minNumOfCores;
int delta_cores = core_variance > 0 ? r.nextInt(core_variance) : 0;
if (numOfHost < 1)
numOfHost = 1;
List<FederationDatacenter> list = new ArrayList<FederationDatacenter>();
for (int i=0; i<numOfDatacenters; i++)
{
// create the virtual processor (PE)
List<Pe> peList = new ArrayList<Pe>();
int mips = 25000;
for (int j=0; j<minNumOfCores + delta_cores; j++)
{
peList.add(new Pe(j, new PeProvisionerSimple(mips)));
}
// create the hosts
List<Host> hostList = new ArrayList<Host>();
HostProfile prof = HostProfile.getDefault();
prof.set(HostParams.RAM_AMOUNT_MB, 16*1024+"");
for (int k=0; k<numOfHost; k++)
{
hostList.add(HostFactory.get(prof, peList));
}
// create the storage
List<Storage> storageList = new ArrayList<Storage>(); // if empty, no SAN attached
// create the datacenters
list.add(FederationDatacenterFactory.get(profile, hostList, storageList));
}
return list;
}
开发者ID:ecarlini,项目名称:smartfed,代码行数:40,代码来源:DatacenterFacilities.java
示例10: createDatacenters
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
@Override
public List<FederationDatacenter> createDatacenters()
{
List<FederationDatacenter> list = new ArrayList<FederationDatacenter>();
List<Storage> storageList = new ArrayList<Storage>(); // if empty, no SAN attached
// create the virtual processor (PE)
List<Pe> peList = new ArrayList<Pe>();
int mips = 25000;
for (int i=0; i < SingleApplicationTest.cpu; i++)
peList.add(new Pe(i, new PeProvisionerSimple(mips)));
// create the hosts for DC 1
List<Host> hostList = new ArrayList<Host>();
HostProfile prof = HostProfile.getDefault();
prof.set(HostParams.RAM_AMOUNT_MB, 2*1024+"");
prof.set(HostParams.STORAGE_MB, "1000");
prof.set(HostParams.BW_AMOUNT, "1024");
for (int k=0; k<100; k++)
{
hostList.add(HostFactory.get(prof, peList));
}
// Creating DC1
FederationDatacenterProfile fcp1 = FederationDatacenterProfile.getDefault();
fcp1.set(DatacenterParams.COUNTRY, "Italy");
fcp1.set(DatacenterParams.COST_PER_MEM, SingleApplicationTest.costPerMem);
fcp1.set(DatacenterParams.COST_PER_STORAGE, SingleApplicationTest.costPerStorage);
fcp1.set(DatacenterParams.COST_PER_SEC, SingleApplicationTest.costPerCPU);
fcp1.set(DatacenterParams.COST_PER_BW, "0.03");
list.add(FederationDatacenterFactory.get(fcp1, hostList, storageList));
return list;
}
开发者ID:ecarlini,项目名称:smartfed,代码行数:37,代码来源:SingleApplicationTest.java
示例11: WorkflowDatacenter
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
public WorkflowDatacenter(String name,
DatacenterCharacteristics characteristics,
VmAllocationPolicy vmAllocationPolicy,
List<Storage> storageList,
double schedulingInterval) throws Exception {
super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
}
开发者ID:WorkflowSim,项目名称:WorkflowSim-1.0,代码行数:8,代码来源:WorkflowDatacenter.java
示例12: PowerDatacenterExtra
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
public PowerDatacenterExtra(String name,
DatacenterCharacteristics characteristics,
VmAllocationPolicy vmAllocationPolicy, List<Storage> storageList,
double schedulingInterval) throws Exception {
super(name, characteristics, vmAllocationPolicy, storageList,
schedulingInterval);
}
开发者ID:StVak,项目名称:cloudsimPowerStats,代码行数:8,代码来源:PowerDatacenterExtra.java
示例13: SDNDatacenter
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
public SDNDatacenter(String name, DatacenterCharacteristics characteristics, VmAllocationPolicy vmAllocationPolicy, List<Storage> storageList, double schedulingInterval, NetworkOperatingSystem nos) throws Exception {
super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
this.nos=nos;
//nos.init();
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:7,代码来源:SDNDatacenter.java
示例14: createFogDevice
import org.cloudbus.cloudsim.Storage; //导入依赖的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;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:53,代码来源:JsonToTopology.java
示例15: createFogDevice
import org.cloudbus.cloudsim.Storage; //导入依赖的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;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:50,代码来源:FogEntityFactory.java
示例16: FogDevice
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
public FogDevice(
String name,
FogDeviceCharacteristics characteristics,
VmAllocationPolicy vmAllocationPolicy,
List<Storage> storageList,
double schedulingInterval,
double uplinkBandwidth, double downlinkBandwidth, double uplinkLatency, double ratePerMips) throws Exception {
super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
setCharacteristics(characteristics);
setVmAllocationPolicy(vmAllocationPolicy);
setLastProcessTime(0.0);
setStorageList(storageList);
setVmList(new ArrayList<Vm>());
setSchedulingInterval(schedulingInterval);
setUplinkBandwidth(uplinkBandwidth);
setDownlinkBandwidth(downlinkBandwidth);
setUplinkLatency(uplinkLatency);
setRatePerMips(ratePerMips);
setAssociatedActuatorIds(new ArrayList<Pair<Integer, Double>>());
for (Host host : getCharacteristics().getHostList()) {
host.setDatacenter(this);
}
setActiveApplications(new ArrayList<String>());
// If this resource doesn't have any PEs then no useful at all
if (getCharacteristics().getNumberOfPes() == 0) {
throw new Exception(super.getName()
+ " : Error - this entity has no PEs. Therefore, can't process any Cloudlets.");
}
// stores id of this class
getCharacteristics().setId(super.getId());
applicationMap = new HashMap<String, Application>();
appToModulesMap = new HashMap<String, List<String>>();
northTupleQueue = new LinkedList<Tuple>();
southTupleQueue = new LinkedList<Pair<Tuple, Integer>>();
setNorthLinkBusy(false);
setSouthLinkBusy(false);
setChildrenIds(new ArrayList<Integer>());
setChildToOperatorsMap(new HashMap<Integer, List<String>>());
this.cloudTrafficMap = new HashMap<Integer, Integer>();
this.lockTime = 0;
this.energyConsumption = 0;
this.lastUtilization = 0;
setTotalCost(0);
setModuleInstanceCount(new HashMap<String, Map<String, Integer>>());
setChildToLatencyMap(new HashMap<Integer, Double>());
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:53,代码来源:FogDevice.java
示例17: createFogDevice
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
/**
* Creates a vanilla fog device
* @param nodeName name of the device to be used in simulation
* @param mips MIPS
* @param ram RAM
* @param upBw uplink bandwidth
* @param downBw downlink bandwidth
* @param level hierarchy level of the device
* @param ratePerMips cost rate per MIPS used
* @param busyPower
* @param idlePower
* @return
*/
private static FogDevice createFogDevice(String nodeName, long mips,
int ram, long upBw, long downBw, int level, double ratePerMips, double busyPower, double idlePower) {
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 FogLinearPowerModel(busyPower, idlePower)
);
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;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:66,代码来源:DCNSFogCloudHigh.java
示例18: createFogDevice
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
/**
* Creates a vanilla fog device
* @param nodeName name of the device to be used in simulation
* @param mips MIPS
* @param ram RAM
* @param upBw uplink bandwidth
* @param downBw downlink bandwidth
* @param level hierarchy level of the device
* @param ratePerMips cost rate per MIPS used
* @param busyPower
* @param idlePower
* @return
*/
private static FogDevice createFogDevice(String nodeName, long mips,
int ram, long upBw, long downBw, int level, double ratePerMips,
double busyPower, double idlePower) {
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 FogLinearPowerModel(busyPower, idlePower)
);
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;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:65,代码来源:templateAppLinealOperators.java
示例19: createDatacenter
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
/**
* Creates a datacenter
*
* @param name
* the datacenter name
* @return the datacenter
*/
public static Datacenter createDatacenter(String name) {
// Here are the steps needed to create a Datacenter:
// We need to create a list to store our machine
List<Host> hostList = createHostList(SimulationConstants.NUM_HOST);
// Create a DatacenterCharacteristics object that stores the
// properties of a data center: architecture, OS, list of
// Machines, allocation policy: time- or space-shared, time zone
// and its price (G$/Pe time unit).
String arch = "x86"; // system architecture
String os = "Linux"; // operating system
String vmm = "Xen";
double time_zone = 10.0; // time zone this resource located
// the cost of using processing in this resource
double cost = SimulationConstants.BROKER_VM_COST_PER_PROCESSING;
// the cost of using memory in this resource
double costPerMem = SimulationConstants.BROKER_VM_COST_PER_MEMORY;
// the cost of using storage in this resource
double costPerStorage = SimulationConstants.BROKER_VM_COST_PER_STORAGE;
// the cost of using bw in this resource
double costPerBw = 0.0;
// we are not adding SAN devices by now
LinkedList<Storage> storageList = new LinkedList<Storage>();
DatacenterCharacteristics characteristics = new DatacenterCharacteristics(arch, os, vmm, hostList, time_zone,
cost, costPerMem, costPerStorage, costPerBw);
// We need to create a Datacenter object.
Datacenter datacenter = null;
try {
datacenter = new PSDatacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);
} catch (Exception e) {
e.printStackTrace();
}
return datacenter;
}
开发者ID:raphaeldeaquino,项目名称:mcloudsim,代码行数:50,代码来源:Helper.java
示例20: PSDatacenter
import org.cloudbus.cloudsim.Storage; //导入依赖的package包/类
public PSDatacenter(String name, DatacenterCharacteristics characteristics, VmAllocationPolicy vmAllocationPolicy,
List<Storage> storageList, double schedulingInterval) throws Exception {
super(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval);
}
开发者ID:raphaeldeaquino,项目名称:mcloudsim,代码行数:5,代码来源:PSDatacenter.java
注:本文中的org.cloudbus.cloudsim.Storage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论