Fazla mesai ücretiyle hemşire planlaması

Bu örnek, bütçe gereksinimine tabi olarak düzenli ve fazla mesai ücretlerini modellemek için hemşire planlaması örneğine dayanmaktadır. Hemşireler için planlama kısıtlamalarının yanı sıra, 4 günlük bir planlama zamanı için 10.000 dolarlık bir bütçe vardır. Tüm hemşirelere saatlik 50 ABD doları/saat ücreti verilir. 19 saatten başlayan vardiyalarda saatlik değişim farkı ise 10 ABD dolarıdır. 40 saat sonra çalışılan herhangi bir saat, ortalama taban saatlik ücretin 1,5 katı (ör. (50 TL+60 TL)/2=55 TL).

Düzenli ve fazla mesai ücreti

Taban saatlik ücret, vardiya diferansiyelleri ve fazla mesai çarpanları, çalışan içinde hourlyContract alanıyla temsil edilir. Saatlik sözleşmede baseHourlyRate ve hourlyRateShiftDifferentials, normal (fazla mesai dışı) çalışmaların maliyetini modeller. Bu değerler, overtimePeriods sağlandığında fazla mesai ücreti için ortalama bir saatlik taban ücreti tahmin etmek amacıyla da kullanılır. Genellikle uzatma dönemi bir haftayla eşleşir ve çakışmadıkları sürece birden fazla fazla mesai dönemi sağlanabilir. İlk hemşire (Adam) için saatlik sözleşme şu şekilde temsil edilir:

  {
    "employees": [{
      "id": "Adam",
      "roleIds": ["Registered Nurse"],
      ...
        scheduling constraints
      ...
      "hourlyContract": {
        "baseHourlyRate": 50,
        "hourlyRateShiftDifferentials": {
          "2023-05-01 19hr": 10,
          "2023-05-02 19hr": 10,
          "2023-05-03 19hr": 10,
          "2023-05-04 19hr": 10
        },
        "overtimePeriods": [
          {
            "overtimeMultiplier": 1.5,
            "startDateTime": {
              "year": 2023,
              "month": 5,
              "day": 1
            },
            "endDateTime": {
              "year": 2023,
              "month": 5,
              "day": 5
            },
            "maximumRegularHours": 40
          }
        ]
      }
    }
  }

Dört çalışanın tamamını ve saatlik sözleşmelerini içeren örnek


  {
      "employees": [
        {
          "id": "Adam",
          "roleIds": [
            "Registered Nurse"
          ],
          "schedulingConstraints": [
            {
              "priority": "PRIORITY_HIGH",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "minimumRestMinutes": 720
            },
            {
              "priority": "PRIORITY_MEDIUM",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "maximumMinutes": 2160
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        },
        {
          "id": "Grace",
          "roleIds": [
            "Registered Nurse"
          ],
          "schedulingConstraints": [
            {
              "priority": "PRIORITY_HIGH",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "minimumRestMinutes": 720
            },
            {
              "priority": "PRIORITY_MEDIUM",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "maximumMinutes": 2160
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        },
        {
          "id": "James",
          "roleIds": [
            "Registered Nurse"
          ],
          "schedulingConstraints": [
            {
              "priority": "PRIORITY_HIGH",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "minimumRestMinutes": 720
            },
            {
              "priority": "PRIORITY_MEDIUM",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "maximumMinutes": 2160
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        },
        {
          "id": "Alonso",
          "roleIds": [
            "Registered Nurse"
          ],
          "schedulingConstraints": [
            {
              "priority": "PRIORITY_HIGH",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "minimumRestMinutes": 720
            },
            {
              "priority": "PRIORITY_MEDIUM",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "maximumMinutes": 2160
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        }
    ]
  }
  

Bütçe gereksinimi

10.000 ABD doları tutarındaki toplam bütçe,bir bütçe şartıyla temsil edilir. Başlangıç ve bitiş zamanları isteğe bağlıdır ve verilirse yalnızca bu zaman aralığındaki kaymalar ve fazla zaman aralıkları bu bütçe kısıtlaması için dikkate alınır. İlk hemşirenin (Adam) ilgili temsili şu şekilde güncellenebilir:

  {
    "totalBudget": 10000,
    "priority": "PRIORITY_HIGH"
  }

Eksiksiz istek örneği


    {
      "employees": [
        {
          "id": "Adam",
          "roleIds": [
            "Registered Nurse"
          ],
          "schedulingConstraints": [
            {
              "priority": "PRIORITY_HIGH",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "minimumRestMinutes": 720
            },
            {
              "priority": "PRIORITY_MEDIUM",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "maximumMinutes": 2160
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        },
        {
          "id": "Grace",
          "roleIds": [
            "Registered Nurse"
          ],
          "schedulingConstraints": [
            {
              "priority": "PRIORITY_HIGH",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "minimumRestMinutes": 720
            },
            {
              "priority": "PRIORITY_MEDIUM",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "maximumMinutes": 2160
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        },
        {
          "id": "James",
          "roleIds": [
            "Registered Nurse"
          ],
          "schedulingConstraints": [
            {
              "priority": "PRIORITY_HIGH",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "minimumRestMinutes": 720
            },
            {
              "priority": "PRIORITY_MEDIUM",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "maximumMinutes": 2160
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        },
        {
          "id": "Alonso",
          "roleIds": [
            "Registered Nurse"
          ],
          "schedulingConstraints": [
            {
              "priority": "PRIORITY_HIGH",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "minimumRestMinutes": 720
            },
            {
              "priority": "PRIORITY_MEDIUM",
              "startDateTime": {
                "year": 2023,
                "month": 5,
                "day": 1,
                "hours": 7
              },
              "endDateTime": {
                "year": 2023,
                "month": 5,
                "day": 5,
                "hours": 7
              },
              "maximumMinutes": 2160
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        }
      ],
      "shifts": [
        {
          "id": "2023-05-01 7h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 19
          }
        },
        {
          "id": "2023-05-01 13h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 13
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 2,
            "hours": 1
          }
        },
        {
          "id": "2023-05-01 19h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 19
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 2,
            "hours": 7
          }
        },
        {
          "id": "2023-05-02 7h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 2,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 2,
            "hours": 19
          }
        },
        {
          "id": "2023-05-02 13h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 2,
            "hours": 13
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 3,
            "hours": 1
          }
        },
        {
          "id": "2023-05-02 19h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 2,
            "hours": 19
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 3,
            "hours": 7
          }
        },
        {
          "id": "2023-05-03 7h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 3,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 3,
            "hours": 19
          }
        },
        {
          "id": "2023-05-03 13h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 3,
            "hours": 13
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 4,
            "hours": 1
          }
        },
        {
          "id": "2023-05-03 19h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 3,
            "hours": 19
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 4,
            "hours": 7
          }
        },
        {
          "id": "2023-05-04 7h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 4,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 4,
            "hours": 19
          }
        },
        {
          "id": "2023-05-04 13h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 4,
            "hours": 13
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 1
          }
        },
        {
          "id": "2023-05-04 19h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 4,
            "hours": 19
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          }
        }
      ],
      "coverageRequirements": [
        {
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "locationId": "department",
          "roleRequirements": [
            {
              "roleId": "Registered Nurse",
              "targetEmployeeCount": 2,
              "priority": "PRIORITY_MANDATORY"
            }
          ]
        }
      ],
      "roleIds": [
        "Registered Nurse"
      ],
      "locationIds": [
        "department"
      ],
      "budgetRequirements": [
        {
          "totalBudget": 10000,
          "priority": "PRIORITY_HIGH"
        }
      ]
    }
    

Yanıt örneği

Çözme aracının yanıtı, vardiyalarda çalışan hemşirelerin atanmasını ve optimizasyon prosedürünün durumunu içerir. Örneğin, ilk çalışana atanan vardiyalar şu şekilde döndürülür:

  {
    "solutionStatus": "OPTIMAL",
    "shiftAssignments": [
      {
        "employeeId": "Adam",
        "shiftId": "2023-05-01 7hr",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Adam",
        "shiftId": "2023-05-02 7hr",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Adam",
        "shiftId": "2023-05-03 7hr",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Adam",
        "shiftId": "2023-05-04 7hr",
        "roleId": "Registered Nurse"
      },
      ... ]
  }

Tam yanıt örneği


  {
    "solutionStatus": "OPTIMAL",
    "shiftAssignments": [
      {
        "employeeId": "Adam",
        "shiftId": "2023-05-01 7h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Adam",
        "shiftId": "2023-05-02 7h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Adam",
        "shiftId": "2023-05-03 7h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Adam",
        "shiftId": "2023-05-04 7h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Grace",
        "shiftId": "2023-05-01 19h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Grace",
        "shiftId": "2023-05-02 19h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Grace",
        "shiftId": "2023-05-03 19h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Grace",
        "shiftId": "2023-05-04 19h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "James",
        "shiftId": "2023-05-01 19h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "James",
        "shiftId": "2023-05-02 19h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "James",
        "shiftId": "2023-05-03 19h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "James",
        "shiftId": "2023-05-04 19h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "We",
        "shiftId": "2023-05-01 7h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "We",
        "shiftId": "2023-05-02 7h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "We",
        "shiftId": "2023-05-03 7h",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "We",
        "shiftId": "2023-05-04 7h",
        "roleId": "Registered Nurse"
      }
    ]
  }