הדוגמה הזו מתבססת על הדוגמה לתזמון אחות לצורך בניית מודלים. תגמול קבוע ופיצוי על בסיס קבוע, בכפוף לדרישת התקציב. מלבד מגבלות תזמון לאחיות, יש תקציב של 10,000 $ל-4 ימים באופק התכנון. כל האחיות מקבלים תעריף בסיס שעתי של 50 $לשעה, ויש דיפרנציאל משמרת של 10 $לשעה למשמרות החל מ-19 שעות. כל שעה שעובד אחרי 40 שעות, מקבל תשלום גבוה פי 1.5 מתעריף הבסיס השעתי הממוצע (כלומר (200 ש"ח ועוד 240 ש"ח)/2=200 ש"ח).
תגמול קבוע ושכר נוסף
התעריף הבסיסי השעתי, הפרשי הסטייה ומכפילים לאורך זמן הם
שמיוצג באמצעות השדה hourlyContract
ב-employee. תוך שימוש
בחוזה לפי שעה, baseHourlyRate
וגם
hourlyRateShiftDifferentials
לבנות מודל של התגמול על בסיס רגיל (לא הארכה)
בעבודה. הערכים האלה משמשים גם להערכה של תעריף בסיס ממוצע לשעה
פיצוי על שעות נוספות כשיסופקו overtimePeriods
. בדרך כלל מדובר בתוספת זמן
תקופה תואמת לשבוע, ואפשר לציין כמה תקופות זמן נוספות, כל עוד
הם לא חופפים. החוזה השעתי של האחות הראשונה (אדם), הוא
מיוצגת בתור:
{
"employees": [{
"id": "Adam",
"roleIds": ["Registered Nurse"],
...
scheduling constraints
...
"hourlyContract": {
"baseHourlyRate": 50,
"hourlyRateShiftDifferentials": {
"2023-05-01 19hr": 10,
"2023-05-02 19hr": 10,
"2023-05-03 19hr": 10,
"2023-05-04 19hr": 10
},
"overtimePeriods": [
{
"overtimeMultiplier": 1.5,
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5
},
"maximumRegularHours": 40
}
]
}
}
}
דוגמה לכל ארבעת העובדים והחוזה השעתי שלהם
{
"employees": [
{
"id": "Adam",
"roleIds": [
"Registered Nurse"
],
"schedulingConstraints": [
{
"priority": "PRIORITY_HIGH",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"minimumRestMinutes": 720
},
{
"priority": "PRIORITY_MEDIUM",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"maximumMinutes": 2160
}
],
"hourlyContract": {
"baseHourlyRate": 50,
"hourlyRateShiftDifferentials": {
"2023-05-01 19h": 10,
"2023-05-02 19h": 10,
"2023-05-03 19h": 10,
"2023-05-04 19h": 10
},
"overtimePeriods": [
{
"overtimeMultiplier": 1.5,
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5
},
"maximumRegularHours": 40
}
]
}
},
{
"id": "Grace",
"roleIds": [
"Registered Nurse"
],
"schedulingConstraints": [
{
"priority": "PRIORITY_HIGH",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"minimumRestMinutes": 720
},
{
"priority": "PRIORITY_MEDIUM",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"maximumMinutes": 2160
}
],
"hourlyContract": {
"baseHourlyRate": 50,
"hourlyRateShiftDifferentials": {
"2023-05-01 19h": 10,
"2023-05-02 19h": 10,
"2023-05-03 19h": 10,
"2023-05-04 19h": 10
},
"overtimePeriods": [
{
"overtimeMultiplier": 1.5,
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5
},
"maximumRegularHours": 40
}
]
}
},
{
"id": "James",
"roleIds": [
"Registered Nurse"
],
"schedulingConstraints": [
{
"priority": "PRIORITY_HIGH",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"minimumRestMinutes": 720
},
{
"priority": "PRIORITY_MEDIUM",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"maximumMinutes": 2160
}
],
"hourlyContract": {
"baseHourlyRate": 50,
"hourlyRateShiftDifferentials": {
"2023-05-01 19h": 10,
"2023-05-02 19h": 10,
"2023-05-03 19h": 10,
"2023-05-04 19h": 10
},
"overtimePeriods": [
{
"overtimeMultiplier": 1.5,
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5
},
"maximumRegularHours": 40
}
]
}
},
{
"id": "Alonso",
"roleIds": [
"Registered Nurse"
],
"schedulingConstraints": [
{
"priority": "PRIORITY_HIGH",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"minimumRestMinutes": 720
},
{
"priority": "PRIORITY_MEDIUM",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"maximumMinutes": 2160
}
],
"hourlyContract": {
"baseHourlyRate": 50,
"hourlyRateShiftDifferentials": {
"2023-05-01 19h": 10,
"2023-05-02 19h": 10,
"2023-05-03 19h": 10,
"2023-05-04 19h": 10
},
"overtimePeriods": [
{
"overtimeMultiplier": 1.5,
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5
},
"maximumRegularHours": 40
}
]
}
}
]
}
דרישת תקציב
תקציב כולל של $10,000 מיוצג באמצעות דרישת תקציב. שעות ההתחלה והסיום הן אופציונלי, ואם כן, רק משתנים ותקופות זמן קבועות במהלך חלון הזמן הזה נלקחות בחשבון במסגרת מגבלת התקציב הזו. את הייצוג המתאים אפשר לעדכן את האחות הראשונה (אדם) כך:
{
"totalBudget": 10000,
"priority": "PRIORITY_HIGH"
}
דוגמה לבקשה מלאה
{
"employees": [
{
"id": "Adam",
"roleIds": [
"Registered Nurse"
],
"schedulingConstraints": [
{
"priority": "PRIORITY_HIGH",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"minimumRestMinutes": 720
},
{
"priority": "PRIORITY_MEDIUM",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"maximumMinutes": 2160
}
],
"hourlyContract": {
"baseHourlyRate": 50,
"hourlyRateShiftDifferentials": {
"2023-05-01 19h": 10,
"2023-05-02 19h": 10,
"2023-05-03 19h": 10,
"2023-05-04 19h": 10
},
"overtimePeriods": [
{
"overtimeMultiplier": 1.5,
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5
},
"maximumRegularHours": 40
}
]
}
},
{
"id": "Grace",
"roleIds": [
"Registered Nurse"
],
"schedulingConstraints": [
{
"priority": "PRIORITY_HIGH",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"minimumRestMinutes": 720
},
{
"priority": "PRIORITY_MEDIUM",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"maximumMinutes": 2160
}
],
"hourlyContract": {
"baseHourlyRate": 50,
"hourlyRateShiftDifferentials": {
"2023-05-01 19h": 10,
"2023-05-02 19h": 10,
"2023-05-03 19h": 10,
"2023-05-04 19h": 10
},
"overtimePeriods": [
{
"overtimeMultiplier": 1.5,
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5
},
"maximumRegularHours": 40
}
]
}
},
{
"id": "James",
"roleIds": [
"Registered Nurse"
],
"schedulingConstraints": [
{
"priority": "PRIORITY_HIGH",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"minimumRestMinutes": 720
},
{
"priority": "PRIORITY_MEDIUM",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"maximumMinutes": 2160
}
],
"hourlyContract": {
"baseHourlyRate": 50,
"hourlyRateShiftDifferentials": {
"2023-05-01 19h": 10,
"2023-05-02 19h": 10,
"2023-05-03 19h": 10,
"2023-05-04 19h": 10
},
"overtimePeriods": [
{
"overtimeMultiplier": 1.5,
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5
},
"maximumRegularHours": 40
}
]
}
},
{
"id": "Alonso",
"roleIds": [
"Registered Nurse"
],
"schedulingConstraints": [
{
"priority": "PRIORITY_HIGH",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"minimumRestMinutes": 720
},
{
"priority": "PRIORITY_MEDIUM",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"maximumMinutes": 2160
}
],
"hourlyContract": {
"baseHourlyRate": 50,
"hourlyRateShiftDifferentials": {
"2023-05-01 19h": 10,
"2023-05-02 19h": 10,
"2023-05-03 19h": 10,
"2023-05-04 19h": 10
},
"overtimePeriods": [
{
"overtimeMultiplier": 1.5,
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5
},
"maximumRegularHours": 40
}
]
}
}
],
"shifts": [
{
"id": "2023-05-01 7h",
"locationId": "department",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 19
}
},
{
"id": "2023-05-01 13h",
"locationId": "department",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 13
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 2,
"hours": 1
}
},
{
"id": "2023-05-01 19h",
"locationId": "department",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 19
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 2,
"hours": 7
}
},
{
"id": "2023-05-02 7h",
"locationId": "department",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 2,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 2,
"hours": 19
}
},
{
"id": "2023-05-02 13h",
"locationId": "department",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 2,
"hours": 13
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 3,
"hours": 1
}
},
{
"id": "2023-05-02 19h",
"locationId": "department",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 2,
"hours": 19
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 3,
"hours": 7
}
},
{
"id": "2023-05-03 7h",
"locationId": "department",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 3,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 3,
"hours": 19
}
},
{
"id": "2023-05-03 13h",
"locationId": "department",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 3,
"hours": 13
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 4,
"hours": 1
}
},
{
"id": "2023-05-03 19h",
"locationId": "department",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 3,
"hours": 19
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 4,
"hours": 7
}
},
{
"id": "2023-05-04 7h",
"locationId": "department",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 4,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 4,
"hours": 19
}
},
{
"id": "2023-05-04 13h",
"locationId": "department",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 4,
"hours": 13
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 1
}
},
{
"id": "2023-05-04 19h",
"locationId": "department",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 4,
"hours": 19
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
}
}
],
"coverageRequirements": [
{
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 7
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 7
},
"locationId": "department",
"roleRequirements": [
{
"roleId": "Registered Nurse",
"targetEmployeeCount": 2,
"priority": "PRIORITY_MANDATORY"
}
]
}
],
"roleIds": [
"Registered Nurse"
],
"locationIds": [
"department"
],
"budgetRequirements": [
{
"totalBudget": 10000,
"priority": "PRIORITY_HIGH"
}
]
}
דוגמה לתשובה
התגובה של הפותר מכילה את הקצאת האחיות למשמרות הסטטוס של תהליך האופטימיזציה. לדוגמה, את התנודות שהוקצו העובד הראשון מוחזר בתור:
{
"solutionStatus": "OPTIMAL",
"shiftAssignments": [
{
"employeeId": "Adam",
"shiftId": "2023-05-01 7hr",
"roleId": "Registered Nurse"
},
{
"employeeId": "Adam",
"shiftId": "2023-05-02 7hr",
"roleId": "Registered Nurse"
},
{
"employeeId": "Adam",
"shiftId": "2023-05-03 7hr",
"roleId": "Registered Nurse"
},
{
"employeeId": "Adam",
"shiftId": "2023-05-04 7hr",
"roleId": "Registered Nurse"
},
... ]
}
דוגמה לתשובה מלאה
{
"solutionStatus": "OPTIMAL",
"shiftAssignments": [
{
"employeeId": "Adam",
"shiftId": "2023-05-01 7h",
"roleId": "Registered Nurse"
},
{
"employeeId": "Adam",
"shiftId": "2023-05-02 7h",
"roleId": "Registered Nurse"
},
{
"employeeId": "Adam",
"shiftId": "2023-05-03 7h",
"roleId": "Registered Nurse"
},
{
"employeeId": "Adam",
"shiftId": "2023-05-04 7h",
"roleId": "Registered Nurse"
},
{
"employeeId": "Grace",
"shiftId": "2023-05-01 19h",
"roleId": "Registered Nurse"
},
{
"employeeId": "Grace",
"shiftId": "2023-05-02 19h",
"roleId": "Registered Nurse"
},
{
"employeeId": "Grace",
"shiftId": "2023-05-03 19h",
"roleId": "Registered Nurse"
},
{
"employeeId": "Grace",
"shiftId": "2023-05-04 19h",
"roleId": "Registered Nurse"
},
{
"employeeId": "James",
"shiftId": "2023-05-01 19h",
"roleId": "Registered Nurse"
},
{
"employeeId": "James",
"shiftId": "2023-05-02 19h",
"roleId": "Registered Nurse"
},
{
"employeeId": "James",
"shiftId": "2023-05-03 19h",
"roleId": "Registered Nurse"
},
{
"employeeId": "James",
"shiftId": "2023-05-04 19h",
"roleId": "Registered Nurse"
},
{
"employeeId": "We",
"shiftId": "2023-05-01 7h",
"roleId": "Registered Nurse"
},
{
"employeeId": "We",
"shiftId": "2023-05-02 7h",
"roleId": "Registered Nurse"
},
{
"employeeId": "We",
"shiftId": "2023-05-03 7h",
"roleId": "Registered Nurse"
},
{
"employeeId": "We",
"shiftId": "2023-05-04 7h",
"roleId": "Registered Nurse"
}
]
}