bunkat / schedule

Automatically schedules tasks, work items, meetings, reservations, etc. Schedule takes into account working hours, holidays/days off, people's work schedule/vacation time, as well as task dependencies.
http://bunkat.github.io/schedule/
MIT License
429 stars 87 forks source link

scheduling two tasks at the same time. #15

Open mgoldenberg opened 7 years ago

mgoldenberg commented 7 years ago

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?

mgcox2 commented 6 years ago

@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.

mgoldenberg commented 6 years ago

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

mgcox2 commented 6 years ago

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

mgoldenberg commented 6 years ago

@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.

CiprianD commented 3 years ago

@mgoldenberg have you found a solution to this issue?

mgoldenberg commented 3 years ago

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