cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-examples/src/main/java/org/cloudbus/cloudsim/examples/power/util/Helper.java
public void printMetricHistory(
        List<? extends HostSimple> hosts,
        PowerVmAllocationPolicyMigrationAbstract vmAllocationPolicy) {
        for (int i = 0; i < 10; i++) {
            HostSimple host = hosts.get(i);

            Log.printLine("Host #" + host.getId());
            Log.printLine("Time:");
            if (!vmAllocationPolicy.getTimeHistory().containsKey(host)) {
                continue;
            }
            for (Double time : vmAllocationPolicy.getTimeHistory().get(host)) {
                Log.printFormatted("%.2f, ", time);
            }
            Log.printLine();

            for (Double utilization : vmAllocationPolicy.getUtilizationHistory().get(host)) {
                Log.printFormatted("%.2f, ", utilization);
            }
            Log.printLine();

            for (Double metric : vmAllocationPolicy.getMetricHistory().get(host)) {
                Log.printFormatted("%.2f, ", metric);
            }
            Log.printLine();
        }
    }
/**
     * Prints the metric history.
     *
     * @param hosts              the hosts
     * @param vmAllocationPolicy the vm allocation policy
     */
Prints the metric history.
@param hosts              the hosts
@param vmAllocationPolicy the vm allocation policy
Prints the metric history . @param hosts the hosts @param vmAllocationPolicy the vm allocation policy
public void printMetricHistory(
        List<? extends HostSimple> hosts,
        PowerVmAllocationPolicyMigrationAbstract vmAllocationPolicy) {
        for (int i = 0; i < 10; i++) {
            HostSimple host = hosts.get(i);
            Log.printLine("Host #" + host.getId());
            Log.printLine("Time:");
            if (!vmAllocationPolicy.getTimeHistory().containsKey(host)) {
                continue;
            }
            for (Double time : vmAllocationPolicy.getTimeHistory().get(host)) {
                Log.printFormatted("%.2f, ", time);
            }
            Log.printLine();
            for (Double utilization : vmAllocationPolicy.getUtilizationHistory().get(host)) {
                Log.printFormatted("%.2f, ", utilization);
            }
            Log.printLine();
            for (Double metric : vmAllocationPolicy.getMetricHistory().get(host)) {
                Log.printFormatted("%.2f, ", metric);
            }
            Log.printLine();
        }
    }
public void printMetricHistory ( List < ? extends HostSimple > hosts , PowerVmAllocationPolicyMigrationAbstract vmAllocationPolicy ) { for ( int i = 0 ; i < 10 ; i ++ ) { HostSimple host = hosts . get ( i ) ; Log . printLine ( "Host #" + host . getId ( ) ) ; Log . printLine ( "Time:" ) ; if ( ! vmAllocationPolicy . getTimeHistory ( ) . containsKey ( host ) ) { continue ; } for ( Double time : vmAllocationPolicy . getTimeHistory ( ) . get ( host ) ) { Log . printFormatted ( "%.2f, " , time ) ; } Log . printLine ( ) ; for ( Double utilization : vmAllocationPolicy . getUtilizationHistory ( ) . get ( host ) ) { Log . printFormatted ( "%.2f, " , utilization ) ; } Log . printLine ( ) ; for ( Double metric : vmAllocationPolicy . getMetricHistory ( ) . get ( host ) ) { Log . printFormatted ( "%.2f, " , metric ) ; } Log . printLine ( ) ; } }
Prints the metric history.
Prints the metric history .