List demandTasks = demandGenerator.generateDemandTasks(time, (stepPeriod - 1), relevantProjs);
List demandTasks = demandGenerator.generateDemandTasks(time, (stepPeriod - 1), relevantProjs,relevantSupplys);
  protected void execute() {    if (myOrganization == null) {      myOrganization = getMyOrganization(selfOrganizations.elements());      if (myOrganization != null) {        if (blackboard.didRehydrate()) {          checkDateOfBlackboard();        }        projectionTaskSubscription =            (IncrementalSubscription)            blackboard.subscribe(new LocalTaskPredicate(supplyType, getOrgName(),                                                        Constants.Verb.ProjectSupply,                                                        taskUtils));      }      // the didRehydrate flag will be reset after the first transaction, if org is still null      // this is a problem      if (blackboard.didRehydrate() && myOrganization == null) {        if (logger.isErrorEnabled()) {          logger.error("Blackboard was rehydrated with null self organization, checkDateOfBlackboard"                       + " will not be called ");        }      }    }    // get the Logistics OPlan (our homegrown version with specific dates).    if ((logOPlan == null) || logisticsOPlanSubscription.hasChanged()) {      Iterator opIt = logisticsOPlanSubscription.iterator();      if (opIt.hasNext()) {        //we only expect to have one        logOPlan = (LogisticsOPlan) opIt.next();      }    }    if (myOrganization == null) {      if (logger.isInfoEnabled()) {        logger.info("\n DemandGeneratorPlugin " + supplyType +                    " not ready to process tasks yet." +                    " my org is: " + myOrganization);      }      return;    }    if((projectionTaskSubscription == null) ||       (projectionTaskSubscription.isEmpty()) ||       (logOPlan == null)) {       if (logger.isInfoEnabled()) {	   logger.info("\n DemandGeneratorPlugin " + supplyType +		       " not ready to process tasks yet." +		       " my org is: " + myOrganization);       }       return;    }    boolean generateDemand=false;    long planTime = getStartOfPeriod(getCurrentTimeMillis());    if(periodInDemandPeriod(projectionTaskSubscription, planTime, planTime+period)) {	generateDemand = ((timer == null) || (timerExpired()));    }    else {	long nextDemandPeriod = nextDemandPeriod(projectionTaskSubscription,						 planTime + period);	setTimerToTopOfPeriod(nextDemandPeriod);	return;    }    //if its time to generate demand do so.    if (generateDemand) {            if (logger.isInfoEnabled()) {        logger.info("Timer has gone off.  Planning for the next " +                    ((int) (period / getTimeUtils().MSEC_PER_HOUR))                    + "hours from " + new Date(planTime));      }      for (long time = planTime; time<planTime+period; time += stepPeriod) {        //filter and create task from time to time plus step period inclusive        //(stepPeriod -1)        Collection relevantProjs = filterProjectionsOnTime(projectionTaskSubscription,                                                           time, time + (stepPeriod - 1));        //TODO: MWD Remove debug statements:        if ((getOrgName() != null) &&            (getOrgName().trim().equals("1-35-ARBN")) &&            (logger.isDebugEnabled())) {          logger.debug("I'm waking up - new period starts " + new Date(planTime) +                       " and step (start,dur) is (" + new Date(time) +                       "," + stepPeriod + ")" +                       " and Num of projections for " + getOrgName() +                       " is: " + relevantProjs.size());        }        relevantProjs = class9Scheduler.filterProjectionsToMaxSpareParts(relevantProjs);        //filter and create task from time to time plus step period inclusive        //(stepPeriod -1)        List demandTasks = demandGenerator.generateDemandTasks(time, (stepPeriod - 1), relevantProjs);        if (demandOutputModule != null) {          demandOutputModule.writeDemandOutputToFile(demandTasks);        }      }      resetTimer();    }  }