Ejemplo n.º 1
0
 /**
  * Get the value of variable v in this solution
  *
  * @param v IntVar (or BoolVar)
  * @return the value of variable v in this solution, or null if the variable is not instantiated
  *     in the solution
  */
 public Integer getIntVal(IntVar v) {
   if (empty) {
     throw new UnsupportedOperationException("Empty solution. No solution found");
   }
   if (intmap.containsKey(v.getId())) {
     return intmap.get(v.getId());
   } else {
     if ((v.getTypeAndKind() & Variable.TYPE) == Variable.CSTE) {
       return v.getValue();
     } else {
       return null;
     }
   }
 }