예제 #1
0
 // FIXME: 12/6/2015 Fix chairsLeft algorithm. It looks to be based upon number of Groups instead
 // of number of Persons in the group.
 int getNumberOfFilledChairs() {
   int number = 0;
   for (Group group : this) {
     number += group.size();
   }
   return number;
 }
예제 #2
0
  boolean isFull() {
    int count = 0;

    for (Group group : chairs) {
      count += group.size();
    }
    return count >= maxNumberOfChairs;
  }
예제 #3
0
 @Override
 protected boolean checkPass(Clonotype clonotype) {
   Group group = control.getGroup(clonotype);
   if (group == null || group.size() < 3) {
     return clonotype.getCount() > 3;
   } else {
     return control.isRare(group) && group.isEnriched(clonotype);
   }
 }
예제 #4
0
 private Grid<Integer> calculateInitialGrid(
     final int[][] clues, final Map<Coord, Group> groupByCoord) {
   final Map<Coord, Set<Integer>> grid =
       Coord.overGrid(_width, _height)
           .collect(
               Collectors.toMap(
                   identity(),
                   coord -> {
                     final int given = coord.fromIntArray(clues);
                     final Group group = groupByCoord.get(coord);
                     return given > 0
                         ? Collections.<Integer>singleton(given)
                         : intSet(group.size());
                   }));
   return new Grid<>(grid, _width, _height);
 }