این مثالها بر روی نمونه برنامهریزی پرستار برای مدلسازی غرامت منظم و اضافه کار، مشروط به نیاز بودجه، ساخته میشوند. علاوه بر محدودیت های برنامه ریزی برای پرستاران، یک بودجه 10000 دلاری برای افق برنامه ریزی 4 روزه وجود دارد. به همه پرستاران نرخ پایه ساعتی 50 دلار در ساعت پرداخت می شود و برای شیفت هایی که از ساعت 19 شروع می شود، تفاوت شیفت ساعتی 10 دلار در ساعت وجود دارد. هر ساعت کار پس از 40 ساعت 1.5 برابر متوسط نرخ پایه ساعتی (یعنی (50 دلار + 60 دلار)/2 = 55 دلار پرداخت می شود.
غرامت منظم و اضافه کار
نرخ پایه ساعتی، تفاوت های شیفت و ضریب اضافه کاری با قسمت hourlyContract
در کارمند نشان داده شده است. در یک قرارداد ساعتی ، 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
}
]
}
}
]
}
نیاز بودجه
کل بودجه 10000 دلاری با نیاز بودجه نشان داده شده است. زمان شروع و پایان اختیاری است و اگر داده شود، فقط نوبتها و دورههای اضافه کاری در این پنجره زمانی برای این محدودیت بودجه در نظر گرفته میشود. نمایندگی مربوطه برای اولین پرستار (آدام) می تواند به روز شود:
{
"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"
}
]
}