本文整理汇总了Java中org.cloudbus.cloudsim.Log.print方法的典型用法代码示例。如果您正苦于以下问题:Java Log.print方法的具体用法?Java Log.print怎么用?Java Log.print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cloudbus.cloudsim.Log
的用法示例。
在下文中一共展示了Log.print方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printCloudletList
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
public static void printCloudletList(List<Cloudlet> list) {
int size = list.size();
Cloudlet cloudlet;
Log.printLine();
Log.printLine("========== OUTPUT ==========");
Log.print(String.format(fString, "Cloudlet_ID"));
Log.print(String.format(fString, "STATUS" ));
Log.print(String.format(fString, "DataCenter_ID"));
Log.print(String.format(fString, "VM_ID"));
Log.print(String.format(fString, "Length"));
Log.print(String.format(fString, "Time"));
Log.print(String.format(fString, "Start Time"));
Log.print(String.format(fString, "Finish Time"));
Log.print("\n");
//DecimalFormat dft = new DecimalFormat("######.##");
for (int i = 0; i < size; i++) {
cloudlet = list.get(i);
printCloudlet(cloudlet);
}
}
示例2: printCloudlet
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
private static void printCloudlet(Cloudlet cloudlet) {
Log.print(String.format(fInt, cloudlet.getCloudletId()));
if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS) {
Log.print(String.format(fString, "SUCCESS"));
Log.print(String.format(fInt, cloudlet.getResourceId()));
Log.print(String.format(fInt, cloudlet.getVmId()));
Log.print(String.format(fInt, cloudlet.getCloudletLength()));
Log.print(String.format(fFloat, cloudlet.getActualCPUTime()));
Log.print(String.format(fFloat, cloudlet.getExecStartTime()));
Log.print(String.format(fFloat, cloudlet.getFinishTime()));
Log.print("\n");
}
else {
Log.printLine("FAILED");
}
}
示例3: printCloudletList
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
/**
* Prints the Cloudlet objects
* @param list list of Cloudlets
*/
private static void printCloudletList(List<Cloudlet> list) {
int size = list.size();
Cloudlet cloudlet;
String indent = " ";
Log.printLine();
Log.printLine("========== OUTPUT ==========");
Log.printLine("Cloudlet ID" + indent + "STATUS" + indent +
"Data center ID" + indent + "VM ID" + indent + "Time" + indent + "Start Time" + indent + "Finish Time");
for (int i = 0; i < size; i++) {
cloudlet = list.get(i);
Log.print(indent + cloudlet.getCloudletId() + indent + indent);
if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS){
Log.print("SUCCESS");
DecimalFormat dft = new DecimalFormat("###.##");
Log.printLine( indent + indent + cloudlet.getResourceId() + indent + indent + indent + cloudlet.getVmId() +
indent + indent + dft.format(cloudlet.getActualCPUTime()) + indent + indent + dft.format(cloudlet.getExecStartTime())+
indent + indent + dft.format(cloudlet.getFinishTime()));
}
}
}
示例4: printCloudletList
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
/**
* Prints the Cloudlet objects
* @param list list of Cloudlets
*/
private static void printCloudletList(List<Cloudlet> list) {
int size = list.size();
Cloudlet cloudlet;
String indent = " ";
Log.printLine();
Log.printLine("========== OUTPUT ==========");
Log.printLine("Cloudlet ID" + indent + "STATUS" + indent +
"Data center ID" + indent + "VM ID" + indent + indent + "Time" + indent + "Start Time" + indent + "Finish Time");
DecimalFormat dft = new DecimalFormat("###.##");
for (int i = 0; i < size; i++) {
cloudlet = list.get(i);
Log.print(indent + cloudlet.getCloudletId() + indent + indent);
if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS){
Log.print("SUCCESS");
Log.printLine( indent + indent + cloudlet.getResourceId() + indent + indent + indent + cloudlet.getVmId() +
indent + indent + indent + dft.format(cloudlet.getActualCPUTime()) +
indent + indent + dft.format(cloudlet.getExecStartTime())+ indent + indent + indent + dft.format(cloudlet.getFinishTime()));
}
}
}
示例5: printCloudletList
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
/**
* Prints the Cloudlet objects
* @param list list of Cloudlets
*/
private static void printCloudletList(List<Cloudlet> list) {
int size = list.size();
Cloudlet cloudlet;
String indent = " ";
Log.printLine();
Log.printLine("========== OUTPUT ==========");
Log.printLine("Cloudlet ID" + indent + "STATUS" + indent +
"Data center ID" + indent + "VM ID" + indent + "Time" + indent + "Start Time" + indent + "Finish Time");
DecimalFormat dft = new DecimalFormat("###.##");
for (int i = 0; i < size; i++) {
cloudlet = list.get(i);
Log.print(indent + cloudlet.getCloudletId() + indent + indent);
if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS){
Log.print("SUCCESS");
Log.printLine( indent + indent + cloudlet.getResourceId() + indent + indent + indent + cloudlet.getVmId() +
indent + indent + dft.format(cloudlet.getActualCPUTime()) + indent + indent + dft.format(cloudlet.getExecStartTime())+
indent + indent + dft.format(cloudlet.getFinishTime()));
}
}
}
示例6: printCloudletList
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
public static void printCloudletList(List<Cloudlet> list) {
int size = list.size();
Cloudlet cloudlet;
Log.printLine();
Log.printLine("========== OUTPUT ==========");
Log.print(String.format(LogPrinter.fString, "Cloudlet_ID"));
Log.print(String.format(LogPrinter.fString, "STATUS" ));
Log.print(String.format(LogPrinter.fString, "DataCenter_ID"));
Log.print(String.format(LogPrinter.fString, "VM_ID"));
Log.print(String.format(LogPrinter.fString, "Length"));
Log.print(String.format(LogPrinter.fString, "Time"));
Log.print(String.format(LogPrinter.fString, "Start Time"));
Log.print(String.format(LogPrinter.fString, "Finish Time"));
Log.print("\n");
//DecimalFormat dft = new DecimalFormat("######.##");
for (int i = 0; i < size; i++) {
cloudlet = list.get(i);
printCloudlet(cloudlet);
}
}
示例7: printRequestTitle
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
private static void printRequestTitle(Request req) {
//Log.print(String.format(fString, "Req_ID"));
//Log.print(String.format(fFloat, req.getStartTime()));
//Log.print(String.format(fFloat, req.getFinishTime()));
List<Activity> acts = req.getRemovedActivities();
for(Activity act:acts) {
if(act instanceof Transmission) {
Transmission tr=(Transmission)act;
Log.print(String.format(fString, "Tr:Size"));
Log.print(String.format(fString, "Tr:Channel"));
Log.print(String.format(fString, "Tr:time"));
Log.print(String.format(fString, "Tr:Start"));
Log.print(String.format(fString, "Tr:End"));
printRequestTitle(tr.getPackage().getPayload());
}
else {
Log.print(String.format(fString, "Pr:Size"));
Log.print(String.format(fString, "Pr:time"));
Log.print(String.format(fString, "Pr:Start"));
Log.print(String.format(fString, "Pr:End"));
}
}
}
示例8: printRequest
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
private static void printRequest(Request req) {
//Log.print(String.format(fInt, req.getRequestId()));
//Log.print(String.format(fFloat, req.getStartTime()));
//Log.print(String.format(fFloat, req.getFinishTime()));
List<Activity> acts = req.getRemovedActivities();
for(Activity act:acts) {
if(act instanceof Transmission) {
Transmission tr=(Transmission)act;
Log.print(String.format(fInt, tr.getPackage().getSize()));
Log.print(String.format(fInt, tr.getPackage().getFlowId()));
Log.print(String.format(fFloat, tr.getPackage().getFinishTime() - tr.getPackage().getStartTime()));
Log.print(String.format(fFloat, tr.getPackage().getStartTime()));
Log.print(String.format(fFloat, tr.getPackage().getFinishTime()));
printRequest(tr.getPackage().getPayload());
}
else {
Processing pr=(Processing)act;
Log.print(String.format(fInt, pr.getCloudlet().getCloudletLength()));
Log.print(String.format(fFloat, pr.getCloudlet().getActualCPUTime()));
Log.print(String.format(fFloat, pr.getCloudlet().getExecStartTime()));
Log.print(String.format(fFloat, pr.getCloudlet().getFinishTime()));
if(startTime == -1) startTime = pr.getCloudlet().getExecStartTime();
finishTime=pr.getCloudlet().getFinishTime();
}
}
}
示例9: printCloudletList
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
/**
* Prints the Cloudlet objects
*
* @param list
* list of Cloudlets
*/
private static void printCloudletList(List<Cloudlet> list) {
int size = list.size();
Cloudlet cloudlet;
String indent = " ";
Log.printLine();
Log.printLine("========== OUTPUT ==========");
Log.printLine("Cloudlet ID" + indent + "STATUS" + indent + "Data center ID" + indent + "VM ID"
+ indent + indent + "Time" + indent + "Start Time" + indent + "Finish Time");
DecimalFormat dft = new DecimalFormat("###.##");
for (int i = 0; i < size; i++) {
cloudlet = list.get(i);
Log.print(indent + cloudlet.getCloudletId() + indent + indent);
if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS) {
Log.print("SUCCESS");
Log.printLine(indent + indent + cloudlet.getResourceId() + indent + indent + indent
+ cloudlet.getVmId() + indent + indent + indent
+ dft.format(cloudlet.getActualCPUTime()) + indent + indent
+ dft.format(cloudlet.getExecStartTime()) + indent + indent + indent
+ dft.format(cloudlet.getFinishTime()));
}
}
}
示例10: printCloudletList
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
/**
* Prints the Cloudlet objects.
*
* @param list list of Cloudlets
*/
private static void printCloudletList(List<Cloudlet> list) {
int size = list.size();
Cloudlet cloudlet;
String indent = " ";
Log.printLine();
Log.printLine("========== OUTPUT ==========");
Log.printLine("Cloudlet ID" + indent + "STATUS" + indent
+ "Data center ID" + indent + "VM ID" + indent + "Time" + indent
+ "Start Time" + indent + "Finish Time");
DecimalFormat dft = new DecimalFormat("###.##");
for (int i = 0; i < size; i++) {
cloudlet = list.get(i);
Log.print(indent + cloudlet.getCloudletId() + indent + indent);
if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS) {
Log.print("SUCCESS");
Log.printLine(indent + indent + cloudlet.getResourceId()
+ indent + indent + indent + cloudlet.getVmId()
+ indent + indent
+ dft.format(cloudlet.getActualCPUTime()) + indent
+ indent + dft.format(cloudlet.getExecStartTime())
+ indent + indent
+ dft.format(cloudlet.getFinishTime()));
}
}
}
示例11: getMigrationMapFromUnderUtilizedHosts
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
/**
* Gets the migration map from under utilized hosts.
*
* @param overUtilizedHosts the over utilized hosts
* @return the migration map from under utilized hosts
*/
protected List<Map<String, Object>> getMigrationMapFromUnderUtilizedHosts(
List<PowerHostUtilizationHistory> overUtilizedHosts) {
List<Map<String, Object>> migrationMap = new LinkedList<Map<String, Object>>();
List<PowerHost> switchedOffHosts = getSwitchedOffHosts();
// over-utilized hosts + hosts that are selected to migrate VMs to from over-utilized hosts
Set<PowerHost> excludedHostsForFindingUnderUtilizedHost = new HashSet<PowerHost>();
excludedHostsForFindingUnderUtilizedHost.addAll(overUtilizedHosts);
excludedHostsForFindingUnderUtilizedHost.addAll(switchedOffHosts);
excludedHostsForFindingUnderUtilizedHost.addAll(extractHostListFromMigrationMap(migrationMap));
// over-utilized + under-utilized hosts
Set<PowerHost> excludedHostsForFindingNewVmPlacement = new HashSet<PowerHost>();
excludedHostsForFindingNewVmPlacement.addAll(overUtilizedHosts);
excludedHostsForFindingNewVmPlacement.addAll(switchedOffHosts);
int numberOfHosts = getHostList().size();
while (true) {
if (numberOfHosts == excludedHostsForFindingUnderUtilizedHost.size()) {
break;
}
PowerHost underUtilizedHost = getUnderUtilizedHost(excludedHostsForFindingUnderUtilizedHost);
if (underUtilizedHost == null) {
break;
}
Log.printLine("Under-utilized host: host #" + underUtilizedHost.getId() + "\n");
excludedHostsForFindingUnderUtilizedHost.add(underUtilizedHost);
excludedHostsForFindingNewVmPlacement.add(underUtilizedHost);
List<? extends Vm> vmsToMigrateFromUnderUtilizedHost = getVmsToMigrateFromUnderUtilizedHost(underUtilizedHost);
if (vmsToMigrateFromUnderUtilizedHost.isEmpty()) {
continue;
}
Log.print("Reallocation of VMs from the under-utilized host: ");
if (!Log.isDisabled()) {
for (Vm vm : vmsToMigrateFromUnderUtilizedHost) {
Log.print(vm.getId() + " ");
}
}
Log.printLine();
List<Map<String, Object>> newVmPlacement = getNewVmPlacementFromUnderUtilizedHost(
vmsToMigrateFromUnderUtilizedHost,
excludedHostsForFindingNewVmPlacement);
excludedHostsForFindingUnderUtilizedHost.addAll(extractHostListFromMigrationMap(newVmPlacement));
migrationMap.addAll(newVmPlacement);
Log.printLine();
}
return migrationMap;
}
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:65,代码来源:PowerVmAllocationPolicyMigrationAbstract.java
示例12: printWorkloadList
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
public static void printWorkloadList(List<Workload> wls) {
int[] appIdNum = new int[SDNBroker.appId];
double[] appIdTime = new double[SDNBroker.appId];
double[] appIdStartTime = new double[SDNBroker.appId];
double[] appIdFinishTime = new double[SDNBroker.appId];
double serveTime, totalTime = 0;
Log.printLine();
Log.printLine("========== DETAILED RESPONSE TIME OF WORKLOADS ===========");
if(wls.size() == 0) return;
Log.print(String.format(fString, "App_ID"));
printRequestTitle(wls.get(0).request);
Log.print(String.format(fString, "ResponseTime"));
Log.printLine();
for(Workload wl:wls) {
Log.print(String.format(fInt, wl.appId));
startTime = finishTime = -1;
printRequest(wl.request);
serveTime= (finishTime - startTime);
Log.print(String.format(fFloat, serveTime));
totalTime += serveTime;
appIdNum[wl.appId] ++; //How many workloads in this app.
appIdTime[wl.appId] += serveTime;
if(appIdStartTime[wl.appId] <=0) {
appIdStartTime[wl.appId] = wl.time;
}
appIdFinishTime[wl.appId] = wl.time;
Log.printLine();
}
Log.printLine("========== AVERAGE RESULT OF WORKLOADS ===========");
for(int i=0; i<SDNBroker.appId; i++) {
Log.printLine("App Id ("+i+"): "+appIdNum[i]+" requests, Start=" + appIdStartTime[i]+
", Finish="+appIdFinishTime[i]+", Rate="+(double)appIdNum[i]/(appIdFinishTime[i] - appIdStartTime[i])+
" req/sec, Response time=" + appIdTime[i]/appIdNum[i]);
}
//printGroupStatistics(WORKLOAD_GROUP_PRIORITY, appIdNum, appIdTime);
Log.printLine("Average Response Time:"+(totalTime / wls.size()));
}
示例13: getMigrationMapFromUnderUtilizedHosts
import org.cloudbus.cloudsim.Log; //导入方法依赖的package包/类
/**
*
* Gets the migration map from under utilized hosts.
*
* @param overUtilizedHosts the over utilized hosts
* @return the migration map from under utilized hosts
*/
protected List<Map<String, Object>> getMigrationMapFromUnderUtilizedHosts(
List<PowerHostUtilizationHistory> overUtilizedHosts) {
List<Map<String, Object>> migrationMap = new LinkedList<Map<String, Object>>();
List<PowerHost> switchedOffHosts = getSwitchedOffHosts();//关闭的Host
// over-utilized hosts + hosts that are selected to migrate VMs to from over-utilized hosts
// 排除在欠载列表之外的Host列表,显然上一步找到的过载Host肯定不在潜在列表中,还有关闭的Host也在排除列表之内
Set<PowerHost> excludedHostsForFindingUnderUtilizedHost = new HashSet<PowerHost>();
excludedHostsForFindingUnderUtilizedHost.addAll(overUtilizedHosts);
excludedHostsForFindingUnderUtilizedHost.addAll(switchedOffHosts);
excludedHostsForFindingUnderUtilizedHost.addAll(extractHostListFromMigrationMap(migrationMap));
// over-utilized + under-utilized hosts
// 排除在虚拟机迁移列表之外的Host,显然过载的Host肯定不在虚拟机可以迁移的Host之内,关闭的Host也在排除列表之内
Set<PowerHost> excludedHostsForFindingNewVmPlacement = new HashSet<PowerHost>();
excludedHostsForFindingNewVmPlacement.addAll(overUtilizedHosts);
excludedHostsForFindingNewVmPlacement.addAll(switchedOffHosts);
int numberOfHosts = getHostList().size();
while (true) {
// 如果Host都是在排除列表之外,那么退出循环
if (numberOfHosts == excludedHostsForFindingUnderUtilizedHost.size()) {
break;
}
PowerHost underUtilizedHost = getUnderUtilizedHost(excludedHostsForFindingUnderUtilizedHost);
if (underUtilizedHost == null) {
break;
}
Log.printLine("Under-utilized host: host #" + underUtilizedHost.getId() + "\n");
//把找到的欠载host加入到欠载排除列表和虚拟机放置排除列表中
excludedHostsForFindingUnderUtilizedHost.add(underUtilizedHost);
excludedHostsForFindingNewVmPlacement.add(underUtilizedHost);
//将欠载Host中的可以迁移的虚拟机列表返回
List<? extends Vm> vmsToMigrateFromUnderUtilizedHost = getVmsToMigrateFromUnderUtilizedHost(underUtilizedHost);
if (vmsToMigrateFromUnderUtilizedHost.isEmpty()) {
continue;
}
Log.print("Reallocation of VMs from the under-utilized host: ");
if (!Log.isDisabled()) {
for (Vm vm : vmsToMigrateFromUnderUtilizedHost) {
Log.print(vm.getId() + " ");
}
}
Log.printLine();
// 在欠载Host中,对可以迁移的虚拟机进行迁移
List<Map<String, Object>> newVmPlacement = getNewVmPlacementFromUnderUtilizedHost(
vmsToMigrateFromUnderUtilizedHost,
excludedHostsForFindingNewVmPlacement);
excludedHostsForFindingUnderUtilizedHost.addAll(extractHostListFromMigrationMap(newVmPlacement));
migrationMap.addAll(newVmPlacement);
Log.printLine();
}
//返回迁移的映射表
return migrationMap;
}
开发者ID:demiaowu,项目名称:annotation-of-cloudsim3.0.3,代码行数:70,代码来源:PowerVmAllocationPolicyMigrationAbstract.java