当前位置: 首页>>代码示例>>Java>>正文


Java DatacenterCharacteristics类代码示例

本文整理汇总了Java中org.cloudbus.cloudsim.DatacenterCharacteristics的典型用法代码示例。如果您正苦于以下问题:Java DatacenterCharacteristics类的具体用法?Java DatacenterCharacteristics怎么用?Java DatacenterCharacteristics使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DatacenterCharacteristics类属于org.cloudbus.cloudsim包,在下文中一共展示了DatacenterCharacteristics类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: NetDatacenterBroker

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的package包/类
/**
 * Created a new DatacenterBroker object.
 * 
 * @param name name to be associated with this entity (as required by Sim_entity class from
 *        simjava package)
 * 
 * @throws Exception the exception
 * 
 * @pre name != null
 * @post $none
 */
public NetDatacenterBroker(String name) throws Exception {
	super(name);

	setVmList(new ArrayList<NetworkVm>());
	setVmsCreatedList(new ArrayList<NetworkVm>());
	setCloudletList(new ArrayList<NetworkCloudlet>());
	setAppCloudletList(new ArrayList<AppCloudlet>());
	setCloudletSubmittedList(new ArrayList<Cloudlet>());
	setCloudletReceivedList(new ArrayList<Cloudlet>());
	appCloudletRecieved = new HashMap<Integer, Integer>();

	cloudletsSubmitted = 0;
	setVmsRequested(0);
	setVmsAcks(0);
	setVmsDestroyed(0);

	setDatacenterIdsList(new LinkedList<Integer>());
	setDatacenterRequestedIdsList(new ArrayList<Integer>());
	setVmsToDatacentersMap(new HashMap<Integer, Integer>());
	setDatacenterCharacteristicsList(new HashMap<Integer, DatacenterCharacteristics>());

}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:34,代码来源:NetDatacenterBroker.java

示例2: SoheilSimBroker

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的package包/类
/**
 * Created a new DatacenterBroker object.
 * 
 * @param name name to be associated with this entity (as required by Sim_entity class from
 *            simjava package)
 * @throws Exception the exception
 * @pre name != null
 * @post $none
 */
public SoheilSimBroker(String name) throws Exception {
	super(name);

	setVmList(new ArrayList<SoheilSimVm>());
	setVmsCreatedList(new ArrayList<SoheilSimVm>());
	setCloudletList(new ArrayList<Cloudlet>());
	setCloudletSubmittedList(new ArrayList<Cloudlet>());
	setCloudletReceivedList(new ArrayList<Cloudlet>());

	cloudletsSubmitted = 0;
	setVmsRequested(0);
	setVmsAcks(0);
	setVmsDestroyed(0);

	setDatacenterIdsList(new LinkedList<Integer>());
	setDatacenterRequestedIdsList(new ArrayList<Integer>());
	setVmsToDatacentersMap(new HashMap<Integer, Integer>());
	setDatacenterCharacteristicsList(new HashMap<Integer, DatacenterCharacteristics>());
	
	
	BountVM_notAvailable=false;

}
 
开发者ID:tuwiendsg,项目名称:CAPT,代码行数:33,代码来源:SoheilSimBroker.java

示例3: processResourceCharacteristics

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的package包/类
/**
 * Process the return of a request for the characteristics of a PowerDatacenter.
 * 
 * @param ev a SimEvent object
 * 
 * @pre ev != $null
 * @post $none
 */
