private boolean makeAssignment (Task task, Resource resource,
private Resource.Block makeAssignment (Task task, Resource resource,
  private boolean makeAssignment (Task task, Resource resource,                                  Task[] prereqs, SchedulingSpecs specs,                                  SchedulingData data, boolean doUpdates,                                  boolean firstResource, Task[] linked) {    Resource.Block block = null;    if (! ignoringTime) {      int dur = specs.taskDuration (task, resource, firstResource);      int bestTime = specs.bestTime (task, resource, dur, firstResource);      TimeBlock[] unavail;	        if (timing) {        visits++;        Date start = new Date ();        unavail = specs.taskUnavailableTimes              (task, prereqs, data.getStartTime(), data.getEndTime(),               resource, dur, firstResource);        totaltime += new Date().getTime () - start.getTime();      } else {        unavail = specs.taskUnavailableTimes              (task, prereqs, data.getStartTime(), data.getEndTime(),               resource, dur, firstResource);      }	        block = resource.earliestAvailableBlock (task, dur, unavail, specs,                                               multitask, grouped, bestTime,                                               data.getStartTime(),                                               linked, data);      if (bestTime > data.getStartTime()) {        Resource.Block block2 =          resource.latestAvailableBlock (task, dur, unavail, specs,                                         multitask, grouped, bestTime + dur,                                         data.getEndTime(), linked, data);        if (block == null)          block = block2;        else if ((block2 != null) &&                 (block.start != block2.start)) {          makeAssignment2 (task, resource, block, false, false);          float d1 = specs.evaluateSingleAssignment (task, resource);          removeAssignment (task, resource);          makeAssignment2 (task, resource, block2, false, false);          float d2 = specs.evaluateSingleAssignment (task, resource);          removeAssignment (task, resource);          if (specs.isMinimizing() ^              ((d1 < d2) || ((d1 == d2) && ((block.start - bestTime) <                                            (bestTime - block2.start)))))            block = block2;        }      }      if (block == null)        return false;    }    makeAssignment2 (task, resource, block, doUpdates, false);    if (doUpdates) {      for (int j = 0; j < linked.length; j++) {        int timeDiff = data.cachedLinkTimeDiff (task, linked[j]);        assignAtTime (linked[j], block.start - timeDiff, data, specs);      }    }    return true;  }