public void createReferenceObjects(){

        System.out.println("Creating "+ref_objects_num+ " reference objects...");

        //We first create the directory to store the referenceo object file
        //in case it does not exists.
        File indexDirectory_f=new File(indexDirectory);
                    if(!indexDirectory_f.exists())
                        indexDirectory_f.mkdirs();

        //Let's check if a reference object file already exists.
        //We do not want to overwrite it. Existing MI_File (if any)
        //would become unusable.
        File file=new File(referenceObjectsFile);
        if (!file.exists()){
            //Create an empty set of Reference Objects
            ReferenceObjects ros=new ReferenceObjects();
            ros.initializeEmpty(ref_objects_num);

            //now we add the reference objects
            for(int i=0;i<ref_objects_num;i++){
                DatasetObject ref_obj=new Vector32D(i,null);
                //Here we initialize it randomly. However this is just an example.
                //In reality you migh want to use a random sample of objects from the real dataset to be indexed.
                ((Vector32D)ref_obj).initializeRandom();
                //Let's add it to the set of reference objects
                ros.add(ref_obj);
            }
            //now we can save the set of reference objects
            ros.save(referenceObjectsFile);
        }
        else
            System.out.println("Reference object file already exist! Manually remove it if you want to create a new one.");
    }