protected void write(String event, int numMachines)
   {
        if (!record_) {
            return;
        }

        // Write into a results file
        // Now, we keep the moment of the failure in a results file for this res
        FileWriter fwriter = null;
        try
        {
           fwriter = new FileWriter(this.get_name(), true);
        }
        catch (Exception ex)
        {
           ex.printStackTrace();
           System.out.println("Unwanted errors while opening file " +
                              this.get_name());
        }

        try
        {
           fwriter.write(event+ " \t"+ numMachines+ " \t"+GridSim.clock()+"\n");
        }
        catch (Exception ex)
        {
           ex.printStackTrace();
           System.out.println("Unwanted errors while writing on file " +
                              this.get_name());
        }

        try
        {
           fwriter.close();
        }
        catch (Exception ex)
        {
           ex.printStackTrace();
           System.out.println("Unwanted errors while closing file " +
                              this.get_name());
        }
   }