 Welcome to another OptaPlaner video. In this video, I'm going to show you how to optimize an employee shift roster in the cloud. So if you're working with employees that work in any kind of early, late or night shifts, such as in hospitals, ample assembly lines, call centers and so forth, stay tuned. I've been solving these kinds of use cases for years, both in small cases in the open source community as well as for Big Red Hat customers. Solving an employee rostering problem is not an easy task and I'll show you why. And on top of that, I'll also show you how to handle if somebody calls in sick. So let's get started. Okay, so here we can see we have a number of skills defined for this particular department. So we have an electrical skill and we have a mechanical skill as you can see. So now let's add a third skill, let's say call it ICT and let's add that skill. You can see we now have three skills. This entire application is written in Java and you can download the source code and play with it to actually, for example, expand the ability of a skill. So you might say we're also going to rate a skill and that would then be an extra column in here where you would define, for example, I have a very expert level in the electrical skill or I just have a basic level of the electrical skill. Then we can, of course, take it into account in the constraints later on. But in this particular case, it's quite simple, we just have these three skills. Okay, so let's take a look at the spots. So the spots are in this particular case, we're looking at an assembly line and we're going to build a car. So we're going to build these kinds of cars. We need to have somebody working at the battery spot to put in the battery in the car in the assembly line. We need somebody to put on the bumpers. Of course, the chassis goes first, the doors, the engine and so forth. When all of these parts are done from the assembly line, we can actually build our cars and the assembly line never has to stop. And this is, of course, what we want to do. We want to make sure that the assembly line never ever stops. It always keeps running. Okay, so for each of these, we have a required skill. For example, to install the battery, you need to have the electrical skill. So as we can now do, we can add an extra assembly line there with the ICT. And we can, for example, say, install the GPS, right? So the GPS installation, where you need to have ICT skills. So let's add that. So I've just added that, as you can see. And it's on the next page. No, it's from the first page over here. GPS installation, where we need the ICT skill. Great. Now we have a number of employees. Of course, in our company, such as here in our employees, Amy Cole, who has the electrical and mechanical skill, Amy Fox, who just has a mechanical skill and so forth. So you can see any employee might have one or multiple skills. Again, we can add somebody. Let's add somebody. Let's call him or let's call her Zoe with the Z. And let's give her the skill. What is it? ICT, I guess. Let's go down a little bit to the ICT skill. Here we go. And you can now see on page four, we have Zoe with the ICT skill. Great. Now let's see when we want people to work. So we have a spot roster here. And it gives us, for each of the different spots, gives us when we want people to work there. So for example, for the battery spot, and at every shift, we need one person there. So when do we have three shifts a day? For example, the Wednesday, we have a morning shift starting at 6 a.m. And then we have an afternoon shift starting at 2 a.m. Then we have a night shift starting at 10 a.m. But let's say we don't do sunroofs during the night. So let's take away this thing here. We don't do those Wednesday night and Thursday night. And to install a chassis, that's not simple. That's very heavy. We actually need, at least during the day, we need two persons to do that. So let's add a few shifts to actually have two persons to do that during the day, as you can see. OK, great. And of course, the GPS installation needs to happen. But we don't have many cars with GPS. So let's just say only during those two afternoons, we need somebody with the GPS installation. OK, great. Let's solve that. Let's see if we can solve this. So we start solving this and you can see Optoplanar is now solving it on the back end. And you can see it's assigning employees to these particular shifts. So for example, for the battery, it's now saying that Betfox will probably do that once day morning. Let's give it a little more, a few more seconds to solve it. You can see it's solving now for another 10 seconds. And once that's done, we'll have a final schedule. Although I doubt it will change much. The thing we see here is that all of the shifts are now assigned. This is what we want to do. You can see that Zoe is assigned to the GPS installation. This makes sense because Zoe is the only one with the ICT skill and the GPS installation needs the ICT skill. So you can actually see that Zoe is assigned twice to that GPS installation. OK, now we can actually view this roster from two different sides. You can see this from the point of view of the manager. This is what I'm doing right now. I need somebody on the battery. I need somebody on the bumper on Wednesday morning and also Wednesday afternoon. And of course, this needs to be different persons because one person can only work one shift per day. But from the employees side, you also want to see how do we affect the employees. So let's go to the employee roster where we're seeing the exact same schedule. But we're now seeing it from the side of the employees. So let's look over here. We had Elsa doing Elsa King doing the battery. So let's see what Elsa King is doing during the entire week. So if you go here to Elsa King, you can see that she is doing the battery on Wednesday morning and she is doing the chassis on Thursday afternoon. So we can actually nicely see that none of these employees have more than one shift per day. So for example, Dan King here has the morning shift. Dan Lee has the afternoon shift and so forth, but nobody has more than two shifts per day. On top of that, we also have the guarantee that nobody has two shifts where the between number is less than 10 hours. So with other words in this particular case, you can even see that everybody has at least two empty shifts between two shifts, which is also one of the hard requirements that we've put into the system. And of course, we'll make this configurable. Now, on top of that, you can also see something else, which is interesting here. We actually give the employees the ability to say whether or not they want to work for each of these time slots. So as you can see, we have these kinds of traffic lights here. So let's go to Elsa King again. And you can see she's saying that she wants to work on this Wednesday afternoon. For these other days, she didn't really care, except again this Thursday afternoon, she wanted to work again. And you can see that the system took this into account and said, OK, if you want to work, I'm going to try to satisfy that. It's not always possible because we have to take into account the skill requirements and so forth. First, we need to make sure that all the shifts are being assigned. That's our number one priority. But as a number two priority, we try to make our employees as happy as possible. And we try to give them the shifts that they want and we try to avoid giving them any shifts that they don't want. So for example, you can see that then King did not want to work on Wednesday night. So it's yellow. He didn't want to work there. So we didn't. On top of that, we can even ban somebody from certain dates. For example, if they are on PTO, on vacation or something like that, or on surgery, we can even say we make it a hard constraint that they get assigned on that day. So for example, let's say, as I said earlier, what happens if somebody calls in sick? How do we solve that? So let's suppose that Dan Jones calls in sick. OK, so he's not available for the next, let's say, for these time slots because he's sick. So let's see what happens right now. You can see that this is bad. Yes, we signed him to do to install the radiator, but he's sick, so he won't be able to do that. So let's solve that. And as you can see, as we're solving this, and as it refreshes, that we should now see that Dan is not getting any shifts anymore at that time. So you can see that the system made sure that this doesn't happen. If you give it a little bit time, you get a better and better schedule, of course. This is, of course, if you know that Dan is going to be sick sometime in advance, for example, if he's surging and so forth. If you do it on the moment itself, it can actually add an extra rule to make sure that we do fix the schedule. We do make sure that Dan does not get any shifts, but we try to impact the rest of the schedule as little as possible. That's also pretty straightforward to add. So that's a non-disruptive re-planning, right? OK, so this looks like a good employee shift roster. Let's just go, OK. And if you can see through all the pages, you can see we try to assign them to the green ones. We never assign them to the yellow order, the red ones. But of course, if there's not enough places to give people, to assign people to the yellow ones, to not assign them to the yellow ones, we will start assigning them to the yellow ones, too. OK. Now, this is the UI for this implementation. And you can actually download this entire source code and then start playing with it and start altering it. So it's actually over here. This is the source code. It's up to shift employee rostering. We might move it into the key group repository, but here it's sitting for now. And you can go into the code, start making changes. So for example, one thing you can do is you can actually go into the score constraints, right? If you're familiar with Java. And you can actually, so you can find all of the hard and soft constraints here. So for example, we have the rule that we need a required skill for a shift. You have the rule that an unavailable time slot for an employee should not be assigned. You have the rule for at most one shift assignment per day per employee. You have the hard rule, no two shifts within two hours of each other and so forth. You can start playing with this. So you can change this, for example, to nine hours if you want, or you can make this configurable, right? That's all possible. Similar thing, we have the soft constraints, so undesired time slots for an employee or desired time slots for an employee. We can all change that and actually customize it to your business-specific needs, right? Okay, and then the next thing we can do is we can deploy this on OpenShift. So here we have this thing running on OpenShift where you can see the opto-plural employee shift rostering. As you can see, it is deployed. We have one pod right now. We're still working on actually horizontal scaling this automatically to multiple pods as needed. So you can do this right. You can open more pods to really have to take the advantage of what horizontal scaling brings us. We're still building improvements in our architecture, of course. And then, of course, this is what I showed earlier. This is when you actually have it running on OpenShift. And, of course, you can make this a much shorter UI URL by if you actually configure a domain name there, of course, right? This is actually running on OpenShift Online, which is the free edition. It's really nice. The only downside, of course, is that the number of resources is limited, the number of CPU power and so forth is limited. So if you really want to take advantage of getting better schedules, it is more interesting to actually run it on a dedicated OpenShift, of course, right? Okay, that's basically this example. One more important thing to show is the REST API. If you're not a big fan of whatever UI implementation we chose, whatever UI technology we chose, or you don't need UI at all, you can actually just use the REST methods, right? So you can write your own UI and use these REST methods or you might not even need UI and just use these REST methods directly. So, for example, you can get the entire, the dejections, of course, and so forth, of the entire roster and so forth. That's it. So let's switch back to the UI. Here we go. Thanks for watching. And if you find this interesting, do take a look at our website, optoplanner.org, and specifically to the Aplary rostering use case, of course, right? An interesting thing to note here is that we've actually done academic tests on this with the academic data sets. And what we saw is that we can actually improve the employee well-being. So when people say, I want to work that day, or I don't want to work that day, those day-off requests and so forth to actually accommodate these more than without using an advanced technology such as optoplanner. And we actually see in our tests in our benchmarks, and you can run these benchmarks yourselves, difference of 53% improvement. So basically, when people, when, for example, nurses in a hospital ask for a day-off, when workers on an assembly line ask for a day-off, we can say, yes, 53% more than without this kind of technology. So this is against human planners or against traditional algorithms and so forth. Okay. Thank you for watching. If you want more information, do take a look at optoplanner.org.