thePG.clearTargetLevels(startBucket);
  private void setTargetForProjectionPeriod(LogisticsInventoryPG thePG,                                             int startBucket, double prevTarget){    if (logger.isDebugEnabled()) {       logger.debug("For item: "+thePG.getResource() +                    " set Projection inventory and target levels starting with bucket: "+                   startBucket);    }    int reorderPeriod = (int)thePG.getReorderPeriod();    int lastDemandBucket = thePG.getLastDemandBucket();    double lastTarget;    int inventoryBucket;        // get the first target before we loop so we have 2 points for the    // inventory level calculations.    int reorderPeriodEndBucket = startBucket + reorderPeriod;    double target = getTargetLevel(startBucket,reorderPeriodEndBucket, thePG);    thePG.setTarget(startBucket, target);    lastTarget = target;    //     System.out.println("Last demand bucket for "+inventoryPlugin.getResourceName(thePG.getResource())+// 		       "-"+getAssetUtils().getPartNomenclature(thePG.getResource())+" is "+// 		       lastDemandBucket+" at "+getOrgName());    // Start the loop after the first reorderperiod    for (int targetLevelBucket = startBucket + reorderPeriod;          targetLevelBucket <= lastDemandBucket;          targetLevelBucket = targetLevelBucket + reorderPeriod ) {      reorderPeriodEndBucket = targetLevelBucket + reorderPeriod;      target = getTargetLevel(targetLevelBucket,reorderPeriodEndBucket, thePG);      thePG.setTarget(targetLevelBucket, target);      // set the start point for the inventory calcualtions to the       // beginning of the last target window       //ie whatever bucket lastTarget was set for.      inventoryBucket = targetLevelBucket - reorderPeriod;      for (int i=0; i < reorderPeriod; i++) {        double diff = target - lastTarget;         double calcTarget = lastTarget + ((diff * i)/reorderPeriod);        //inv level in projection land is the average of the critcial and target levels        double level = (thePG.getCriticalLevel(inventoryBucket + i) + calcTarget) / 2;        thePG.setLevel(inventoryBucket + i, level);      }      lastTarget = target;    }  }