cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/datacenters/power/PowerDatacenter.java
private void startVmMigration(Entry<Vm, Host> entry) {
        final double currentTime = getSimulation().clock();
        final Host sourceHost = entry.getKey().getHost();
        final Host targetHost = entry.getValue();

        final double delay = timeToMigrateVm(entry.getKey(), targetHost);
        if (sourceHost == Host.NULL) {
            Log.printFormattedLine(
                    "%.2f: Migration of %s to %s is started.",
                    currentTime, entry.getKey(), targetHost);
        } else {
            Log.printFormattedLine(
                    "%.2f: Migration of %s from %s to %s is started.",
                    currentTime, entry.getKey(), sourceHost, targetHost);
        }
        Log.printFormattedLine(
            "\tIt's expected to finish in %.2f seconds, considering the %.0f%% of bandwidth allowed for migration and the VM RAM size.",
            delay, getBandwidthForMigrationPercent()*100);


        sourceHost.addVmMigratingOut(entry.getKey());
        targetHost.addMigratingInVm(entry.getKey());
        incrementMigrationCount();

        send(getId(), delay, CloudSimTags.VM_MIGRATE, entry);
    }
/**
     * Actually fires the event that starts the VM migration
     * @param entry a Map Entry that indicate to which Host a VM must be migrated
     */
Actually fires the event that starts the VM migration
@param entry a Map Entry that indicate to which Host a VM must be migrated
Actually fires the event that starts the VM migration @param entry a Map Entry that indicate to which Host a VM must be migrated
private void startVmMigration(Entry<Vm, Host> entry) {
        final double currentTime = getSimulation().clock();
        final Host sourceHost = entry.getKey().getHost();
        final Host targetHost = entry.getValue();
        final double delay = timeToMigrateVm(entry.getKey(), targetHost);
        if (sourceHost == Host.NULL) {
            Log.printFormattedLine(
                    "%.2f: Migration of %s to %s is started.",
                    currentTime, entry.getKey(), targetHost);
        } else {
            Log.printFormattedLine(
                    "%.2f: Migration of %s from %s to %s is started.",
                    currentTime, entry.getKey(), sourceHost, targetHost);
        }
        Log.printFormattedLine(
            "\tIt's expected to finish in %.2f seconds, considering the %.0f%% of bandwidth allowed for migration and the VM RAM size.",
            delay, getBandwidthForMigrationPercent()*100);
        sourceHost.addVmMigratingOut(entry.getKey());
        targetHost.addMigratingInVm(entry.getKey());
        incrementMigrationCount();
        send(getId(), delay, CloudSimTags.VM_MIGRATE, entry);
    }
private void startVmMigration ( Entry < Vm , Host > entry ) { final double currentTime = getSimulation ( ) . clock ( ) ; final Host sourceHost = entry . getKey ( ) . getHost ( ) ; final Host targetHost = entry . getValue ( ) ; final double delay = timeToMigrateVm ( entry . getKey ( ) , targetHost ) ; if ( sourceHost == Host . NULL ) { Log . printFormattedLine ( "%.2f: Migration of %s to %s is started." , currentTime , entry . getKey ( ) , targetHost ) ; } else { Log . printFormattedLine ( "%.2f: Migration of %s from %s to %s is started." , currentTime , entry . getKey ( ) , sourceHost , targetHost ) ; } Log . printFormattedLine ( "\tIt's expected to finish in %.2f seconds, considering the %.0f%% of bandwidth allowed for migration and the VM RAM size." , delay , getBandwidthForMigrationPercent ( ) * 100 ) ; sourceHost . addVmMigratingOut ( entry . getKey ( ) ) ; targetHost . addMigratingInVm ( entry . getKey ( ) ) ; incrementMigrationCount ( ) ; send ( getId ( ) , delay , CloudSimTags . VM_MIGRATE , entry ) ; }
Actually fires the event that starts the VM migration
 @param entry a Map Entry that indicate to which Host a VM must be migrated
Actually fires the event that starts the VM migration @param entry a Map Entry that indicate to which Host a VM must be migrated