예제 #1
0
 public Iterator<?> iterator(Object entity) {
   if (cachedPlanningValues != null) {
     return cachedPlanningValues.iterator();
   } else {
     CountableValueRange<?> valueRange =
         (CountableValueRange<?>)
             valueRangeDescriptor.extractValueRange(scoreDirector.getWorkingSolution(), entity);
     List<?> values = Lists.newArrayList(valueRange.createOriginalIterator());
     return values.iterator();
   }
 }
예제 #2
0
 private void initSelectedPlanningValueList(AbstractSolverPhaseScope phaseScope) {
   if (valueRangeDescriptor.isEntityIndependent()) {
     CountableValueRange<?> valueRange =
         (CountableValueRange<?>)
             ((EntityIndependentValueRangeDescriptor) valueRangeDescriptor)
                 .extractValueRange(phaseScope.getWorkingSolution());
     cachedPlanningValues = Lists.newArrayList(valueRange.createOriginalIterator());
   } else {
     cachedPlanningValues = null;
   }
 }