if (! ok)
if (b == null)
  public void generateAssignments (Chromosome chrom, SchedulingData data,                                   SchedulingSpecs specs) {    timeOps = specs.getTimeOps();    Resource[] r = data.getResources();    ignoringTime = specs.ignoringTime();    multitask = ((! ignoringTime) &&                 (specs.getMultitasking() ==                  SchedulingSpecs.MULTITASKING_UNGROUPED));    grouped = ((! ignoringTime) &&                 (specs.getMultitasking() ==                  SchedulingSpecs.MULTITASKING_GROUPED));    for (int i = 0; i < r.length; i++)      r[i].resetSumOfDeltas();    assignFrozen (data, specs);  // put in frozen assignments first    Task[] tasks2 = data.getPrimaryTasks();    ArrayList tasks = new ArrayList (tasks2.length);    for (int i = 0; i < tasks2.length; i++)      tasks.add (tasks2 [((StringOfIntegers) chrom).getValues()[i]]);    // Take one task at a time off the list of tasks and schedule it.    // Always take the one nearest the front of the list that is ready    // to be scheduled (i.e., is not waiting for prerequisites).    while (tasks.size() > 0) {      for (int i = 0; i < tasks.size(); i++) {        Task task = (Task) tasks.get(i);        Task[] prereqs = task.getPrerequisites ();        boolean readyButUnable = false;        for (int j = 0; j < prereqs.length; j++) {          if ((prereqs[j] != null) && (prereqs[j].getAssignment() == null)) {            readyButUnable = true;  // if prereq unassigned, same for current            break;          }        }        if (readyButUnable) {          tasks.remove (i);          break;        }        Resource[] resources = specs.capableResources (task, data);        Task[] linked = data.getLinkedTasks (task);        // if only one capable resource, just do assignment        if (resources.length == 1) {          if (resources[0].enoughCapacity (task.getCapacityContribs()) &&              makeAssignment (task, resources[0], prereqs,                              specs, data, true, true, linked)) {            float delta = specs.evaluateSingleAssignment (task, resources[0]);            if (delta != 0.0f)              resources[0].addDelta (delta);          }        }        // if more than one capable resource, look for best resource        // make temporary assignment to each resource and use delta        // evaluation to figure out which is best        else if (resources.length > 1) {          Resource bestResource = null;          float bestDelta = 0.0f;          boolean computeUnavail = true;          for (int j = 0; j < resources.length; j++) {            Resource resource = resources[j];            if (! resource.enoughCapacity (task.getCapacityContribs()))              continue;            boolean ok = makeAssignment (task, resource, prereqs, specs,                                         data, false, computeUnavail, linked);            computeUnavail = false;            if (! ok)              continue;            float delta = specs.evaluateSingleAssignment (task, resource);            if ((bestResource == null) ||                (specs.isMinimizing() && (delta < bestDelta)) ||                ((! specs.isMinimizing()) && (delta > bestDelta))) {              bestResource = resource;              bestDelta = delta;            }            removeAssignment (task, resource);          }          if (bestResource != null) {            makeAssignment (task, bestResource, prereqs, specs, data,                            true, false, linked);            if (bestDelta != 0.0f)              bestResource.addDelta (bestDelta);          }        }        tasks.remove (i);        break;      }    }  }