public void populateMI_File(){

        System.out.println("Inserting "+datasetSize+ " objects in the database. It might take a while...");

        //Create and/or open the MI_File
        MI_File mi_file=new MI_File(ref_objects_num, ki, ks, indexDirectory, referenceObjectsFile);

        try{
            //Let's begin bulk load
            mi_file.beginBulkLoad();

            //now we insert the objects
            for(int i=0;i<datasetSize;i++){
                DatasetObject obj=new Vector32D(i,null);
                //Here we initialize it randomly. However this is just an example.
                //In reality you will insert the objects from the real dataset to be indexed.
                ((Vector32D)obj).initializeRandom();
                //Let's insert it
                mi_file.bulkInsert(obj);
                if((i % 1000)== 0 )
                    System.out.println(i + " objects inserted in the MI-File...");
            }

            //now we can end bulk load
            mi_file.endBulkLoad();
            //We can also close the MI_File
            mi_file.close();
        }catch(Exception e){
            e.printStackTrace();
        }
    }