CC Cloudsim
CC Cloudsim
CC Cloudsim
AIM:
To simulate cloud scenarios using cloudsim and run a scheduling algorithm that is not
present in cloudsim.
PROCEDURE:
1) This link would open a github account and then open the required version.
2) Download the zip file and extract it.
3) Open the netbeans create a new project
4) Choose java -> choose java application
5) Give name and then click finish
6) Click on libraries and add a library of cloudsim to the application.
7) Type the program you want to run.
8) Run the application and see the output in the output area.
PROGRAM:
package fc;
import org.cloudbus.cloudsim.*;
import java.text.DecimalFormat;
import java.util.Calendar;
import java.util.LinkedList;
return list;
}
return list;
}
try {
int num_user = 1;
Calendar calendar = Calendar.getInstance(); boolean trace_flag =
false;
CloudSim.init(num_user, calendar, trace_flag);
CloudSim.startSimulation();
CloudSim.stopSimulation();
printCloudletList(newList);
return makespan;
}
FCFSDatacenterBroker.java
package fc;
import org.cloudbus.cloudsim.Cloudlet;
import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.core.CloudSim; import
org.cloudbus.cloudsim.core.SimEvent;
import java.util.ArrayList;
setCloudletReceivedList(clist);
}
@Override
protected void processCloudletReturn(SimEvent ev) { Cloudlet cloudlet
= (Cloudlet) ev.getData(); getCloudletReceivedList().add(cloudlet);
Log.printLine(CloudSim.clock() + ": " + getName() + ": Cloudlet " + cloudlet.getCloudletId()
+ " received");
cloudletsSubmitted--;
}
OUTPUT:
RESULT:
Thus,simulated a cloud scenario using CloudSim and ran a scheduling algorithm that is not present in
CloudSim.