cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/migration/MigrationExample1.java
private Datacenter createDatacenter() {
        this.hostList = new ArrayList<>();
        for(int i = 0; i < HOSTS; i++){
            final int pes = HOST_INITIAL_PES + i;
            PowerHostUtilizationHistory host = createHost(pes, HOST_MIPS);
            hostList.add(host);
            Log.printFormattedLine("#Created host %d with %d MIPS x %2d PEs. Powered on: %s", i, HOST_MIPS, pes, host.isActive());
        }
        Log.printLine();

        DatacenterCharacteristics characteristics = new DatacenterCharacteristicsSimple(hostList);

        /**
         * Sets an upper utilization threshold higher than the
         * {@link #HOST_UTILIZATION_THRESHOLD_FOR_VM_MIGRATION}
         * to enable placing VMs which will use more CPU than
         * defined by the value in the mentioned constant.
         * After VMs are all submitted to Hosts, the threshold is changed
         * to the value of the constant.
         * This is used to  place VMs into a Host which will
         * become overloaded in order to trigger the migration.
         */
        this.allocationPolicy =
            new PowerVmAllocationPolicyMigrationBestFitStaticThreshold(
                new PowerVmSelectionPolicyMinimumUtilization(),
                HOST_UTILIZATION_THRESHOLD_FOR_VM_MIGRATION+0.2);

        PowerDatacenter dc = new PowerDatacenter(simulation, characteristics, allocationPolicy);
        dc.setMigrationsEnabled(true)
          .setSchedulingInterval(SCHEDULE_TIME_TO_PROCESS_DATACENTER_EVENTS)
          .setLog(true);
        return dc;
    }
/**
     * Creates a Datacenter with number of Hosts defined by {@link #HOSTS},
     * but only some of these Hosts will be active (powered on) initially.
     *
     * @return
     */
Creates a Datacenter with number of Hosts defined by  #HOSTS,
but only some of these Hosts will be active (powered on) initially.

@return
Creates a Datacenter with number of Hosts defined by #HOSTS but only some of these Hosts will be active ( powered on ) initially . @return
private Datacenter createDatacenter() {
        this.hostList = new ArrayList<>();
        for(int i = 0; i < HOSTS; i++){
            final int pes = HOST_INITIAL_PES + i;
            PowerHostUtilizationHistory host = createHost(pes, HOST_MIPS);
            hostList.add(host);
            Log.printFormattedLine("#Created host %d with %d MIPS x %2d PEs. Powered on: %s", i, HOST_MIPS, pes, host.isActive());
        }
        Log.printLine();
        DatacenterCharacteristics characteristics = new DatacenterCharacteristicsSimple(hostList);
        /**
         * Sets an upper utilization threshold higher than the
         * {@link #HOST_UTILIZATION_THRESHOLD_FOR_VM_MIGRATION}
         * to enable placing VMs which will use more CPU than
         * defined by the value in the mentioned constant.
         * After VMs are all submitted to Hosts, the threshold is changed
         * to the value of the constant.
         * This is used to  place VMs into a Host which will
         * become overloaded in order to trigger the migration.
         */
        this.allocationPolicy =
            new PowerVmAllocationPolicyMigrationBestFitStaticThreshold(
                new PowerVmSelectionPolicyMinimumUtilization(),
                HOST_UTILIZATION_THRESHOLD_FOR_VM_MIGRATION+0.2);
        PowerDatacenter dc = new PowerDatacenter(simulation, characteristics, allocationPolicy);
        dc.setMigrationsEnabled(true)
          .setSchedulingInterval(SCHEDULE_TIME_TO_PROCESS_DATACENTER_EVENTS)
          .setLog(true);
        return dc;
    }
private Datacenter createDatacenter ( ) { this . hostList = new ArrayList < > ( ) ; for ( int i = 0 ; i < HOSTS ; i ++ ) { final int pes = HOST_INITIAL_PES + i ; PowerHostUtilizationHistory host = createHost ( pes , HOST_MIPS ) ; hostList . add ( host ) ; Log . printFormattedLine ( "#Created host %d with %d MIPS x %2d PEs. Powered on: %s" , i , HOST_MIPS , pes , host . isActive ( ) ) ; } Log . printLine ( ) ; DatacenterCharacteristics characteristics = new DatacenterCharacteristicsSimple ( hostList ) ; /**
         * Sets an upper utilization threshold higher than the
         * {@link #HOST_UTILIZATION_THRESHOLD_FOR_VM_MIGRATION}
         * to enable placing VMs which will use more CPU than
         * defined by the value in the mentioned constant.
         * After VMs are all submitted to Hosts, the threshold is changed
         * to the value of the constant.
         * This is used to  place VMs into a Host which will
         * become overloaded in order to trigger the migration.
         */ this . allocationPolicy = new PowerVmAllocationPolicyMigrationBestFitStaticThreshold ( new PowerVmSelectionPolicyMinimumUtilization ( ) , HOST_UTILIZATION_THRESHOLD_FOR_VM_MIGRATION + 0.2 ) ; PowerDatacenter dc = new PowerDatacenter ( simulation , characteristics , allocationPolicy ) ; dc . setMigrationsEnabled ( true ) . setSchedulingInterval ( SCHEDULE_TIME_TO_PROCESS_DATACENTER_EVENTS ) . setLog ( true ) ; return dc ; }
Creates a Datacenter with number of Hosts defined by {@link #HOSTS},
 but only some of these Hosts will be active (powered on) initially.
Creates a Datacenter with number of Hosts defined by { @link #HOSTS } but only some of these Hosts will be active ( powered on ) initially .