cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-testbeds/src/main/java/org/cloudsimplus/hostfaultinjection/HostFaultInjectionRunner.java
private void afterExperimentFinish(HostFaultInjectionExperiment exp) {
        final HostFaultInjection faultInjection = exp.getFaultInjection();
        final Map<DatacenterBroker, SlaContract> contract = exp.getContractsMap();

        availability.add(faultInjection.availability() * 100);
        ratioVmsPerHost.add(exp.getRatioVmsPerHost());
        percentageOfBrokersMeetingAvailability.add(exp.getPercentageOfAvailabilityMeetingSla() * 100);
       // percentageOfBrokersMeetingCost.add(exp.getPercentageOfBrokersMeetingCost());

         //The availability for each broker for a single experiment.
        final Map<DatacenterBroker, Double> brokersAvailabilities = exp.getBrokerList()
            .stream()
            .sorted()
            .collect(toMap(b -> b, faultInjection::availability));

        final Map<DatacenterBroker, Double> costBrokers = exp.getBrokerList()
            .stream()
            .sorted()
            .collect(toMap(b -> b, exp::getTotalCost));

        final Map<DatacenterBroker, Double> getCustomerActualPricePerHour = exp.getBrokerList()
            .stream()
            .sorted()
            .collect(toMap(b -> b, exp::getCustomerActualPricePerHour));

        /*
         * Gets the availability of each broker for the current experiment
         * and adds such a value to the List of availability of each broker
         * inside the map of all brokers
         */
        brokersAvailabilities.forEach(this::addExperimentAvailabilityToBroker);

        costBrokers.forEach(this::addExperimentCostToBroker);

        getCustomerActualPricePerHour.forEach(this::addExperimentPriceCustomerPerHour);
    }
/**
     * Method automatically called after every experiment finishes running. It
     * performs some post-processing such as collection of data for statistic
     * analysis.
     *
     * @param exp the finished experiment
     */
Method automatically called after every experiment finishes running. It
performs some post-processing such as collection of data for statistic
analysis.

@param exp the finished experiment
Method automatically called after every experiment finishes running . It performs some post - processing such as collection of data for statistic analysis . @param exp the finished experiment
private void afterExperimentFinish(HostFaultInjectionExperiment exp) {
        final HostFaultInjection faultInjection = exp.getFaultInjection();
        final Map<DatacenterBroker, SlaContract> contract = exp.getContractsMap();
        availability.add(faultInjection.availability() * 100);
        ratioVmsPerHost.add(exp.getRatioVmsPerHost());
        percentageOfBrokersMeetingAvailability.add(exp.getPercentageOfAvailabilityMeetingSla() * 100);
        final Map<DatacenterBroker, Double> brokersAvailabilities = exp.getBrokerList()
            .stream()
            .sorted()
            .collect(toMap(b -> b, faultInjection::availability));
        final Map<DatacenterBroker, Double> costBrokers = exp.getBrokerList()
            .stream()
            .sorted()
            .collect(toMap(b -> b, exp::getTotalCost));
        final Map<DatacenterBroker, Double> getCustomerActualPricePerHour = exp.getBrokerList()
            .stream()
            .sorted()
            .collect(toMap(b -> b, exp::getCustomerActualPricePerHour));
        /*
         * Gets the availability of each broker for the current experiment
         * and adds such a value to the List of availability of each broker
         * inside the map of all brokers
         */
        brokersAvailabilities.forEach(this::addExperimentAvailabilityToBroker);
        costBrokers.forEach(this::addExperimentCostToBroker);
        getCustomerActualPricePerHour.forEach(this::addExperimentPriceCustomerPerHour);
    }
private void afterExperimentFinish ( HostFaultInjectionExperiment exp ) { final HostFaultInjection faultInjection = exp . getFaultInjection ( ) ; final Map < DatacenterBroker , SlaContract > contract = exp . getContractsMap ( ) ; availability . add ( faultInjection . availability ( ) * 100 ) ; ratioVmsPerHost . add ( exp . getRatioVmsPerHost ( ) ) ; percentageOfBrokersMeetingAvailability . add ( exp . getPercentageOfAvailabilityMeetingSla ( ) * 100 ) ; final Map < DatacenterBroker , Double > brokersAvailabilities = exp . getBrokerList ( ) . stream ( ) . sorted ( ) . collect ( toMap ( b -> b , faultInjection :: availability ) ) ; final Map < DatacenterBroker , Double > costBrokers = exp . getBrokerList ( ) . stream ( ) . sorted ( ) . collect ( toMap ( b -> b , exp :: getTotalCost ) ) ; final Map < DatacenterBroker , Double > getCustomerActualPricePerHour = exp . getBrokerList ( ) . stream ( ) . sorted ( ) . collect ( toMap ( b -> b , exp :: getCustomerActualPricePerHour ) ) ; /*
         * Gets the availability of each broker for the current experiment
         * and adds such a value to the List of availability of each broker
         * inside the map of all brokers
         */ brokersAvailabilities . forEach ( this :: addExperimentAvailabilityToBroker ) ; costBrokers . forEach ( this :: addExperimentCostToBroker ) ; getCustomerActualPricePerHour . forEach ( this :: addExperimentPriceCustomerPerHour ) ; }
Method automatically called after every experiment finishes running.
Method automatically called after every experiment finishes running .
// percentageOfBrokersMeetingCost.add(exp.getPercentageOfBrokersMeetingCost()); //The availability for each broker for a single experiment.