AspectScorePoint first_late = new AspectScorePoint(bestDay+thePG.getBucketMillis(), alpha, AspectType.END_TIME); AspectScorePoint latest = new AspectScorePoint(end, (alpha + late_score), AspectType.END_TIME);
AspectScorePoint first_late = new AspectScorePoint(AspectValue.newAspectValue(AspectType.END_TIME, bestDay+thePG.getBucketMillis()), alpha); AspectScorePoint latest = new AspectScorePoint(AspectValue.newAspectValue(AspectType.END_TIME, end), (alpha + late_score));
  private Preference createRefillTimePreference(long bestDay, long today, LogisticsInventoryPG thePG) {    //TODO - really need last day in theatre from an OrgActivity -    long end = inventoryPlugin.getOPlanEndTime();    double bucketsBetween = ((end - bestDay)  / thePG.getBucketMillis()) - 1;    //Use .0033 as a slope for now    double late_score = .0033 * bucketsBetween;    // define alpha .25    double alpha = .25;    Vector points = new Vector();    AspectScorePoint earliest = new AspectScorePoint(today, alpha, AspectType.END_TIME);    AspectScorePoint best = new AspectScorePoint(bestDay, 0.0, AspectType.END_TIME);//     AspectScorePoint first_late = new AspectScorePoint(getTimeUtils().addNDays(bestDay, 1), //                                                        alpha, AspectType.END_TIME);    AspectScorePoint first_late = new AspectScorePoint(bestDay+thePG.getBucketMillis(),                                                        alpha, AspectType.END_TIME);    AspectScorePoint latest = new AspectScorePoint(end, (alpha + late_score),                                                    AspectType.END_TIME);    points.addElement(earliest);    points.addElement(best);    points.addElement(first_late);    points.addElement(latest);    ScoringFunction endTimeSF = ScoringFunction.      createPiecewiseLinearScoringFunction(points.elements());    return inventoryPlugin.getPlanningFactory().      newPreference(AspectType.END_TIME, endTimeSF);      }