Slide 1

Slide 1 text

Domain models Domain models and and design patterns design patterns by Geoffrey De Smet OptaPlanner lead

Slide 2

Slide 2 text

Announcements Announcements OptaPlanner Quick Starts repository github.com/kiegroup/optaplanner-quickstarts (https://github.com/kiegroup/optaplanner- quickstarts)

Slide 3

Slide 3 text

Announcements Announcements OptaPlanner Quick Starts repository Quick Starts Showcase github.com/kiegroup/optaplanner-quickstarts (https://github.com/kiegroup/optaplanner- quickstarts)

Slide 4

Slide 4 text

Announcements Announcements OptaPlanner Quick Starts repository Quick Starts Showcase DEMO github.com/kiegroup/optaplanner-quickstarts (https://github.com/kiegroup/optaplanner- quickstarts)

Slide 5

Slide 5 text

Why is modeling hard? (*) Why is modeling hard? (*)

Slide 6

Slide 6 text

Why is modeling hard? (*) Why is modeling hard? (*) (*) at least the rst few times

Slide 7

Slide 7 text

Given a text like this... School timetabling School timetabling Optimize a school timetable of lessons to assign teachers and students in the best room at the best time.

Slide 8

Slide 8 text

Given a text like this... School timetabling School timetabling Optimize a school timetable of lessons to assign teachers and students in the best room at the best time. Come up with a model like this...

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Let's take it step by step... School timetabling School timetabling Optimize a school timetable of lessons to assign teachers and students in the best room at the best time.

Slide 11

Slide 11 text

What changes during planning? What changes during planning?

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

DEMO DEMO

Slide 16

Slide 16 text

What changes during planning? What changes during planning? The assigned timeslot of each lesson The assigned room of each lesson

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

What are the constraints? What are the constraints?

Slide 19

Slide 19 text

What are the constraints? What are the constraints? 1. Which hard constraints are build-in in our model?

Slide 20

Slide 20 text

What are the constraints? What are the constraints? 1. Which hard constraints are build-in in our model? 2. Which constraints affect our planning variables?

Slide 21

Slide 21 text

Constraints inventory Constraints inventory Each lesson must have one timeslot Each lesson must have one room No lessons in the same room together No teacher with lessons at the same time Students must be able to attend all lessons Use each teacher's time ef ciently Give students variety in subjects

Slide 22

Slide 22 text

Constraints inventory Constraints inventory Each lesson must have one timeslot (hard) Each lesson must have one room No lessons in the same room together No teacher with lessons at the same time Students must be able to attend all lessons Use each teacher's time ef ciently Give students variety in subjects

Slide 23

Slide 23 text

Constraints inventory Constraints inventory Each lesson must have one timeslot (hard) Each lesson must have one room (hard) No lessons in the same room together No teacher with lessons at the same time Students must be able to attend all lessons Use each teacher's time ef ciently Give students variety in subjects

Slide 24

Slide 24 text

Constraints inventory Constraints inventory Each lesson must have one timeslot (hard) Each lesson must have one room (hard) No lessons in the same room together (hard) No teacher with lessons at the same time Students must be able to attend all lessons Use each teacher's time ef ciently Give students variety in subjects

Slide 25

Slide 25 text

Constraints inventory Constraints inventory Each lesson must have one timeslot (hard) Each lesson must have one room (hard) No lessons in the same room together (hard) No teacher with lessons at the same time (hard) Students must be able to attend all lessons Use each teacher's time ef ciently Give students variety in subjects

Slide 26

Slide 26 text

Constraints inventory Constraints inventory Each lesson must have one timeslot (hard) Each lesson must have one room (hard) No lessons in the same room together (hard) No teacher with lessons at the same time (hard) Students must be able to attend all lessons (hard) Use each teacher's time ef ciently Give students variety in subjects

Slide 27

Slide 27 text

Constraints inventory Constraints inventory Each lesson must have one timeslot (hard) Each lesson must have one room (hard) No lessons in the same room together (hard) No teacher with lessons at the same time (hard) Students must be able to attend all lessons (hard) Use each teacher's time ef ciently (soft) Give students variety in subjects

Slide 28

Slide 28 text

Constraints inventory Constraints inventory Each lesson must have one timeslot (hard) Each lesson must have one room (hard) No lessons in the same room together (hard) No teacher with lessons at the same time (hard) Students must be able to attend all lessons (hard) Use each teacher's time ef ciently (soft) Give students variety in subjects (soft)

Slide 29

Slide 29 text

Which hard constraints are build-in Which hard constraints are build-in in our model? in our model?

Slide 30

Slide 30 text

Which hard constraints are build-in Which hard constraints are build-in in our model? in our model? Each lesson must have one timeslot (build-in hard)

Slide 31

Slide 31 text

Which hard constraints are build-in Which hard constraints are build-in in our model? in our model? Each lesson must have one timeslot (build-in hard) Each lesson must have one room (build-in hard)

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Hard constraints (not build-in) Hard constraints (not build-in) Room con ict: No 2 lessons in the same room at the same time Teacher con ict: No 2 lessons for the same teacher at the same time Student con ict: No 2 lessons for the same student group at the same time

Slide 34

Slide 34 text

Hard constraints (not build-in) Hard constraints (not build-in) Room con ict: No 2 lessons in the same room at the same time Teacher con ict: No 2 lessons for the same teacher at the same time Student con ict: No 2 lessons for the same student group at the same time Formalize your constraints.

Slide 35

Slide 35 text

Soft constraints Soft constraints Teacher time ef ciently: No gap between teacher lessons Subject variety: No sequential lessons on the same subject

Slide 36

Slide 36 text

Some constraints affect the Some constraints affect the planning variables. planning variables. Most don't.

Slide 37

Slide 37 text

Some constraints affect the Some constraints affect the planning variables. planning variables. Most don't. Learn to tell them apart: Do these planning variables hinder any of the constraints?

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Constraints that Constraints that don't affect the model don't affect the model Skill requirements and af nity Availability and unavailability Fairness and load balancing Time windows, ... (many more)

Slide 40

Slide 40 text

Constraints that Constraints that don't affect the model don't affect the model Skill requirements and af nity Availability and unavailability Fairness and load balancing Time windows, ... (many more) Most constraints do not affect the model!

Slide 41

Slide 41 text

The PlanningSolution is easy The PlanningSolution is easy

Slide 42

Slide 42 text

Modeling tips Modeling tips

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

The PlanningSolution is easy The PlanningSolution is easy to determine to determine

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

Exercises Exercises

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

Assigning to time Assigning to time

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

No content

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

Shadow variables Shadow variables

Slide 80

Slide 80 text

No content

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

No content

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

Exercises Exercises

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

No content

Slide 95

Slide 95 text

No content

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

Getting started Getting started

Slide 98

Slide 98 text

Quick starts Quick starts github.com/kiegroup/optaplanner-quickstarts (https://github.com/kiegroup/optaplanner- quickstarts) $ git clone git@github.com:kiegroup/optaplanner-quickstarts.git ... $ cd optaplanner-quickstarts $ cd quarkus-school-timetabling $ mvn quarkus:dev ...

Slide 99

Slide 99 text

@GeoffreyDeSmet Q & A Q & A Homepage Slides User guide Feedback www.optaplanner.org (https://www.optapl www.optaplanner.org/learn/slides.html (https://www.optaplanner.org/learn/slides www.optaplanner.org/learn/documentatio (https://www.optaplanner.org/learn/docum @GeoffreyDeSmet (https://twitter.com/GeoffreyDeSmet)