package org.cloudbus.cloudsim.examples.power.planetlab;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

/**
 * ClassName NlrMsf
 * Description
 * Create by HW
 * Date 2021/4/24 11:02
 */
public class NlrMsf {
    public static void main(String[] args) throws IOException {
        boolean enableOutput = true;
        boolean outputToFile = false;
        //String inputFolder = IqrMmt.class.getClassLoader().getResource("workload/planetlab").getPath();
        String inputFolder = NlrMsf.class.getResource("/workload/planetlab").getPath();
        try {
            inputFolder = URLDecoder.decode(inputFolder, "UTF-8");
            System.out.println(inputFolder);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        String outputFolder = "output";
        String workload = "20110412"; // PlanetLab workload
        String vmAllocationPolicy = "nlr"; // 新的线性回归
        String vmSelectionPolicy = "msf"; // Minimum Migration Time (MMT) VM selection policy
        String parameter = "0.8"; // the safety parameter of the IQR policy

        new PlanetLabRunner(
                enableOutput,
                outputToFile,
                inputFolder,
                outputFolder,
                workload,
                vmAllocationPolicy,
                vmSelectionPolicy,
                parameter);
    }

}
