cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/MultipleBrokers1.java
private void createVmsAndCloudlets() {
        int i = 0;
        for (DatacenterBroker broker : brokers) {
            /*
             * You can use one of these two instructions below
             * to set a specific delay or
             * none of them at all to accept the default behavior.
             */
            //broker.setVmDestructionDelayFunction(vm -> 0.0);
            broker.setVmDestructionDelayFunction(vm -> 2.0);

            vmList.addAll(createAndSubmitVms(broker));
            cloudletList.addAll(createAndSubmitCloudlets(broker, CLOUDLET_LENGTH*CLOUDLETS*i++));
        }
    }
/**
     * Creates VMs and Cloudlets for each DatacenterBroker.
     * It enables you to define when a broker should destroy
     * an idle VM, according to a given
     * {@link DatacenterBroker#setVmDestructionDelayFunction(Function) VM Destruction Delay Function}.
     *
     * <p>See <a href="https://github.com/manoelcampos/cloudsim-plus/issues/99">Issue #99</a> for more details.</p>
     *
     * @see DatacenterBroker#setVmDestructionDelayFunction(Function)
     */
Creates VMs and Cloudlets for each DatacenterBroker.
It enables you to define when a broker should destroy
an idle VM, according to a given
DatacenterBroker#setVmDestructionDelayFunction(Function) VM Destruction Delay Function.

See Issue #99 for more details.


Creates VMs and Cloudlets for each DatacenterBroker . It enables you to define when a broker should destroy an idle VM according to a given DatacenterBroker#setVmDestructionDelayFunction ( Function ) VM Destruction Delay Function . See Issue #99 for more details .
private void createVmsAndCloudlets() {
        int i = 0;
        for (DatacenterBroker broker : brokers) {
            /*
             * You can use one of these two instructions below
             * to set a specific delay or
             * none of them at all to accept the default behavior.
             */
            broker.setVmDestructionDelayFunction(vm -> 2.0);
            vmList.addAll(createAndSubmitVms(broker));
            cloudletList.addAll(createAndSubmitCloudlets(broker, CLOUDLET_LENGTH*CLOUDLETS*i++));
        }
    }
private void createVmsAndCloudlets ( ) { int i = 0 ; for ( DatacenterBroker broker : brokers ) { /*
             * You can use one of these two instructions below
             * to set a specific delay or
             * none of them at all to accept the default behavior.
             */ broker . setVmDestructionDelayFunction ( vm -> 2.0 ) ; vmList . addAll ( createAndSubmitVms ( broker ) ) ; cloudletList . addAll ( createAndSubmitCloudlets ( broker , CLOUDLET_LENGTH * CLOUDLETS * i ++ ) ) ; } }
Creates VMs and Cloudlets for each DatacenterBroker.
Creates VMs and Cloudlets for each DatacenterBroker .
//broker.setVmDestructionDelayFunction(vm -> 0.0);