For the implementation of resource allocation in cloudsim using ACO algorithm, I need to make changes in which class of cloudsim in order to add ACO code
There are multiple approaches to achieve this, one possible solution could be as follows:
1) Create a new VM allocation policy class that implements your ACO proposal. This class should extend the PowerVmAllocationPolicyMigrationAbstract class. As an example, you can call that new class as PowerVmAllocationPolicyMigrationAco which overrides the optimizeAllocation() method as follows:
public class PowerVmAllocationPolicyMigrationAco extends PowerVmAllocationPolicyMigrationAbstract {
// Details of ACO for mapping VMs to hosts
}
2) Update the RunnerAbstract.java class to consider you ACO-based allocation policy by adding a new else if statement as follows:
else if (vmAllocationPolicyName.equals("aco")) {
vmAllocationPolicy = new PowerVmAllocationPolicyMigrationAco(parameters)
}
3) Under the workload (either PlanetLab, random or anything else), you can call the workload runner to run your newly created VM allocation policy so that the value of the variable vmAllocationPolicy = "aco";
Please note that this is only one of the possible design approaches; however, there are other several ways to achieve this using different design.
You may want to check the repository at https://github.com/shivanshs9/acs-vm-migration. It implements an ACS for VM migration in CloudSim Plus.
CloudSim Plus is an up-to-date, full-featured, highly extensible and accurate cloud simulation framework. Check it out at http://cloudsimplus.org and please don't forget to give the project a star at GitHub.