code: public FactorGraph getClamped(VarConfig clampVars) {
          FactorGraph clmpFg = new FactorGraph();
          // Add ALL the original variables to the clamped factor graph.
          for (Var v : this.getVars()) {
              clmpFg.addVar(v);
          }
          // Add ALL the original factors to the clamped factor graph.
          for (Factor origFactor : this.getFactors()) {
              clmpFg.addFactor(origFactor);
  
          }
          // Add unary factors to the clamped variables to ensure they take on the correct value.
          for (Var v : clampVars.getVars()) {
              // TODO: We could skip these (cautiously) if there's already a
              // ClampFactor attached to this variable.
              int c = clampVars.getState(v);
              clmpFg.addFactor(new ClampFactor(v, c));
          }        
          return clmpFg;
      }
docs: Gets a new factor graph, identical to this one, except that specified variables are clamped
  to their values. This is accomplished by adding a unary factor on each clamped variable. The
  original K factors are preserved in order with IDs 1...K.
  
  @param clampVars The variables to clamp.