Restoran Planlama

Mutfak için haftalık programlar yapan bir restoran düşünün. Restoran, pazartesiden cumaya 12:00-23:00 arası var. Üç rolü yürütebilecek beş çalışan vardır: Station chef, Head chef ve Sous chef. Her vardiyada, yüksek öncelikli Station chef ve orta öncelikli Sous chef olarak çalışan iki çalışan olmalıdır. Ayrıca, Salı ve Cuma günleri orta öncelikli olan bir Head chef gerekir. Diğer tek planlama kısıtlaması, "03.05.2023 Çarşamba" günü çalışma isteğinde bulunan, ancak Friday-2023-05-05 vardiyasında çalışmak istemeyen çalışanlardan biri (Liam) içindir.

Her vardiya için rol kapsamı

Belirli bir pozisyonun kapsamı, kapsam gerekliliği ile belirli bir vardiya grubu için belirtilebilir. Örneğin, bu problemin ilk kayması şu şekilde temsil edilebilir:

  {
    "shifts": [
      {
        "id": "Monday-2023-05-01",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 1,
          "hours": 12
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 1,
          "hours": 23
        }
      }
    ]
  }

Beş vardiyanın tümünün Monday-2023-05-01, Tuesday-2023-05-02, Wednesday-2023-05-03, Thursday-2023-05-04 ve Friday-2023-05-05 olduğu varsayıldığında Station chef ve Sous chef rollerinin kapsam koşulu şu şekilde temsil edilir:

{
  "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 şartını değerlendirmek için gerekli vardiyalarda ek bir kapsam koşulu belirtilebilir. Kapsam gereksinimlerinin tam listesi şu şekildedir:

{
  "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"
      }]
    }
  ]
}

Çalışan talepleri

Çalışan istekleri kaydırma isteği alanı ile temsil edilir. Bu örnekte, Liam Çarşamba vardiyasında çalışmak istemiş, ancak Cuma vardiyasında çalışmak değil. Bu, (rolleriyle birlikte) şu şekilde temsil edilir:

{
  "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"
      }
    ]
  }]
}

Beş çalışanın tamamını içeren örnek


  {
    "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"]
      }
    ]
  }
  

Eksiksiz istek örneği


  {
    "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"
    ]
  }
  

Yanıt örneği

Çözme aracının yanıtı, çalışanların restorandaki vardiyalara atanması ve optimizasyon prosedürünün durumu ile ilgili bilgiler içerir. Örneğin, çalışanlardan birine atanan vardiyalar şu şekilde döndürülür:

{
  "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"
    }, ...
  ]
}

Eksiksiz yanıt örneği


  {
    "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"
      }
    ]
  }