cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/datacenters/power/PowerDatacenterNonPowerAware.java
private void migrateVmsOutIfMigrationIsEnabled() {
        if (isMigrationsEnabled()) {
            final Map<Vm, Host> migrationMap
                    = getVmAllocationPolicy().optimizeAllocation(getVmList());

            for (final Entry<Vm, Host> entry : migrationMap.entrySet()) {
                final Host targetHost = entry.getValue();
                final Host oldHost = entry.getKey().getHost();

                if (oldHost.equals(Host.NULL)) {
                    Log.printFormattedLine(
                        "%.2f: Migration of VM #%d to Host #%d is started",
                        getSimulation().clock(),
                        entry.getKey().getId(),
                        targetHost.getId());
                } else {
                    Log.printFormattedLine(
                        "%.2f: Migration of VM #%d from Host #%d to Host #%d is started",
                        getSimulation().clock(),
                        entry.getKey().getId(),
                        oldHost.getId(),
                        targetHost.getId());
                }

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

                final double delay = timeToMigrateVm(entry.getKey(), targetHost);
                send(getId(), delay, CloudSimTags.VM_MIGRATE, entry);
            }
        }
    }
/**
     * Performs requested migration of VMs to another Hosts if migration from this Host is enabled.
     */
Performs requested migration of VMs to another Hosts if migration from this Host is enabled.
Performs requested migration of VMs to another Hosts if migration from this Host is enabled .
private void migrateVmsOutIfMigrationIsEnabled() {
        if (isMigrationsEnabled()) {
            final Map<Vm, Host> migrationMap
                    = getVmAllocationPolicy().optimizeAllocation(getVmList());
            for (final Entry<Vm, Host> entry : migrationMap.entrySet()) {
                final Host targetHost = entry.getValue();
                final Host oldHost = entry.getKey().getHost();
                if (oldHost.equals(Host.NULL)) {
                    Log.printFormattedLine(
                        "%.2f: Migration of VM #%d to Host #%d is started",
                        getSimulation().clock(),
                        entry.getKey().getId(),
                        targetHost.getId());
                } else {
                    Log.printFormattedLine(
                        "%.2f: Migration of VM #%d from Host #%d to Host #%d is started",
                        getSimulation().clock(),
                        entry.getKey().getId(),
                        oldHost.getId(),
                        targetHost.getId());
                }
                targetHost.addMigratingInVm(entry.getKey());
                incrementMigrationCount();
                final double delay = timeToMigrateVm(entry.getKey(), targetHost);
                send(getId(), delay, CloudSimTags.VM_MIGRATE, entry);
            }
        }
    }
private void migrateVmsOutIfMigrationIsEnabled ( ) { if ( isMigrationsEnabled ( ) ) { final Map < Vm , Host > migrationMap = getVmAllocationPolicy ( ) . optimizeAllocation ( getVmList ( ) ) ; for ( final Entry < Vm , Host > entry : migrationMap . entrySet ( ) ) { final Host targetHost = entry . getValue ( ) ; final Host oldHost = entry . getKey ( ) . getHost ( ) ; if ( oldHost . equals ( Host . NULL ) ) { Log . printFormattedLine ( "%.2f: Migration of VM #%d to Host #%d is started" , getSimulation ( ) . clock ( ) , entry . getKey ( ) . getId ( ) , targetHost . getId ( ) ) ; } else { Log . printFormattedLine ( "%.2f: Migration of VM #%d from Host #%d to Host #%d is started" , getSimulation ( ) . clock ( ) , entry . getKey ( ) . getId ( ) , oldHost . getId ( ) , targetHost . getId ( ) ) ; } targetHost . addMigratingInVm ( entry . getKey ( ) ) ; incrementMigrationCount ( ) ; final double delay = timeToMigrateVm ( entry . getKey ( ) , targetHost ) ; send ( getId ( ) , delay , CloudSimTags . VM_MIGRATE , entry ) ; } } }
Performs requested migration of VMs to another Hosts if migration from this Host is enabled.
Performs requested migration of VMs to another Hosts if migration from this Host is enabled .