Search code examples
javamigrationcloudvirtual-machinecloudsim

how to call optimizeAllocation to migrate vms in cloudsim


i m working on cloudsim to implement an genetic algorithm to find the optimal placement of vms in hosts. in the begening i need to put vms randomly ( i created a class that extends from VmAllocationPolicy ) then i need to optimize vm allocation by migrating them to other hosts : i rode that i have to implement optimizeAllocation method inside my policy , i did it but i don't know how to execute it (optimizeAllocation)


Solution

  • I found the solution . I called it from data center by :

    datacenter0.getallocationpolicy().optimizeallocation()