Gets the values of the variables in {@code Assignment} and
returns them as a {@code List}. This operation is the inverse of
{@link #outcomeToAssignment(List)}. The size of the returned list
is equal to {@code this.size()}.

@param assignment
@return
762894
public List<Object> assignmentToOutcome(Assignment assignment) {
    List<Object> returnValue = Lists.newArrayList();
    for (int varNum : nums) {
      returnValue.add(assignment.getValue(varNum));
    }
    return returnValue;
  }
727820
public Assignment model() {
    if (this.result == UNDEF)
      throw new IllegalStateException("Cannot get a model as long as the formula is not solved.  Call 'solve' first.");
    return this.result != UNSATISFIABLE ? this.createAssignment(this.solver.model()) : null;
  }
624185
public final Assignment union(Assignment other) {
    Preconditions.checkNotNull(other);
    if (other.size() == 0) {
      return this;
    } if (vars.length == 0) {
      return other;
    }

    // Merge varnums / values
    int[] otherNums = other.getVariableNumsArray();
    int[] myNums = getVariableNumsArray();
    Object[] otherVals = other.getValuesArray();
    Object[] myVals = getValuesArray();

    int[] mergedNums = new int[otherNums.length + myNums.length];
    Object[] mergedVals = new Object[otherNums.length + myNums.length];

    int i = 0;
    int j = 0;
    int numFilled = 0;
    while (i < otherNums.length && j < myNums.length) {
      if (otherNums[i] < myNums[j]) {
        mergedNums[numFilled] = otherNums[i];
        mergedVals[numFilled] = otherVals[i];
        i++;
        numFilled++;
      } else if (otherNums[i] > myNums[j]) {
        mergedNums[numFilled] = myNums[j];
        mergedVals[numFilled] = myVals[j];
        j++;
        numFilled++;
      } else {
        Preconditions.checkState(false, "Cannot combine non-disjoint assignments: %s with %s", this, other);
      }
    }
    // One list might still have elements in it.
    while (i < otherNums.length) {
      mergedNums[numFilled] = otherNums[i];
      mergedVals[numFilled] = otherVals[i];
      i++;
      numFilled++;
    }
    while (j < myNums.length) {
      mergedNums[numFilled] = myNums[j];
      mergedVals[numFilled] = myVals[j];
      j++;
      numFilled++;
    }
    Preconditions.checkState(numFilled == mergedNums.length);
    return Assignment.fromSortedArrays(mergedNums, mergedVals);
  }
614109
public void setAssignments(java.util.Collection<Assignment> assignments) {
        if (assignments == null) {
            this.assignments = null;
            return;
        }

        this.assignments = new java.util.ArrayList<Assignment>(assignments);
    }
796861
private void readAssignment(Resource resource, Assignment assignment)
   {
      Task task = m_activityMap.get(assignment.getActivity());
      if (task != null)
      {
         task.addResourceAssignment(resource);
      }
   }
697325
public Assignment mapVariables(Map<Integer, Integer> varMap) {
    int[] newVarNums = new int[vars.length];
    Object[] newValues = new Object[vars.length];

    int numFilled = 0;
    for (int i = 0; i < vars.length; i++) {
      if (varMap.containsKey(vars[i])) {
        newVarNums[numFilled] = varMap.get(vars[i]);
        newValues[numFilled] = values[i];
        numFilled++;
      }
    }
    
    if (numFilled < newVarNums.length) {
      newVarNums = Arrays.copyOf(newVarNums, numFilled);
      newValues = Arrays.copyOf(newValues, numFilled);
    }
    return Assignment.fromUnsortedArrays(newVarNums, newValues);
  }
610405
public java.util.Map<String, String> getVariables() {
        if (variables == null) {
            variables = new com.amazonaws.internal.SdkInternalMap<String, String>();
        }
        return variables;
    }
337735
public List<List<Object>> getTuples() {
    Iterator<KeyValue> keyValueIter = indicators.keyValueIterator();
    List<List<Object>> tuples = Lists.newArrayList();
    while (keyValueIter.hasNext()) {
      KeyValue keyValue = keyValueIter.next();
      if (keyValue.getValue() != 0.0) {
        tuples.add(vars.intArrayToAssignment(keyValue.getKey()).getValues());
      }
    }
    return tuples;
  }
894230
public void setAssignmentValue(int[] assignment, double value) {
    assert !Double.isNaN(value);
    values[getTableAccessOffset(assignment)] = value;
  }
804195
public static List<Entry> assignmentStructure(Assignment assignment) {
        List<Entry> entryList = new LinkedList<>();
        entryList.add(namedObject(DnFactory.assignment(assignment)));
        entryList.add(namedDescriptiveObject(DnFactory.assignmentProject(assignment), assignment.getProject()));
        entryList.add(namedDescriptiveObject(DnFactory.assignmentUser(assignment), assignment.getUser()));
        entryList.addAll(createAssignmentPermissionsEntries(assignment));
        entryList.addAll(createAssignmentRolesEntries(assignment));
        return entryList;
    }
566471
private int evaluateLHS(final Assignment assignment) {
    int lhs = 0;
    for (int i = 0; i < this.literals.length; i++)
      if (this.literals[i].evaluate(assignment))
        lhs += this.coefficients[i];
    return lhs;
  }
1243365
public static <VALUEIN> void assignResultValue(Class<? extends Writable> valueClass, 
            ResultItem result, VALUEIN value) {
        if (valueClass.equals(Text.class)) {
            ((Text)value).set(result.asString());
        } else if (valueClass.equals(IntWritable.class) &&
                result.getValueType() == ValueType.XS_INTEGER) {
            XSInteger intItem = (XSInteger)result.getItem();
            ((IntWritable)value).set(intItem.asPrimitiveInt());
        } else if (valueClass.equals(VIntWritable.class) &&
                result.getValueType() == ValueType.XS_INTEGER) {
            XSInteger intItem = (XSInteger)result.getItem();
            ((VIntWritable)value).set(intItem.asPrimitiveInt());
        } else if (valueClass.equals(LongWritable.class) &&
                result.getValueType() == ValueType.XS_INTEGER) {
            XSInteger intItem = (XSInteger)result.getItem();
            ((LongWritable)value).set(intItem.asLong());
        } else if (valueClass.equals(VLongWritable.class) &&
                result.getValueType() == ValueType.XS_INTEGER) {
            XSInteger intItem = (XSInteger)result.getItem();
            ((VLongWritable)value).set(intItem.asLong());
        } else if (valueClass.equals(BooleanWritable.class) &&
                result.getValueType() == ValueType.XS_BOOLEAN) {
            XSBoolean boolItem = (XSBoolean)result.getItem();
            ((BooleanWritable)value).set(boolItem.asPrimitiveBoolean());
        } else if (valueClass.equals(FloatWritable.class) &&
                result.getValueType() == ValueType.XS_FLOAT) {
            XSFloat floatItem = (XSFloat)result.getItem();
            ((FloatWritable)value).set(floatItem.asPrimitiveFloat());
        } else if (valueClass.equals(DoubleWritable.class) &&
                result.getValueType() == ValueType.XS_DOUBLE) {
            XSDouble doubleItem = (XSDouble)result.getItem();
            ((DoubleWritable)value).set(doubleItem.asPrimitiveDouble());
        } else if (valueClass.equals(BytesWritable.class) &&
                result.getValueType() == ValueType.XS_HEX_BINARY) {
            XSHexBinary binItem = (XSHexBinary)result.getItem();
            byte[] bytes = binItem.asBinaryData();
            ((BytesWritable)value).set(bytes, 0, bytes.length);
        } else if (valueClass.equals(BytesWritable.class) &&
                result.getValueType() == ValueType.XS_BASE64_BINARY) {
            XSBase64Binary binItem = (XSBase64Binary)result.getItem();
            byte[] bytes = binItem.asBinaryData();
            ((BytesWritable)value).set(bytes, 0, bytes.length);
        } else if (valueClass.equals(BytesWritable.class) &&
                result.getValueType() == ValueType.BINARY) {
            byte[] bytes = ((XdmBinary)result.getItem()).asBinaryData();
            ((BytesWritable)value).set(bytes, 0, bytes.length);
        } else if (valueClass.equals(MarkLogicNode.class) &&
                (result.getValueType() == ValueType.NODE ||
                 result.getValueType() == ValueType.ELEMENT ||
                 result.getValueType() == ValueType.DOCUMENT ||
                 result.getValueType() == ValueType.ATTRIBUTE ||
                 result.getValueType() == ValueType.TEXT)) {
            ((MarkLogicNode)value).set(result);
        } else if (valueClass.equals(DatabaseDocument.class)) {
            ((DatabaseDocument) value).set(result);
        } else {
            throw new UnsupportedOperationException("Value " +  
                    valueClass + " is unsupported for result type: " + 
                    result.getValueType());
        }
    }
98833
public String getOperator() {
    if (VariableAssignment_Type.featOkTst && ((VariableAssignment_Type)jcasType).casFeat_operator == null)
      jcasType.jcas.throwFeatMissing("operator", "ch.epfl.bbp.uima.types.VariableAssignment");
    return jcasType.ll_cas.ll_getStringValue(addr, ((VariableAssignment_Type)jcasType).casFeatCode_operator);}
544916
public SortedSet<Variable> support(final BDD bdd) {
    final int supportBDD = this.kernel.support(bdd.index());
    final Assignment assignment = createAssignment(supportBDD);
    assert assignment == null || assignment.negativeLiterals().isEmpty();
    return assignment == null ? new TreeSet<Variable>() : new TreeSet<>(assignment.positiveLiterals());
  }
471975
public SDVariable assign(String name, SDVariable x, SDVariable y) {
        SDVariable ret = f().assign(x, y);
        return updateVariableNameAndReference(ret, name);
    }
39970
private void readAssignments(Project plannerProject)
   {
      Allocations allocations = plannerProject.getAllocations();
      List<Allocation> allocationList = allocations.getAllocation();
      Set<Task> tasksWithAssignments = new HashSet<Task>();

      for (Allocation allocation : allocationList)
      {
         Integer taskID = getInteger(allocation.getTaskId());
         Integer resourceID = getInteger(allocation.getResourceId());
         Integer units = getInteger(allocation.getUnits());

         Task task = m_projectFile.getTaskByUniqueID(taskID);
         Resource resource = m_projectFile.getResourceByUniqueID(resourceID);

         if (task != null && resource != null)
         {
            Duration work = task.getWork();
            int percentComplete = NumberHelper.getInt(task.getPercentageComplete());

            ResourceAssignment assignment = task.addResourceAssignment(resource);
            assignment.setUnits(units);
            assignment.setWork(work);

            if (percentComplete != 0)
            {
               Duration actualWork = Duration.getInstance((work.getDuration() * percentComplete) / 100, work.getUnits());
               assignment.setActualWork(actualWork);
               assignment.setRemainingWork(Duration.getInstance(work.getDuration() - actualWork.getDuration(), work.getUnits()));
            }
            else
            {
               assignment.setRemainingWork(work);
            }

            assignment.setStart(task.getStart());
            assignment.setFinish(task.getFinish());

            tasksWithAssignments.add(task);

            m_eventManager.fireAssignmentReadEvent(assignment);
         }
      }

      //
      // Adjust work per assignment for tasks with multiple assignments
      //
      for (Task task : tasksWithAssignments)
      {
         List<ResourceAssignment> assignments = task.getResourceAssignments();
         if (assignments.size() > 1)
         {
            double maxUnits = 0;
            for (ResourceAssignment assignment : assignments)
            {
               maxUnits += assignment.getUnits().doubleValue();
            }

            for (ResourceAssignment assignment : assignments)
            {
               Duration work = assignment.getWork();
               double factor = assignment.getUnits().doubleValue() / maxUnits;

               work = Duration.getInstance(work.getDuration() * factor, work.getUnits());
               assignment.setWork(work);
               Duration actualWork = assignment.getActualWork();
               if (actualWork != null)
               {
                  actualWork = Duration.getInstance(actualWork.getDuration() * factor, actualWork.getUnits());
                  assignment.setActualWork(actualWork);
               }

               Duration remainingWork = assignment.getRemainingWork();
               if (remainingWork != null)
               {
                  remainingWork = Duration.getInstance(remainingWork.getDuration() * factor, remainingWork.getUnits());
                  assignment.setRemainingWork(remainingWork);
               }
            }
         }
      }
   }
1334848
private static Node varToAssign(Node var) {
    Node assign =
        IR.assign(var.getFirstChild().cloneNode(), var.getFirstChild().removeFirstChild());
    return IR.exprResult(assign).useSourceInfoIfMissingFromForTree(var);
  }