Premium support for our pure JavaScript UI components


Post by guillaume.morin »

I'm loading initial data using the following:

scheduler.project.loadInlineData(backend_data)

I have a bunch of events set to the same resource.
I would like the scheduling engine to automatically assign start date of each events(programmatically), prenventing overlap.

I tried setting the startDate of each events to null, but it won't render anything.
I tried setting the startDate of each events to the same date, but then the scheduler just stack them on the same date, even if allowOverlap is false.

Note that there is no depencies between the events on the same resource, those are independant task but it needs to avoid overlapping.

Example model data:
A work order has a list of operations with configured depencies.
The operations are the events, and they are assigned to a resource (a machine that can perform the operation).

WorkOrder1: Oper1 -> Oper2 -> Oper3
WorkOrder2: Oper1 -> Oper2 -> Oper3
WorkOrder3: Oper1 -> Oper2 -> Oper3
---

Now imagine having hundreds of work orders.
I'd like to load them all in the scheduler, and then it would schedule start/end date of each work order's operation, without creating overlap between the different work orders. The order in which it would 'append' each work order could be based on a priority field.

Is that possible ?


Post by alex.l »

Hi guillaume.morin,

The behaviour you described is a job of dependencies. All you need is to add dependencies to start-to-finish via events, so they will be auto-scheduled one by one as you described.
May I know why do you avoid of using it?

You can specify constraints to your tasks, but you'll be needed to specify exact dates for that.

We have a ticket for that feature here btw https://github.com/bryntum/support/issues/3218

All the best,
Alex


Post by guillaume.morin »

Hello Alex,

I am using dependencies for events of a particular Work Order, ex:
WorkOrder1: Oper1 -> Oper2 -> Oper3
In this case WorkOrder1 has 3 events, Oper2 depends on finish of Oper1, and Oper3 depends on finish of Oper2.

However there is no dependencies between different Work Orders, the only constraint is that it should take the next available timeslot on the resource without creating overlap.

This is the most basic logic of a production schedule we are trying to build, so I'm quite baffled the brytum engine doesn't even respect the allowOverlap=false setting when calculating an inital schedule.


Post by guillaume.morin »

Also, I noticed that while I manually drag events while allowOverlap=false, it is not respected for successors, the engine won't push back successors further to prevent overlap with other non-dependent events on the same resource.

https://www.awesomescreenshot.com/video/15631440?key=96e5829afd4598cd63da93470c09c4b5


Post by arcady »

Hello,
allowOverlap config is made for basic Scheduler and works only on UI level preventing user from dragging an event to certain periods.
But in Scheduler Pro the Engine calculates dates eventually on the data level. So while the dragged event overlapping is checked by the feature on UI level its successor dates are calculated by the Engine which does not take the config into account.
As Alex already said we have a ticket on resource leveling feature in the Engine that should automatically balance resource loading and schedule events accordingly.

The feature is not implemented yet. If you need it badly you can try implementing it yourself.
Here is some draft code that does basic events ordering

async function orderResourceEvents(resource) {
    // copy resource events to a new array
    const events = [...resource.events];

    // sort the array to order events by their dates
    events.sort((a, b) => {
        return a.startDate > b.startDate ? 1
            : a.startDate < b.startDate ? -1
                : a.endDate > b.endDate ? 1
                    : a.endDate < b.endDate ? -1 : 0;
    });

    let event = events.shift();
    let { endDate } = event;

    while ((event = events.shift())) {
        // if the event overlaps last one - move it
        if (event.startDate < endDate) {
            await event.setStartDate(endDate);
        }

        ({ endDate } = event);
    }
}

Post by guillaume.morin »

Oh well, thanks for that, but this doesn't consider working calendars.
I must say I am quite disapointed, I had higher expectation from the scheduling engine...
A real resource-constrained task scheduler, something along the line of https://github.com/tpaviot/ProcessScheduler
If you can take a look at the documentation of this library, is this the kind of features where you heading at with your tool ?


Post by arcady »

Why do you think this does not consider working calendars? It actually does.


Post by guillaume.morin »

arcady wrote: Thu Mar 16, 2023 2:47 pm

Why do you think this does not consider working calendars? It actually does.

Oh sorry, I stand corrected :-)


Post by arcady »

If you can take a look at the documentation of this library, is this the kind of features where you heading at with your tool ?

We don't aim that library as our goal. I actually had no idea it existed. I'll check its API but can't tell if there is something we'd like to see in our code.
Anyway as I already wrote the feature you request is called resource leveling and we have a ticket for it. So some day it's going to be implemented but it's not yet.


Post Reply