cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudsimplus/faultinjection/HostFaultInjection.java
public double availability(DatacenterBroker broker) {
        //no failures means 100% availability
        final double mtbf = meanTimeBetweenVmFaultsInMinutes(broker);
        if(mtbf == 0) {
            return 1;
        }

        final double mttr = meanTimeToRepairVmFaultsInMinutes(broker);
       // System.out.println(" Availability: broker " + broker + " value: " + mtbf / (mtbf + mttr));
        return mtbf / (mtbf + mttr);

    }
/**
     * Gets the availability for a given broker as a percentage value between 0 to 1,
     * based on VMs' downtime (the times VMs took to be repaired).
     *
     * @param broker the broker to get the availability of its VMs
     * @return
     */
Gets the availability for a given broker as a percentage value between 0 to 1,
based on VMs' downtime (the times VMs took to be repaired).

@param broker the broker to get the availability of its VMs
@return
Gets the availability for a given broker as a percentage value between 0 to 1 based on VMs ' downtime ( the times VMs took to be repaired ) . @param broker the broker to get the availability of its VMs @return
public double availability(DatacenterBroker broker) {
        final double mtbf = meanTimeBetweenVmFaultsInMinutes(broker);
        if(mtbf == 0) {
            return 1;
        }
        final double mttr = meanTimeToRepairVmFaultsInMinutes(broker);
        return mtbf / (mtbf + mttr);
    }
public double availability ( DatacenterBroker broker ) { final double mtbf = meanTimeBetweenVmFaultsInMinutes ( broker ) ; if ( mtbf == 0 ) { return 1 ; } final double mttr = meanTimeToRepairVmFaultsInMinutes ( broker ) ; return mtbf / ( mtbf + mttr ) ; }
Gets the availability for a given broker as a percentage value between 0 to 1,
 based on VMs' downtime (the times VMs took to be repaired).
Gets the availability for a given broker as a percentage value between 0 to 1 based on VMs ' downtime ( the times VMs took to be repaired ) .
//no failures means 100% availability // System.out.println(" Availability: broker " + broker + " value: " + mtbf / (mtbf + mttr));