}
  public List generateDemandTasks(long start, long duration, Collection relevantProjectSupplys) {    ArrayList demandTasks = new ArrayList();    regenerateProjectionHash(relevantProjectSupplys);    long end = start + duration;    Iterator gpTasksIt = projHash.keySet().iterator();    while (gpTasksIt.hasNext()) {      Task gpTask = (Task) gpTasksIt.next();      ArrayList supplyTasks = new ArrayList();      HashMap assetMap = (HashMap) projHash.get(gpTask);      Iterator assetsIt = assetMap.keySet().iterator();      while (assetsIt.hasNext()) {        Asset consumed = (Asset) assetsIt.next();        Collection projTasks = (Collection) (assetMap.get(consumed));        // Step through the period one hour at a time        long step = 3600000;        // Step through each hour of the requested period        for (long time=start; time<end; time += step) {          double totalQty = deriveTotalQty(time,time+step,projTasks);          if (totalQty <= 0.0) {            continue;          }          double taskQty = 0.0;          if (dgPlugin.getPoissonOn()) {            taskQty = poissonGen.nextPoisson(totalQty);          }          else {            taskQty = totalQty;          }          Iterator projTaskIt = projTasks.iterator();          if((taskQty > 0) && (projTaskIt.hasNext())) {            supplyTasks.add(createNewDemandTask(gpTask,                                                  (Task) projTaskIt.next(),                                                  consumed,                                                  time,                                                  time+step,                                                  taskQty));          }        }      }      if(!supplyTasks.isEmpty()){        addToAndPublishExpansion(gpTask,supplyTasks);        demandTasks.addAll(supplyTasks);      }    }    return demandTasks;  }