Skip to content

Is the implementation of HEFT correct? #30

@peerdavid

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

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