 Welcome to another OptoPlanary example. In this example, we'll be looking at task assigning, where we're going to assign tasks to employees and we're going to take into account skills, affinity, and priority of these tasks, right? So let's take a look here. We have a number of employees you can see here, which are, these are randomly generated. And we have also randomly gave them a number of skills. So for example, the first person has the skills of problem solving, team building, and business storytelling. For the record, for people who recognize the names, the attribution of skills is purely random. This doesn't mean anything. Furthermore, we have a number of tasks. So for example, we have this task over here, which is the shrinking the VAT accounting task. And we can see that the task also has a required skill. So it has the green skill that it needs, which is strategic planning, the dark green skill. You can also see that this task has a priority, which is minor, which is pointing downwards green arrow. And it has a certain customer, which is the paper corp in UK at this point in time. You can see this task has a major priority, has a different skill requirement, risk management, and also has a different customer, as you can see. Some tasks require two skills. For example, this task requires both the skill problem solving team building to be executed by somebody. So let's take a look. So let's say we take this task over here, which requires the orange skill. And you can see if we assign this to the first person who doesn't have that skill, that we're actually breaking hard constraints. Now, so this is not a feasible plan. He cannot do this task. So let's assign it to the second person. You can now see that we do have a feasible plan. What you can also see is that there's an affinity taking part. So because this task has a certain customer, we're going to take a look if that employee who's going to do that task has an affinity with that customer. If he's worked with that customer before. If that's the case, then he will be able to do this task much faster because he knows who to call for that customer if he has problems. And he knows the structure and organization of the customer better. Now, in this particular case, this combination actually, that person does not have an affinity with that customer yet. However, if we give him to somebody else who does have that skill, so for example, this person has that skill, we can see that we now have a better affinity. So as a result, because we have a better affinity, you can see that the icon became yellow instead of red. And as a result, you can also see that the duration of the task is much shorter. And of course, we're going to try to match the affinity as much as possible because that means that the tasks can be done as quickly as possible, right? So, okay. Now, let's take a look what happens when we start scheduling this. So we solve this, right? What you can see is, let me just stop it. What you can see is first of all, that's all the hard constraints are met. So for example, this task requires the light green and the yellow skill and this person has both of these skills so he can do that task, right? And that counts for all the tasks. You can see, for example, that this person doesn't get any tasks. That's because there are no, there's not a single task currently that needs any of these two skills without actually needing another skill, right? That's just the way the random data sets was generated. On top of that, each task has the affinity which we spoke about earlier. You can see the green ones are really nicely matching. That means that we are taking the minimal amount of time to do them. While we can also see a number of red ones where we'd rather have somebody else doing them but it's somebody with a higher affinity for that particular customer. But sometimes there is simply nobody who has that affinity which is definitely the case for some of these customers, right? For some of these tasks. So, and then last but not least, we have the priority which we need to take into account. So we can see, for example, this task has a critical priority, right? It has a double red arrow. This task has a major priority. This task has a minor priority. And you can nicely see that this person is first doing the critical task, then the major task and then his minor tasks. This is what we want to see, of course. We want to see the higher priority tasks done first. Now, to give you an idea on how it actually works, let's take a look at the data, right? At the domain, right? So we have an employee which has a number of skills and which has an affinity with each customer which can be none low, medium, or high, right? And then we have a task which requires a number of skills which has a customer. And of course, that customer will affect how fast the employee is able to perform that task. So it impacts the task duration. And also we have a priority major, minor, or critical, right? So on top of that, we also have constraints. So not on top of that, but these actually, that's the domain, but how do we trans this into business constraints? What are we optimizing? Well, first of all, we have a hard constraint with that skill, right? So that every skill that is required is actually that there is actually, the employee assigned to that task actually has those skills. The second thing is that we want the first soft constraint and this is way that higher than any of the others. It's actually not weighted, it's the higher score level. We're actually using five score levels in this particular case. And this one is that we want to do the critical priority tasks first. And we're looking at the end date of the critical priority tasks, of course, so we can take into account the duration which might be affected by the affinity. The second thing that we look at in the soft constraint, so our next score level that we look at is the minimum makespan. So that basically means, if you look at these, that we want to minimize the makespan of the entire schedule, but we're going to do better than that. We're going to minimize the most stressed employee which is apparently this person in this data set. And then we're going to minimize the second one which is this person, and then the third one which is then and so forth, right? So we're going to do this as fairly as possible, starting with the person who's worst off in the schedule who has most tasks in this particular schedule. And this will also minimize the entire makespan which is good for the company, right? So this gives us some fairness. And you can see this is actually more important than doing the major priority tasks first, right? So the business told us in this particular case that they found this more important. If you want to do this differently, that's quite simple. You just switch two lines of code and then you'll have a different behavior, right? So after that, we look at those major priority tasks and last and also least we'll look at the minor priority tasks, try to optimize those, right? And then we basically get the schedule. Now, that's quite interesting. Now let's see what happens when we start applying real time playing or continuous planning, right? So what I'm going to do is I'm going to, by an off thread, I'm going to produce more tasks into the schedule. So I'm going to click the produce button and every now and then this will create a few tasks which are added to the schedule. You can see those tasks showing up here, right? And every few seconds we'll get some more tasks that we need to assign. Look, there are more and more tasks, right? Now, what we're going to do is we're going to start solving this, right? And we get this schedule. And then we're also going to start consuming tasks. So let's start consuming tasks. And this basically means that as time goes by, somebody is actually fulfilling these tasks, right? Let me stop the producing of tasks for a bit. So what you can now see is as time goes by, we actually are locking certain tasks into place, right? You can see that, right? So as time goes by, we are more and more locking tasks into place. Let me show that again and I'll start from scratch again. So I'm going to start solving again and I'm immediately going to do consuming and producing. So you can actually see the consumer catch up to the producer and that will be given an interesting effect. So we start solving, we start consuming and we start producing, right? You can see that these tasks are being done. Some of these are finished, some are in progress. And you can also see that new tasks are being produced over here. So while they are being added there, right? And you can see that they're being added to the fund. Unfortunately, because of the dataset, there is no task type that actually matches this person. So we'll actually never get a task. That's a bit of a pity here. What we can also do is we can stop producing for some time and actually let the consumer run past the point where all of the people are working, right? So let's do that. And after that, we'll start producing again. So, okay. So right now there's only three guys working anymore. So let's start producing again. And what happens is when these new tasks come in, they are magically assigned and this person starts working again, right? So just to show that we can handle this. And again, so these are two separate threads that produce these events. This is separate from the solver thread which is actually solving them as they come in in real time. Okay. So thank you for watching this presentation. And if you have any questions, you just go to the oploplaner.org website and see what you can download this example there and try it out.