org.cloudbus.cloudsim.examples.power.random里的例子IqrMc:
public class IqrMc {
/**
* The main method.
*
* @param args the arguments
* @throws IOException Signals that an I/O exception has occurred.
*/
public static void main(String[] args) throws IOException {
boolean enableOutput = true;
boolean outputToFile = true;
String inputFolder = "";
String outputFolder = "C:\\Users\\yangdi\\Desktop\\cloudsim_data";
String workload = "random"; // Random workload
String vmAllocationPolicy = "iqr"; // Inter Quartile Range (IQR) VM allocation policy
String vmSelectionPolicy = "mc"; // Maximum Correlation (MC) VM selection policy
String parameter = "1.5"; // the safety parameter of the IQR policy
new RandomRunner(
enableOutput,
outputToFile,
inputFolder,
outputFolder,
workload,
vmAllocationPolicy,
vmSelectionPolicy,
parameter);
}
}
运行类在类RandomRunner中,该类继承于RunnerAbstract类,并且直重写了一个方法:init():
protected void init(String inputFolder) {
try {
CloudSim.init(1, Calendar.getInstance(), false);
broker = Helper.createBroker();
int broker