本文整理汇总了Java中org.cloudbus.cloudsim.Storage类的典型用法代码示例。如果您正苦于以下问题:Java Storage类的具体用法?Java Storage怎么用?Java Storage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Storage类属于org.cloudbus.cloudsim包,在下文中一共展示了Storage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
示例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;
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}