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


Java ParameterException类代码示例

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


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

示例1: createPersistentStorage

import org.cloudbus.cloudsim.ParameterException; //导入依赖的package包/类
/**
 * create a defined number of defined storage type to the persistent storage of a power-aware datacenter.
 * 
 * @param storageNumber
 * @throws ParameterException
 */
public void createPersistentStorage(int storageNumber, StorageModelHdd hddModel, PowerModelHdd hddPowerModel)
		throws ParameterException {
	for (int i = 1; i <= storageNumber; i++) {
		storageList.add(new MyPowerHarddriveStorage(i, "hdd" + i, hddModel, hddPowerModel));
	}
}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:13,代码来源:Helper.java

示例2: createDataFilesList

import org.cloudbus.cloudsim.ParameterException; //导入依赖的package包/类
/**
 * Create a list of data Files.
 * 
 * @param source
 *            name of the file in the default files folder.
 */
public void createDataFilesList(String source) {
	String path = "files/" + source;

	try {
		// instantiate a reader
		BufferedReader input = new BufferedReader(new FileReader(path));

		// read line by line
		String line;
		String[] lineSplited;
		String fileName;
		String fileSize;
		while ((line = input.readLine()) != null) {

			// retrieve fileName and fileSize
			lineSplited = line.split(",");
			fileName = lineSplited[0];
			fileSize = lineSplited[1];

			// add file to the List
			dataFiles.add(new File(fileName, Integer.parseInt(fileSize)));
		}

		// close the reader
		input.close();

	} catch (IOException | NumberFormatException | ParameterException e) {
		e.printStackTrace();
	}
}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:37,代码来源:Helper.java

示例3: createCloudletList

import org.cloudbus.cloudsim.ParameterException; //导入依赖的package包/类
/**
 * @param CloudlerNumber
 * @throws ParameterException
 */
public void createCloudletList(int CloudlerNumber) throws ParameterException {

	// local variable
	ArrayList<String> tempRequiredFilesList = null;
	ArrayList<File> tempDataFilesList = null;

	for (int i = 1; i <= CloudlerNumber; i++) {

		// handle dataFiles
		if (i <= dataFiles.size()) {
			tempDataFilesList = new ArrayList<File>(Arrays.asList(dataFiles.get(i - 1)));
		} else {
			tempDataFilesList = null;
		}

		// handle requiredFiles
		if (i <= requiredFiles.size()) {
			tempRequiredFilesList = new ArrayList<String>(Arrays.asList(requiredFiles.get(i - 1)));
		} else {
			tempRequiredFilesList = null;
		}

		// create cloudlet
		cloudletList.add(new MyCloudlet(i, MyConstants.CLOUDLET_LENGHT, MyConstants.CLOUDLET_PES_NUMBER,
				MyConstants.CLOUDLET_FILE_SIZE, MyConstants.CLOUDLET_OUTPUT_SIZE,
				MyConstants.CLOUDLET_UTILIZATION_MODEL_CPU, MyConstants.CLOUDLET_UTILIZATION_MODEL_RAM,
				MyConstants.CLOUDLET_UTILIZATION_MODEL_BW, tempRequiredFilesList, tempDataFilesList));
		cloudletList.get(i - 1).setUserId(broker.getId());
		cloudletList.get(i - 1).setVmId(vmlist.get(0).getId());
	}

	// submit the list to the broker
	broker.submitCloudletList(cloudletList);
}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:39,代码来源:Helper.java

示例4: addFiles

import org.cloudbus.cloudsim.ParameterException; //导入依赖的package包/类
/**
 * @param startingFilesList
 */
public void addFiles(String startingFilesList) {

	if (startingFilesList != "") {
		try {
			// instantiate a reader
			BufferedReader input = new BufferedReader(new FileReader("files/" + startingFilesList));

			// read line by line
			String line;
			String[] lineSplited;
			String fileName;
			String fileSize;
			while ((line = input.readLine()) != null) {

				// retrieve fileName and fileSize
				lineSplited = line.split("\\s+"); // regular expression
													// quantifiers for
													// whitespace
				fileName = lineSplited[0];
				fileSize = lineSplited[1];

				// add file to datacenter
				datacenter.addFile(new File(fileName, Integer.parseInt(fileSize)));
			}

			// close the reader
			input.close();

		} catch (IOException | NumberFormatException | ParameterException e) {
			e.printStackTrace();
		}
	}

}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:38,代码来源:Helper.java

示例5: MyHarddriveStorage

import org.cloudbus.cloudsim.ParameterException; //导入依赖的package包/类
/**
 * The constructor.
 * 
 * @param id
 *            unique id for this drive
 * @param name
 *            the name of the new Hard Drive storage
 * @param storageModelHdd
 *            the model of a specific hard drive
 * @throws ParameterException
 *             when the name and the capacity are not valid
 */
public MyHarddriveStorage(int id, String name, StorageModelHdd storageModelHdd) throws ParameterException {

	// store id & name
	this.Id = id;
	this.name = name;

	// initializes final variables
	this.storageModel = storageModelHdd;
	this.capacity = storageModelHdd.getCapacity();
	this.reference = storageModelHdd.getModelNumber();
	this.maxInternalDataTransferRate = storageModelHdd.getMaxInternalDataTransferRate();
	this.avgRotLatency = storageModelHdd.getAvgRotationLatency();
	this.avgSeekTime = storageModelHdd.getAvgSeekTime();

	// initializes global variables
	this.activeEndAt = 0.0;
	this.fileList = new ArrayList<File>();
	this.nameList = new ArrayList<String>();
	this.genSeekTime = null;
	this.usedSpace = 0;
	setMode(0);
	setQueueLength(0);

	// randomize seekTime & rotation latency
	setSeekTime(storageModelHdd.getAvgSeekTime());
	setRotLatency(storageModelHdd.getAvgRotationLatency());
}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:40,代码来源:MyHarddriveStorage.java

示例6: MyPowerHarddriveStorage

import org.cloudbus.cloudsim.ParameterException; //导入依赖的package包/类
/**
 * Creates a new Hard Drive storage base on a specific HDD Model.
 * 
 * @param id
 *            unique id of the HDD CloudSim component
 * @param name
 *            the name
 * @param storageModelHdd
 *            the specific model
 * @param powerModel
 *            the power model
 * @throws ParameterException
 *             when the name and the capacity are not valid
 */
public MyPowerHarddriveStorage(int id, String name, StorageModelHdd storageModelHdd, PowerModelHdd powerModel)
		throws ParameterException {
	super(id, name, storageModelHdd);

	// set HDD characteristics
	setPowerModelHdd(powerModel);

	// set initial parameters
	setInActiveDuration(0.0);
	setLastIdleStartTime(0.0);
}
 
开发者ID:Udacity2048,项目名称:CloudSimDisk,代码行数:26,代码来源:MyPowerHarddriveStorage.java

示例7: ClusterStorage

import org.cloudbus.cloudsim.ParameterException; //导入依赖的package包/类
/**
 * Initialize a ClusterStorage
 *
 * @param name, name of this storage
 * @param capacity, capacity
 * @throws ParameterException
 */
public ClusterStorage(String name, double capacity) throws ParameterException {
    super(name, capacity);
}
 
开发者ID:WorkflowSim,项目名称:WorkflowSim-1.0,代码行数:11,代码来源:ClusterStorage.java


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