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

        // Write into a results file
        FileWriter fwriter = null;
        try
        {
            fwriter = new FileWriter(super.get_name(), true);
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
            System.out.println(
                    "Unwanted errors while opening file " + super.get_name());
        }

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

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