Menu

#58 % completed shouldn't depend on real duration

1.5.2
closed
nobody
acwp (1)
Other
Other
Other
Other
Normal
2014-08-10
2013-03-06
No

When modifying the "real duration" for ACWP calculations, the % completed is also modified along with the ACWP value. I would rather expect the % completed to remain at 100%, because the task is completed, it just took a shorter time then originally planned.

Discussion

  • Julien Lamarche

    Julien Lamarche - 2013-03-06
    • severity: Trivial --> Normal
     
  • Julien Lamarche

    Julien Lamarche - 2013-03-06
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1 @@
    -When modifying the "real duaration" for ACWP calculations, the % completed is also modified along with the ACWP value.  I would rather expect the % completed to remain at 100%, because the task is completed, it just took a shorter time then originally planned.
    +When modifying the "real duration" for ACWP calculations, the % completed is also modified along with the ACWP value.  I would rather expect the % completed to remain at 100%, because the task is completed, it just took a shorter time then originally planned.
    
     
  • Tahoeob

    Tahoeob - 2013-03-06

    Hi Julien,

    I was pondering why that would happen and don't have an answer..... We are rewriting all of ProjectLibre and will make sure to address this. Thank you for your post!

    Marc

     
  • Julien Lamarche

    Julien Lamarche - 2013-03-07

    Thanks for the follow up Marc! Much appreciated.

    Settting a breakpoint in AssignmentDetail.setPercentComplete on line 134 of openproj_core/src/com/projity/pm/assignment/AssignmentDetail.java, when I change the actual duration, I get the following stack trace (read bottom to top):

    AssignmentDetail.setPercentComplete(double) line: 134.
    AssignmentDetail.setStop(long) line 920
    Assignment.setStop(long) line 2045
    NormalTask.setStop(long) line 1158
    NormalTask(Task).setActualDuration(long) line 1177

    So from setActualDuration, execution eventually gets to setPercentComplete.

    Now if I remove the call to setPercentComplete on line 920, the actual duration never sets to the new actual duration and reverts back to the old actual duration. Also, if I set the call of setPercentComplete to a constant, such as:

    setPercentComplete(0.5);

    ... the actual duration goes to half of what it was prevoiusly. So not only does actual duration influences percent complete, percent complete influences actual duration.

    I think the trick to debugging this one is to remove the call to setPercentComplete, and then figure out why the actualDuration is still reverting to the old duration.

    One hypothesis I had is that somewhere the execution gets the parents of the task to recalculate the schedule, but innavertently gets the current task and re-reads the previous duration.

     
  • Julien Lamarche

    Julien Lamarche - 2013-03-10

    Here's another clue in openproj_core/src/com/projity/pm/task/Task.java:1159 :

    :::java
    /**
     * Actual duration is % complete * duration for all tasks including parents
     */
        public long getActualDuration() {
            long duration = getDuration();
            long result = Math.round(getPercentComplete() * Duration.millis(duration));
            return Duration.useTimeUnitOfInNone(result, duration);
        }
    

    So, I'm thinking:

    1. AssignmentDetail.setStop() (openproj_core_src/com/projity/pm/assignment/AssignmentDetail.java:896) needs to stop calling setPercentComplete

    2. Task.getActualDuration() needs to calculate actualDuration some other way using actualStart and ???????

    There lies the next question. When inspecting an object of normalTask class, I've seen the property actualStart, but no actualStop. I'll have to look more closely at how setStop works. I'm assuming I'll have to create the actualStop property, but I'm worried that may screw up parent duration caculations (or may require writting so much more code so that parents make the distintion between duration and actualDuration).

    Input / feedback is most welcomed.

     

    Last edit: Julien Lamarche 2013-03-10
  • Julien Lamarche

    Julien Lamarche - 2013-03-10

    Some thoughts for a potential fix.

    I haven't compiled at the time of the posting. Its getting late and I'm not sure I can work further on this for today. But I did want to post my notes for feedback.

    1. in Task.getActualDuration (openproj_core/src/com/projity/pm/task/Task.java:1070), the code should :

    ' a. If the task is not 100% complete, return % complete * duration (its actually not complete until the task is complete done, so your actual duratoin is the work that is partially done)

    ' b. If the task is 100% complete, then return the diff between ActualFinish - actualStart.

    :::java
    /**
     * *If* the task is incomplete,
     * Actual duration is % complete * duration for all tasks including parents
     * 
     * If not, its the actual finish - actual start
     * 
     */
        public long getActualDuration() {
            long actualDuration;
            if (getPercentComplete() < 1.0) {
                long duration = getDuration();
                long result = Math.round(getPercentComplete() * Duration.millis(duration));
                actualDuration = Duration.useTimeUnitOfInNone(result, duration);
            } else {
                long finish = getActualFinish();
                long start = getActualStart();
                actualDuration = getEffectiveWorkCalendar().compare(finish,start,false);        
            }
    
            return actualDuration;
        }
    

    '2. In NormalTask.setStop, (openproj_core/src/com/projity/pm/task/NormalTask.java:1146), if the task is 100% complete, call setActualFinish .

    I suspect I have to add a condition somewhere if the task is not 100% done, but I'm not sure where.

    :::java
        /**
         * @param stop
         */
        public void setStop(long stop) {
            if (stop == getStop())
                return;
            stop = DateTime.closestDate(stop);
            stop = Math.min(stop,getEnd());
    
            if(this.getPercentComplete() = 1.0)
                this.setActualFinish(stop);
    

    '3. In Task.setActualFinish (openproj_core/src/com/projity/pm/task/Task.java:1073), maybe set a property actualFinish rather then call set end. But without code re-write that would probably screw up schedule calculations for work packets (parent tasks).

    I see there are two properties ./openproj_core/src/com/projity/pm/criticalpath/TaskSchedule.java : finish and end. Any idea what is the difference between the two? And is criticalpath/TaskSchedule used for non-critical path tasks?

    :::java
        /**
         * @param actualFinish
         */
        public void setActualFinish(long actualFinish) {
            long old = getActualFinish();
            if (actualFinish == old)
                return;
            setEnd(actualFinish);  // actualFinish here?
            setPercentComplete(1.0);
        }
    

    '4. Only adjust percent complete if the task is not completed (?):

    :::java
        public void setStop(long stop) {
            if (stop < getStart()) // if before start ignore
                return;
            if (percentComplete == 1.0 && stop >= getActualFinish()) // adjust to be no later than actual finish
                return;
    
    //      System.out.println("setting stop to  " + new java.util.Date(stop));
    
            if (stop <= getStart()) { // if getting rid of completion
                setPercentComplete(0);
            } else if (percentComplete < 1.0){
                long actualDuration = getEffectiveWorkCalendar().compare(stop,getStart(),false);
    //          if (getDependencyStart() >= getStop() && getDependencyStart() < stop) {// if setting stop incorporates split due to dependency
    //              actualDuration -= getSplitDuration();
    //          }
            //  duration = getWorkContour().calcTotalBucketDuration(0);
    
    
                long d = getDuration();
                if (d != 0)
                    setPercentComplete(((double)actualDuration) / d);
            }
        }
    
     
  • Julien Lamarche

    Julien Lamarche - 2013-03-10

    If I may repeat my question in a separate post:

    I see there are two properties ./openproj_core/src/com/projity/pm/criticalpath/TaskSchedule.java : finish and end. Any idea what is the difference between the two? And is criticalpath/TaskSchedule used for non-critical path tasks?

     
  • Julien Lamarche

    Julien Lamarche - 2013-03-17

    My mistake:

    What doesn't change is the planned (baseline) duration. "% complete" = "acutal duration" / duration because duration is how long the task is expected to last in its most recent estimation and reflected in the gantt chart, while "actual duration" is how long the ressource has worked on the task thus far. So, "actual duration" can't be long than duration, and it makes sense that % complete will depend on the value of "actual duration".

    I'm using real and actual interchangeably here, I have the french interface where its called "durée réelle", I don't know what the English term is.

    Closing ticket.

     
  • Julien Lamarche

    Julien Lamarche - 2013-03-17

    Not a bug.

     
  • Julien Lamarche

    Julien Lamarche - 2013-03-17
    • status: open --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.