hi I would compare three different algorithum of tasks schelduing in cloudsim how I can do this with same configuration of cloudsim ( same VM characteristic and tasks characteristic and datacentre characteristic) somone hae idee how i can do this look at my code below
please i need help
try {
int num_user = 1; // number of grid users
Calendar calendar = Calendar.getInstance();
boolean trace_flag = false; // mean trace events
// Initialize the CloudSim library
CloudSim.init(num_user, calendar, trace_flag);
// Second step: Create Datacenters
// Datacenters are the resource providers in CloudSim. We need at
// list one of them to run a CloudSim simulation
@SuppressWarnings("unused")
Datacenter datacenter0 = data.createDatacenter("Datacenter_0");
@SuppressWarnings("unused")
Datacenter datacenter1 = data.createDatacenter("Datacenter_1");
@SuppressWarnings("unused")
// Third step: Create Broker
org.cloudbus.cloudsim.DatacenterBroker broker = createBroker("broker1");
int brokerId = broker.getId();
vmlist = vmclass.createVM(brokerId,10); // creating 20 vms
cloudletList = cloudletclass.createCloudlet(brokerId,10);
// GlobalBroker globalBroker = new GlobalBroker("GlobalBroker");
TSgaParetoAgrégationSolution ts2 = new TSgaParetoAgrégationSolution();// algo numbre one
TSgaParetoRandomSolution ts3= new TSgaParetoRandomSolution(); // algo numbre two
TSgaAgrégationSolution ts1 = new TSgaAgrégationSolution();// algo numbre three
//ts1.main(args);
ArrayList<Gene> result = new ArrayList<Gene>();
result = ts2.GA(vmlist,cloudletList);
for(int i=0;i<result.size();i++){
Log.printLine(result.get(i).getCloudletFromGene().getCloudletId()+" "+result.get(i).getVmFromGene().getUid());
}
List<Cloudlet> finalcloudletList = new ArrayList<Cloudlet>();
List<Vm> finalvmlist = new ArrayList<Vm>();Log.printLine("resultat trouve");
for(int i=0;i<result.size();i++)
{
finalcloudletList.add(result.get(i).getCloudletFromGene());
finalvmlist.add(result.get(i).getVmFromGene());
}
broker.submitVmList(finalvmlist);
broker.submitCloudletList(finalcloudletList);
// Fifth step: Starts the simulation
CloudSim.startSimulation();
// Final step: Print results when simulation is over
List<Cloudlet> newList = broker.getCloudletReceivedList();
CloudSim.stopSimulation();
printCloudletList(newList);
result = ts2.GA(vmlist,cloudletList); // algo numbre 2
for(int i=0;i<result.size();i++){
Log.printLine(result.get(i).getCloudletFromGene().getCloudletId()+" "+result.get(i).getVmFromGene().getUid());
}
for(int i=0;i<result.size();i++)
{
finalcloudletList.add(result.get(i).getCloudletFromGene());
finalvmlist.add(result.get(i).getVmFromGene());
}
broker.submitVmList(finalvmlist);
broker.submitCloudletList(finalcloudletList);
// Fifth step: Starts the simulation
CloudSim.startSimulation();
// Final step: Print results when simulation is over
newList = broker.getCloudletReceivedList();
CloudSim.stopSimulation();
result = ts3.GA(vmlist,cloudletList); // algo numbre 3
for(int i=0;i<result.size();i++){
Log.printLine(result.get(i).getCloudletFromGene().getCloudletId()+" "+result.get(i).getVmFromGene().getUid());
}
for(int i=0;i<result.size();i++)
{
finalcloudletList.add(result.get(i).getCloudletFromGene());
finalvmlist.add(result.get(i).getVmFromGene());
}
broker.submitVmList(finalvmlist);
broker.submitCloudletList(finalcloudletList);
// Fifth step: Starts the simulation
CloudSim.startSimulation();
// Final step: Print results when simulation is over
newList = broker.getCloudletReceivedList();
CloudSim.stopSimulation();
} catch (Exception e) {
e.printStackTrace();