Skip to content

Is the implementation of HEFT correct? #30

Description

@peerdavid

Hello,

I think there are two problems with the current implementation of HEFT (findFinishTime):

        while (j >= 0) {
            Event current = sched.get(i);
            Event previous = sched.get(j);

            if (readyTime > previous.finish) {
                if (readyTime + computationCost <= current.start) {
                    start = readyTime;
                    finish = readyTime + computationCost;
                }

                break;
            }
            if (previous.finish + computationCost <= current.start) {
                start = previous.finish;
                finish = previous.finish + computationCost;
                pos = i;
            }
            i--;
            j--;
        }

(1) This loop assumes that sched is sorted by the start time right? But in this function we simply call sched.add such that a sorted list is no more guaranteed.
(2) In the code above we set the start time to the readyTime in one case. Shouldn't it be the previous.finish time? Otherwise it could. i.e. be that two tasks get the same start time...

Thank you, David

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions