@@ -0,0 +1,1403 @@
+import java.io.FileWriter;%0A%0A/**%0A * Generate test data%0A *%0A * Example output%0A * c1_x c1_y%0A * c2_x c2_y%0A * ...%0A * ck_x ck_y%0A *%0A * d1_x d1_y%0A * d2_y d2_y%0A * ...%0A * dszie_x dsize_y%0A */%0Apublic class DataGenerator %7B%0A    /**%0A     * Main method%0A     * @param args k size out_file_name%0A     */%0A    public static void main(String%5B%5D args) %7B%0A        int k = Integer.parseInt(args%5B0%5D); // num of centroids%0A        int size = Integer.parseInt(args%5B1%5D); // size of data%0A%0A        double%5B%5D%5B%5D data = new double%5Bsize%5D%5B2%5D;%0A%0A        try %7B%0A            FileWriter out = new FileWriter(args%5B2%5D); // output file name%0A            double%5B%5D%5B%5D centroids = new double%5Bk%5D%5B2%5D;%0A            for (int i = 0; i %3C k; i++) %7B%0A                centroids%5Bi%5D%5B0%5D = Math.random() * 80 + 10;        //range 10 ~ 90%0A                centroids%5Bi%5D%5B1%5D = Math.random() * 80 + 10;%0A%0A                out.write(centroids%5Bi%5D%5B0%5D + %22 %22 + centroids%5Bi%5D%5B1%5D + %22%5Cn%22);%0A            %7D%0A%0A            out.write(%22%5Cn%22);%0A%0A            for (int i = 0; i %3C size; i++) %7B%0A                int t = (int) (Math.random() * k);%0A                data%5Bi%5D%5B0%5D = centroids%5Bt%5D%5B0%5D - 10 + Math.random() * 20;  //range centroid +- 10%0A                data%5Bi%5D%5B1%5D = centroids%5Bt%5D%5B1%5D - 10 + Math.random() * 20;%0A%0A                out.write(data%5Bi%5D%5B0%5D + %22 %22 + data%5Bi%5D%5B1%5D + %22%5Cn%22);%0A            %7D%0A%0A            out.close();%0A        %7D catch (Exception e) %7B%0A            e.printStackTrace();%0A        %7D%0A%0A%0A    %7D%0A%7D%0A

Create a test file generator Changes to be committed: new file: src/main/java/DataGenerator.java