/** * Calculates the cost price of resources (processing, bw, memory, storage) * of each or all of the Datacenter VMs() * */ double getTotalCostPrice() { VmCost vmCost; double totalCost = 0.0; for (Vm vm : getVmList()) { if (vm.getCloudletScheduler().hasFinishedCloudlets()) { vmCost = new VmCost(vm); totalCost += vmCost.getTotalCost(); } else { System.out.printf( "\t%s didn't execute any Cloudlet.\n", vm); } } return totalCost; }