考慮建立客服中心,由此建立輪班,確保 滿足員工需求客服中心提供 24 小時全年無休的運作, 所需的員工人數會隨著時間變動。客服中心聘僱 全職和兼職員工
全職員工執行 9 小時的換班,休息 1 小時,休息 4 或 5 小時 他們開始換班後,可以在上午 5 點到 5 點之間 中午 12 點。兼職員工在進行 4 小時的換班時,在 15 分鐘的休息時間 便可隨時開始輪班。兩者皆有 任何可能的位移開始時間都會以 15 分鐘為單位。
客服中心有興趣制定 業務未來兩天內,因為最多有 20 個全職工作 分別有 40 名員工和 40 名兼職員工
為全職和兼職員工改變範本
決定有效輪班的規則可以使用 shift 範本在 Shift 範本中,可以使用中斷概念表示 搭配事件範本。例如全職的轉變範本 員工輪班表示:
{
"id": "full-time",
"earliestStartTime": {
"hours": 5
},
"latestStartTime": {
"hours": 12
},
"durationMinutes": 540,
"startTimeIncrementMinutes": 15,
"eventTemplates": [
{
"id": "full-time-break",
"minimumMinutesAfterShiftStart": 240,
"maximumMinutesAfterShiftStart": 300,
"durationMinutes": 60,
"startTimeIncrementMinutes": 60
}
],
"maximumEmployeeCount": 20
}
同樣地,兼職員工輪班的轉變範本是以下列方式表示:
{
"id": "part-time",
"earliestStartTime": {},
"latestStartTime": {
"hours": 23,
"minutes": 59
},
"durationMinutes": 240,
"startTimeIncrementMinutes": 15,
"eventTemplates": [
{
"id": "part-time-break",
"minimumMinutesAfterShiftStart": 120,
"maximumMinutesAfterShiftStart": 120,
"durationMinutes": 15,
"startTimeIncrementMinutes": 0
}
],
"maximumEmployeeCount": 40
}
員工需求隨時間變化
系統會以 EmployeeDemand
清單代表員工的需求,
其中每項元素的特性是按時間間隔和員工區分
數量。這個範例中,有 4 到 13 名員工的需求在
兩個天數,以下列表示:
{
...
"employeeDemands": [
{
"startDateTime": {
"year": 2024,
"month": 5,
"day": 20
},
"endDateTime": {
"year": 2024,
"month": 5,
"day": 20,
"hours": 12
},
"employeeCount": 8
},
{
"startDateTime": {
"year": 2024,
"month": 5,
"day": 20,
"hours": 12
},
"endDateTime": {
"year": 2024,
"month": 5,
"day": 20,
"hours": 20
},
"employeeCount": 12
},
{
"startDateTime": {
"year": 2024,
"month": 5,
"day": 20,
"hours": 20
},
"endDateTime": {
"year": 2024,
"month": 5,
"day": 21,
"hours": 6
},
"employeeCount": 4
},
{
"startDateTime": {
"year": 2024,
"month": 5,
"day": 21,
"hours": 6
},
"endDateTime": {
"year": 2024,
"month": 5,
"day": 22,
"hours": 0
},
"employeeCount": 13
}
]
}
完整要求的範例
{
"solverConfig": {
"timeLimit": "30s"
},
"shiftTemplates": [
{
"id": "full-time",
"earliestStartTime": {
"hours": 5
},
"latestStartTime": {
"hours": 12
},
"durationMinutes": 540,
"startTimeIncrementMinutes": 15,
"eventTemplates": [
{
"id": "full-time-break",
"minimumMinutesAfterShiftStart": 240,
"maximumMinutesAfterShiftStart": 300,
"durationMinutes": 60,
"startTimeIncrementMinutes": 60
}
],
"maximumEmployeeCount": 20
},
{
"id": "part-time",
"earliestStartTime": {},
"latestStartTime": {
"hours": 23,
"minutes": 59
},
"durationMinutes": 240,
"startTimeIncrementMinutes": 15,
"eventTemplates": [
{
"id": "part-time-break",
"minimumMinutesAfterShiftStart": 120,
"maximumMinutesAfterShiftStart": 120,
"durationMinutes": 15,
"startTimeIncrementMinutes": 0
}
],
"maximumEmployeeCount": 40
}
],
"employeeDemands": [
{
"startDateTime": {
"year": 2024,
"month": 5,
"day": 20
},
"endDateTime": {
"year": 2024,
"month": 5,
"day": 20,
"hours": 12
},
"employeeCount": 8
},
{
"startDateTime": {
"year": 2024,
"month": 5,
"day": 20,
"hours": 12
},
"endDateTime": {
"year": 2024,
"month": 5,
"day": 20,
"hours": 20
},
"employeeCount": 12
},
{
"startDateTime": {
"year": 2024,
"month": 5,
"day": 20,
"hours": 20
},
"endDateTime": {
"year": 2024,
"month": 5,
"day": 21,
"hours": 6
},
"employeeCount": 4
},
{
"startDateTime": {
"year": 2024,
"month": 5,
"day": 21,
"hours": 6
},
"endDateTime": {
"year": 2024,
"month": 5,
"day": 22,
"hours": 0
},
"employeeCount": 13
}
]
}
回應範例
解題工具的回應中列出了員工班表,以及 相應的必要員工人數如果完全涵蓋需求 也會在每次相關回應中列出違規事項 間隔。
以下範例顯示其中一個為 全職員工:
{
"solutionStatus": "SHIFT_GENERATION_SOLVED",
"employeeSchedules": [
{
"shiftTemplateId": "full-time",
"shifts": [
{
"startDateTime": {
"year": 2024,
"month": 5,
"day": 21,
"hours": 7,
"minutes": 30
},
"endDateTime": {
"year": 2024,
"month": 5,
"day": 21,
"hours": 16,
"minutes": 30
},
"events": [
{
"startDateTime": {
"year": 2024,
"month": 5,
"day": 21,
"hours": 12,
"minutes": 30
},
"endDateTime": {
"year": 2024,
"month": 5,
"day": 21,
"hours": 13,
"minutes": 30
},
"eventTemplateId": "full-time-break"
}
]
}
],
"employeeCount": 1
},
...
]
...
}