code: public int[] assignmentToIntArray(Assignment assignment) {
      int[] value = new int[nums.length];
      for (int i = 0; i < nums.length; i++) {
        Preconditions.checkState(vars[i] instanceof DiscreteVariable);
        Preconditions.checkArgument(assignment.contains(nums[i]),
            "Partial assignment provided to assignmentToIntArray. Assignment: %s, variables: %s", assignment, this);
        value[i] = ((DiscreteVariable) vars[i]).getValueIndex(assignment.getValue(nums[i]));
      }
      return value;
    }
docs: Converts an assignment over a set of {@code DiscreteVariable}s
  into an equivalent {@code int[]} representation. This method is
  used to efficiently store the possible assignments to discrete
  variables. The returned array has length equal to
  {@code this.size()}, and can be converted back into an assignment
  using {@link #intArrayToAssignment(int[])}.
  <p>
  If {@code assignment} contains values which are not in the domain
  of the corresponding discrete variables, this method throws an
  exception.
  
  @param assignment
  @return