cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-testbeds/src/main/java/org/cloudsimplus/hostfaultinjection/HostFaultInjectionExperiment.java
private void createFaultInjectionForHosts(Datacenter datacenter) {
        //System.out.printf("Experiment %d seed: %d\n", getIndex(), getSeed());
        PoissonDistr poisson = new PoissonDistr(MEAN_FAILURE_NUMBER_PER_HOUR, getSeed());
        //System.out.println("\n\t seed: " + getSeed());

        faultInjection = new HostFaultInjection(datacenter, poisson);
        getFaultInjection().setMaxTimeToGenerateFailureInHours(MAX_TIME_TO_GENERATE_FAILURE_IN_HOURS);

        for (DatacenterBroker broker : getBrokerList()) {
            Vm lastVmFromBroker = broker.getWaitingVm(broker.getVmWaitingList().size() - 1);
            getFaultInjection().addVmCloner (broker, new VmClonerSimple(this::cloneVm, this::cloneCloudlets));

        }

        Log.printFormattedLine(
            "\tFault Injection created for %s.\n\tMean Number of Failures per hour: %.6f (1 failure expected at each %.4f hours).",
            datacenter, MEAN_FAILURE_NUMBER_PER_HOUR, poisson.getInterarrivalMeanTime());
    }
/**
     * Creates the fault injection for host
     *
     * @param datacenter
     */
Creates the fault injection for host
@param datacenter
Creates the fault injection for host @param datacenter
private void createFaultInjectionForHosts(Datacenter datacenter) {
        PoissonDistr poisson = new PoissonDistr(MEAN_FAILURE_NUMBER_PER_HOUR, getSeed());
        faultInjection = new HostFaultInjection(datacenter, poisson);
        getFaultInjection().setMaxTimeToGenerateFailureInHours(MAX_TIME_TO_GENERATE_FAILURE_IN_HOURS);
        for (DatacenterBroker broker : getBrokerList()) {
            Vm lastVmFromBroker = broker.getWaitingVm(broker.getVmWaitingList().size() - 1);
            getFaultInjection().addVmCloner (broker, new VmClonerSimple(this::cloneVm, this::cloneCloudlets));
        }
        Log.printFormattedLine(
            "\tFault Injection created for %s.\n\tMean Number of Failures per hour: %.6f (1 failure expected at each %.4f hours).",
            datacenter, MEAN_FAILURE_NUMBER_PER_HOUR, poisson.getInterarrivalMeanTime());
    }
private void createFaultInjectionForHosts ( Datacenter datacenter ) { PoissonDistr poisson = new PoissonDistr ( MEAN_FAILURE_NUMBER_PER_HOUR , getSeed ( ) ) ; faultInjection = new HostFaultInjection ( datacenter , poisson ) ; getFaultInjection ( ) . setMaxTimeToGenerateFailureInHours ( MAX_TIME_TO_GENERATE_FAILURE_IN_HOURS ) ; for ( DatacenterBroker broker : getBrokerList ( ) ) { Vm lastVmFromBroker = broker . getWaitingVm ( broker . getVmWaitingList ( ) . size ( ) - 1 ) ; getFaultInjection ( ) . addVmCloner ( broker , new VmClonerSimple ( this :: cloneVm , this :: cloneCloudlets ) ) ; } Log . printFormattedLine ( "\tFault Injection created for %s.\n\tMean Number of Failures per hour: %.6f (1 failure expected at each %.4f hours)." , datacenter , MEAN_FAILURE_NUMBER_PER_HOUR , poisson . getInterarrivalMeanTime ( ) ) ; }
Creates the fault injection for host
 @param datacenter
Creates the fault injection for host @param datacenter
//System.out.printf("Experiment %d seed: %d\n", getIndex(), getSeed()); //System.out.println("\n\t seed: " + getSeed());