protected void processResourceCharacteristics(SimEvent ev) {
	DatacenterCharacteristics characteristics = (DatacenterCharacteristics) ev.getData();
	getDatacenterCharacteristicsList().put(characteristics.getId(), characteristics);

	if (getDatacenterCharacteristicsList().size() == getDatacenterIdsList().size()) {
		setDatacenterRequestedIdsList(new ArrayList<Integer>());
		createVmsInDatacenterBase(getDatacenterIdsList().get(0));
	}
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:18,代码来源:NetDatacenterBroker.java

示例4: processResourceCharacteristicsRequest

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的package包/类
/**
 * Process a request for the characteristics of a PowerDatacenter.
 * 
 * @param ev a SimEvent object
 * 
 * @pre ev != $null
 * @post $none
 */

protected void processResourceCharacteristicsRequest(SimEvent ev) {
	setDatacenterIdsList(CloudSim.getCloudResourceList());
	setDatacenterCharacteristicsList(new HashMap<Integer, DatacenterCharacteristics>());

	Log.printLine(CloudSim.clock() + ": " + getName() + ": Cloud Resource List received with "
			+ getDatacenterIdsList().size() + " resource(s)");

	for (Integer datacenterId : getDatacenterIdsList()) {
		sendNow(datacenterId, CloudSimTags.RESOURCE_CHARACTERISTICS, getId());
	}
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:21,代码来源:NetDatacenterBroker.java

示例5: PowerDatacenter

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的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

示例6: createSDNDatacenter

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的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

示例7: createSDNDatacenter

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的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

示例8: createDatacenterCharacteristics

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的package包/类
/**
 * Creates a power-aware Datacenter.
 */
public void createDatacenterCharacteristics() {
	datacenterCharacteristics = new DatacenterCharacteristics(MyConstants.DATACENTER_ARCHITECTURE,
			MyConstants.DATACENTER_OS, MyConstants.DATACENTER_VMM, hostList, MyConstants.DATACENTER_TIME_ZONE,
			MyConstants.DATACENTER_COST_PER_SEC, MyConstants.DATACENTER_COST_PER_MEM,
			MyConstants.DATACENTER_COST_PER_STORAGE, MyConstants.DATACENTER_COST_PER_BW);
}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:10,代码来源:Helper.java

示例9: SDNDatacenter

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的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

示例10: processResourceCharacteristics

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的package包/类
/**
 * Process the return of a request for the characteristics of a PowerDatacenter.
 * 
 * @param ev a SimEvent object
 * @pre ev != $null
 * @post $none
 */
protected void processResourceCharacteristics(SimEvent ev) {
	DatacenterCharacteristics characteristics = (DatacenterCharacteristics) ev.getData();
	getDatacenterCharacteristicsList().put(characteristics.getId(), characteristics);

	if (getDatacenterCharacteristicsList().size() == getDatacenterIdsList().size()) {
		setDatacenterRequestedIdsList(new ArrayList<Integer>());
		createVmsInDatacenter(getDatacenterIdsList().get(0));
	}
}
 
开发者ID:tuwiendsg,项目名称:CAPT,代码行数:17,代码来源:SoheilSimBroker.java

示例11: processResourceCharacteristicsRequest

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的package包/类
/**
 * Process a request for the characteristics of a PowerDatacenter.
 * 
 * @param ev a SimEvent object
 * @pre ev != $null
 * @post $none
 */
protected void processResourceCharacteristicsRequest(SimEvent ev) {
	setDatacenterIdsList(CloudSim.getCloudResourceList());
	setDatacenterCharacteristicsList(new HashMap<Integer, DatacenterCharacteristics>());

	Log.printLine(CloudSim.clock() + ": " + getName() + ": Cloud Resource List received with "
			+ getDatacenterIdsList().size() + " resource(s)");

	for (Integer datacenterId : getDatacenterIdsList()) {
		sendNow(datacenterId, CloudSimTags.RESOURCE_CHARACTERISTICS, getId());
	}
}
 
开发者ID:tuwiendsg,项目名称:CAPT,代码行数:19,代码来源:SoheilSimBroker.java

示例12: construct

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的package包/类
private void construct()
{
	datacenterIds = CloudSim.getCloudResourceList();
	datacenterCharacteristicsList = new HashMap<Integer, DatacenterCharacteristics>();
	receivedCloudlet = new ArrayList<Cloudlet>();
	vmToApp = new HashMap<Integer, Application>();
	idToVm = new HashMap<Integer, Vm>();
	appToAllocation = new HashMap<Application, Allocation>();
	datacenters = new ArrayList<FederationDatacenter>();
	vmToDatacenter = new HashMap<>();
}
 
开发者ID:ecarlini,项目名称:smartfed,代码行数:12,代码来源:Federation.java

示例13: processResourceCharacteristics

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的package包/类
protected void processResourceCharacteristics(SimEvent ev)
{
	DatacenterCharacteristics characteristics = (DatacenterCharacteristics) ev.getData();
	datacenterCharacteristicsList.put(characteristics.getId(), characteristics);
	
	FederationLog.timeLogDebug("Received monitoring response from datacenter #"+characteristics.getId());
	if (this.emptyQueue)
		mappingModule.getMonitoringHub().shutdownEntity();
		
}
 
开发者ID:ecarlini,项目名称:smartfed,代码行数:11,代码来源:Federation.java

示例14: processResourceCharacteristics

import org.cloudbus.cloudsim.DatacenterCharacteristics; //导入依赖的package包/类
@Override
protected void processResourceCharacteristics(SimEvent ev) 
{        
    DatacenterCharacteristics characteristics = (DatacenterCharacteristics) ev.getData();
    getDatacenterCharacteristicsList().put(characteristics.getId(), characteristics);

    if (getDatacenterCharacteristicsList().size() == getDatacenterIdsList().size()) 
    {
        distributeRequestsForNewVmsAcrossDatacentersUsingTheRoundRobinApproach();
    }
}
 
开发者ID:hewolf,项目名称:VirtualMachinePlacement,代码行数:12,代码来源:RoundRobinDatacenterBroker.java


注:本文中的org.cloudbus.cloudsim.DatacenterCharacteristics类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。