schedule icon indicating copy to clipboard operation
schedule copied to clipboard

scheduling two tasks at the same time.

Open mgoldenberg opened this issue 7 years ago • 6 comments

Hi, I'm trying to schedule two tasks at the same time on the same date that both require a particular resource whose isNotReservable field is set to true. As far as I understand, these two tasks should not conflict with one another; however, I can't get something like this to work. To be more explicit, the following data results in the scheduler successfully scheduling t2, but failing to schedule t1:

let tasks = [{
    id: "t1",
    duration: 1,
    minLength: 1,
    resources: ["r1"],
    available: later.parse.text("after 1:00am and before 1:01am")
}, {
    id: "t2",
    duration: 1,
    minLength: 1,
    resources: ["r1"],
    available: later.parse.text("after 1:00am and before 1:01am")
}];

let resources = [{
    id: "r1",
    available: later.parse.text("after 1:00am and before 1:01am"),
    isNotReservable: true
}];

let start = new Date("2020-01-01");
let frequency = later.parse.text("on the 1 day of January in 2020");
let s = schedule.create(tasks, resources, frequency, start);

Is this expected behavior? Or, perhaps I'm doing something wrong?

mgoldenberg avatar Jul 30 '17 06:07 mgoldenberg

@mgoldenberg Were you able to solve this? I'm running into the same problem in my early testing of this library. I know this project is no longer maintained but I haven't been able to find an alternative. Thanks in advance.

mgcox2 avatar Nov 22 '17 19:11 mgcox2

@mgcox2: I tried and tried, but to no avail. If you manage to find a solution, do let me know.

mgoldenberg avatar Nov 22 '17 19:11 mgoldenberg

@mgoldenberg: Try adding the priority option to your tasks. The task with the higher priority should be scheduled, the other should not.

mgcox2 avatar Nov 29 '17 15:11 mgcox2

@mgcox2: the problem I had was not due to a priority issue as far as I can tell. It isn't that I want t1 scheduled as opposed to t2. It is that I want both scheduled at the same time. Since the resource has it's isNotReservable flag set to true, this should not be an issue.

mgoldenberg avatar Jan 16 '18 22:01 mgoldenberg

@mgoldenberg have you found a solution to this issue?

CiprianD avatar Dec 23 '20 07:12 CiprianD

Unfortunately, I never did. I had started digging through the source, but then I got bored... alas.

mgoldenberg avatar Dec 26 '20 00:12 mgoldenberg