public static void main(String[] args) {

               
        //createNInstances(n, numberOfGenerators, numberOfLoadsForGenerator, R, xmean, delta);
        /*int[] Ma = {200, 1000, 2000, 10000, 20000, 100000};
        int[] na = {100, 100, 100, 100, 100, 20};*/


        int[] Ma = {2};
        int[] na = {1};
        double xmeanbase = 0.29;
        double modxmean;
        double modxmean_startvalue=0;

        if (args.length >= 1){
            Ma[0] = Integer.parseInt(args[0]);
        }
        if ( args.length >= 2){
            na[0] = Integer.parseInt(args[1]);
        }
        if ( args.length >= 3){
            modxmean_startvalue = Double.parseDouble(args[2]);
        }
        int n;
        int M;
        double xmean;
        double delta = 0.2;
        int numberOfLoadsForGenerator = 3;
        int R = 2;
        long time = System.currentTimeMillis();
        long oldtime = time;
        String path;
        //System.out.println("[" + time + "ms] Begin.");
        try {
            Runtime.getRuntime().exec("mkdir ./report");


            for (int index = 0; index < Ma.length; index++) {

                M = Ma[index];
                Runtime.getRuntime().exec("mkdir -p ./report/"+M);

                for (modxmean = modxmean_startvalue; modxmean < 11; modxmean++){

                    xmean = xmeanbase + (modxmean/1000.0);


                    Runtime.getRuntime().exec("mkdir -p ./report/"+M+"/"+xmean);

                    for (n = 0; n < na[index]; n++) {
                        time = System.currentTimeMillis();
                        System.out.println("[" + (time-oldtime)/1000.0 + "s] M="+M+" xmean="+xmean+" iteration="+(n+1)+"/"+(na[index]));
                        oldtime=time;
                        // create n instances
                        path = "./report/" + M + "/" + xmean + "/" + n + ".pg";
                        //System.out.println("Starting creating istance.");
                        createInstanceAndSave(1, M, numberOfLoadsForGenerator, R, xmean, delta, path);
                        //System.out.println("Istance created.");
                    }
                }
            }

        } catch (IOException ex) {
            ex.printStackTrace();
        }

    }