מוקד יצירת קשר

חשבו על מרכז אנשי קשר שעבורו אתם רוצים ליצור משמרות כך שהביקוש לעובדים יהיה מכוסה. מוקד התמיכה פועל מסביב לשעון, ומספר העובדים שנדרשים משתנה עם הזמן. מרכז אנשי הקשר מעסיק גם עובדים במשרה מלאה וגם עובדים במשרה חלקית.

עובדים במשרה מלאה עובדים במשמרת של 9 שעות, יוצאים להפסקה של שעה 4 או 5 שעות לאחר תחילת המשמרת, ויכולים להתחיל את המשמרת בכל זמן בין 05:00 ל-12:00. עובדים במשרה חלקית עורכים משמרת של 4 שעות עם הפסקה של 15 דקות בסוף שעת העבודה השנייה, ויכולים להתחיל את המשמרת בכל זמן. בשני המקרים, שעות ההתחלה האפשריות של המשמרות מחושבות במרווחים של 15 דקות.

במרכז אנשי הקשר רוצים לתכנן את דרישות הכוח אדם ליומיים הבאים של הפעילות, כי יכולים להיות בו עד 20 עובדים במשרה מלאה ו-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
      },
      ...
    ]
    ...
  }