假設某家餐廳每週都規劃廚房。
餐廳營業時間為週一至週五 12 小時至 23 小時。共有五種
可擔任 Station chef
、Head chef
和 Sous
chef
這三種角色的員工。每次輪班,都必須有兩名員工擔任高優先順序Station
chef
,其中一位員工以中型Sous chef
工作
優先順序。此外,星期二和星期五都必須提供 Head chef
,並加上
中優先順序另一項排程限制是
Liam
名員工,要求在「2023-05-03」(星期三) 工作,但不需要
負責Friday-2023-05-05
轉變
每次輪班都扮演角色
您可以為指定的輪班時間來指定特定角色的涵蓋範圍, 資格規定。例如 問題可能如下所示:
{
"shifts": [
{
"id": "Monday-2023-05-01",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 12
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 23
}
}
]
}
假設上述五次調整包括:Monday-2023-05-01
、Tuesday-2023-05-02
、
Wednesday-2023-05-03
、Thursday-2023-05-04
和 Friday-2023-05-05
,
代表 Station chef
和 Sous chef
角色的涵蓋範圍規定
為:
{
"coverageRequirements": [{
"shiftIds": ["Monday-2023-05-01", "Tuesday-2023-05-02",
"Wednesday-2023-05-03", "Thursday-2023-05-04",
"Friday-2023-05-05"]
"roleRequirements": [{
"roleId": "Station chef",
"targetEmployeeCount": 2,
"priority": "PRIORITY_HIGH"
}, {
"roleId": "Sous chef",
"targetEmployeeCount": 1,
"priority": "PRIORITY_MEDIUM"
}]
}
]
}
如要考量Head chef
的規定,請額外涵蓋
可以指定必要的轉變完整清單
涵蓋範圍規定如下:
{
"coverageRequirements": [{
"shiftIds": ["Monday-2023-05-01", "Tuesday-2023-05-02",
"Wednesday-2023-05-03", "Thursday-2023-05-04",
"Friday-2023-05-05"],
"roleRequirements": [{
"roleId": "Station chef",
"targetEmployeeCount": 2,
"priority": "PRIORITY_HIGH"
}, {
"roleId": "Sous chef",
"targetEmployeeCount": 1,
"priority": "PRIORITY_MEDIUM"
}]
},
{
"shiftIds": ["Tuesday-2023-05-02", "Friday-2023-05-05"],
"roleRequirements": [{
"roleId": "Head chef",
"targetEmployeeCount": 1,
"priority": "PRIORITY_MEDIUM"
}]
}
]
}
員工要求
員工要求會顯示為轉移要求
] 欄位。在本例中,Liam
要求在星期三的位移工作,但
工作。這及其角色
為:
{
"employees": [{
"id": "Liam",
"roleIds": ["Station chef", "Head chef"],
"shiftRequests": [
{
"priority": "PRIORITY_HIGH",
"shiftIds": ["Wednesday-2023-05-03"],
"type": "STATUS_WORK"
},
{
"priority": "PRIORITY_HIGH",
"shiftIds": ["Friday-2023-05-05"],
"type": "STATUS_NOT_WORK"
}
]
}]
}
五名員工的案例
{
"employees": [
{
"id": "Liam",
"roleIds": [
"Station chef",
"Head chef"
],
"shiftRequests": [
{
"priority": "PRIORITY_HIGH",
"shiftIds": [
"Wednesday-2023-05-03"
],
"type": "STATUS_WORK"
},
{
"priority": "PRIORITY_HIGH",
"shiftIds": [
"Friday-2023-05-05"
],
"type": "STATUS_NOT_WORK"
}
]
}
, {
"id": "Olivia",
"roleIds": ["Station chef"]
}, {
"id": "Noah",
"roleIds": ["Station chef"]
}, {
"id": "Emma",
"roleIds": ["Head chef"]
}, {
"id": "Oliver",
"roleIds": ["Station chef", "Sous chef"]
}
]
}
完整要求的範例
{
"employees": [
{
"id": "Liam",
"roleIds": [
"Station chef",
"Head chef"
],
"shiftRequests": [
{
"priority": "PRIORITY_HIGH",
"shiftIds": [
"Wednesday-2023-05-03"
],
"type": "STATUS_WORK"
},
{
"priority": "PRIORITY_HIGH",
"shiftIds": [
"Friday-2023-05-05"
],
"type": "STATUS_NOT_WORK"
}
]
},
{
"id": "Olivia",
"roleIds": [
"Station chef"
]
},
{
"id": "Noah",
"roleIds": [
"Station chef"
]
},
{
"id": "Emma",
"roleIds": [
"Head chef"
]
},
{
"id": "Oliver",
"roleIds": [
"Station chef",
"Sous chef"
]
}
],
"shifts": [
{
"id": "Monday-2023-05-01",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 12
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 1,
"hours": 23
}
},
{
"id": "Tuesday-2023-05-02",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 2,
"hours": 12
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 2,
"hours": 23
}
},
{
"id": "Wednesday-2023-05-03",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 3,
"hours": 12
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 3,
"hours": 23
}
},
{
"id": "Thursday-2023-05-04",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 4,
"hours": 12
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 4,
"hours": 23
}
},
{
"id": "Friday-2023-05-05",
"startDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 12
},
"endDateTime": {
"year": 2023,
"month": 5,
"day": 5,
"hours": 23
}
}
],
"coverageRequirements": [
{
"shiftIds": [
"Monday-2023-05-01",
"Tuesday-2023-05-02",
"Wednesday-2023-05-03",
"Thursday-2023-05-04",
"Friday-2023-05-05"
],
"roleRequirements": [
{
"roleId": "Station chef",
"targetEmployeeCount": 2,
"priority": "PRIORITY_HIGH"
},
{
"roleId": "Sous chef",
"targetEmployeeCount": 1,
"priority": "PRIORITY_MEDIUM"
}
]
},
{
"shiftIds": [
"Tuesday-2023-05-02",
"Friday-2023-05-05"
],
"roleRequirements": [
{
"roleId": "Head chef",
"targetEmployeeCount": 1,
"priority": "PRIORITY_MEDIUM"
}
]
}
],
"roleIds": [
"Station chef",
"Head chef",
"Sous chef"
]
}
回應範例
解題工具包含將員工的任務指派給 餐廳變動與最佳化程序狀態。舉例來說, 指派給其中一位員工的輪班將退回,結果如下:
{
"solutionStatus": "OPTIMAL",
"shiftAssignments": [
{
"employeeId": "Liam",
"shiftId": "Monday-2023-05-01",
"roleId": "Station chef"
},
{
"employeeId": "Liam",
"shiftId": "Tuesday-2023-05-02",
"roleId": "Station chef"
},
{
"employeeId": "Liam",
"shiftId": "Wednesday-2023-05-03",
"roleId": "Station chef"
},
{
"employeeId": "Liam",
"shiftId": "Thursday-2023-05-04",
"roleId": "Station chef"
}, ...
]
}
完整回應的範例
{
"solutionStatus": "OPTIMAL",
"shiftAssignments": [
{
"employeeId": "Liam",
"shiftId": "Monday-2023-05-01",
"roleId": "Station chef"
},
{
"employeeId": "Liam",
"shiftId": "Tuesday-2023-05-02",
"roleId": "Station chef"
},
{
"employeeId": "Liam",
"shiftId": "Wednesday-2023-05-03",
"roleId": "Station chef"
},
{
"employeeId": "Liam",
"shiftId": "Thursday-2023-05-04",
"roleId": "Station chef"
},
{
"employeeId": "Olivia",
"shiftId": "Friday-2023-05-05",
"roleId": "Station chef"
},
{
"employeeId": "Noah",
"shiftId": "Monday-2023-05-01",
"roleId": "Station chef"
},
{
"employeeId": "Noah",
"shiftId": "Tuesday-2023-05-02",
"roleId": "Station chef"
},
{
"employeeId": "Noah",
"shiftId": "Wednesday-2023-05-03",
"roleId": "Station chef"
},
{
"employeeId": "Noah",
"shiftId": "Thursday-2023-05-04",
"roleId": "Station chef"
},
{
"employeeId": "Noah",
"shiftId": "Friday-2023-05-05",
"roleId": "Station chef"
},
{
"employeeId": "Emma",
"shiftId": "Tuesday-2023-05-02",
"roleId": "Head chef"
},
{
"employeeId": "Emma",
"shiftId": "Friday-2023-05-05",
"roleId": "Head chef"
},
{
"employeeId": "Oliver",
"shiftId": "Monday-2023-05-01",
"roleId": "Sous chef"
},
{
"employeeId": "Oliver",
"shiftId": "Tuesday-2023-05-02",
"roleId": "Sous chef"
},
{
"employeeId": "Oliver",
"shiftId": "Wednesday-2023-05-03",
"roleId": "Sous chef"
},
{
"employeeId": "Oliver",
"shiftId": "Thursday-2023-05-04",
"roleId": "Sous chef"
},
{
"employeeId": "Oliver",
"shiftId": "Friday-2023-05-05",
"roleId": "Sous chef"
}
]
}