cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-examples/src/main/java/org/cloudbus/cloudsim/examples/power/util/Helper.java
private void compute() {
            for (HostStateHistoryEntry entry : host.getStateHistory()) {
                if (previousTime != -1 && previousIsActive) {
                    final double timeDiff = entry.getTime() - previousTime;
                    totalActiveTime += timeDiff;
                    if (previousAllocatedMips < previousRequestedMips) {
                        totalSlaViolationTime += timeDiff;
                    }
                }

                previousRequestedMips = entry.getRequestedMips();
                previousAllocatedMips = entry.getAllocatedMips();
                previousTime = entry.getTime();
                previousIsActive = entry.isActive();
            }
        }
/**
         * Computes some SLA metrics for the Host, based on its MIPS history,
         * considering just the times when the Host was active.
         */
Computes some SLA metrics for the Host, based on its MIPS history,
considering just the times when the Host was active.
Computes some SLA metrics for the Host based on its MIPS history considering just the times when the Host was active .
private void compute() {
            for (HostStateHistoryEntry entry : host.getStateHistory()) {
                if (previousTime != -1 && previousIsActive) {
                    final double timeDiff = entry.getTime() - previousTime;
                    totalActiveTime += timeDiff;
                    if (previousAllocatedMips < previousRequestedMips) {
                        totalSlaViolationTime += timeDiff;
                    }
                }
                previousRequestedMips = entry.getRequestedMips();
                previousAllocatedMips = entry.getAllocatedMips();
                previousTime = entry.getTime();
                previousIsActive = entry.isActive();
            }
        }
private void compute ( ) { for ( HostStateHistoryEntry entry : host . getStateHistory ( ) ) { if ( previousTime != - 1 && previousIsActive ) { final double timeDiff = entry . getTime ( ) - previousTime ; totalActiveTime += timeDiff ; if ( previousAllocatedMips < previousRequestedMips ) { totalSlaViolationTime += timeDiff ; } } previousRequestedMips = entry . getRequestedMips ( ) ; previousAllocatedMips = entry . getAllocatedMips ( ) ; previousTime = entry . getTime ( ) ; previousIsActive = entry . isActive ( ) ; } }
Computes some SLA metrics for the Host, based on its MIPS history,
 considering just the times when the Host was active.
Computes some SLA metrics for the Host based on its MIPS history considering just the times when the Host was active .