聯絡中心

考慮執行轉變時,請考量到員工的需求,並納入客服中心。客服中心全天候提供服務,而且所需的員工人數會隨時間變動。客服中心會 僱用全職和兼職員工

全職員工會調班 9 小時,輪班開始後 4 或 5 個小時有 1 小時休息,並且可在上午 5 點到中午 12 點之間隨時開始值班。兼職員工會在第二個工作時間的結束時進行 4 小時輪班,15 分鐘的空檔,並能隨時開始輪班。這兩種情況下,可能的偏移開始時間都是以 15 分鐘為單位遞增。

客服中心想要規劃未來兩天內營運工作的需求,考慮到最多可能為 20 名全職員工和 40 名兼職員工。

全職與兼職員工的班表範本

決定有效偏移的規則能以「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
      },
      ...
    ]
    ...
  }