code: protected boolean add(GraphicalModel m, boolean recordOnDisk) {
          boolean success = super.add(m);
          if (!success) return false;
          if (recordOnDisk) {
              try {
                  if (writeWithFactors) {
                      // Attempt to record this to the backing log file, with the factors
                      writeExample(m);
                  } else {
                      // Attempt to record this to the backing log file, without the factors
                      Set<GraphicalModel.Factor> cachedFactors = m.factors;
                      m.factors = new HashSet<>();
                      writeExample(m);
                      m.factors = cachedFactors;
                  }
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return true;
      }
docs: Adds an element to the list, and if recordOnDisk is true, appends it to the backing store.
  
  @param m the model to add
  @param recordOnDisk whether or not to add to the backing disk store
  @return success