code: public GraphicalModel cloneModel() {
      GraphicalModel clone = new GraphicalModel();
      clone.modelMetaData.putAll(modelMetaData);
      for (int i = 0; i < variableMetaData.size(); i++) {
        if (variableMetaData.get(i) != null) {
          clone.getVariableMetaDataByReference(i).putAll(variableMetaData.get(i));
        }
      }
  
      for (Factor f : factors) {
        clone.factors.add(f.cloneFactor());
      }
  
      return clone;
    }
docs: The point here is to allow us to save a copy of the model with a current set of factors and metadata mappings,
  which can come in super handy with gameplaying applications. The cloned model doesn't instantiate the feature
  thunks inside factors, those are just taken over individually.
  
  @return a clone