假设一个联络中心的运营时间在 8 点 30 分到 18 点之间,有四个客服人员可以接听使用多种语言的通话。可分配代理的班次有三种:8:30-16:30、9:00-17:00 和 10:00-18:00。根据之前的预测,我们发现每种语言的需求在一周中的某天会有所不同。星期一,通话通常用英语和葡萄牙语,因此需要至少有一个客服人员懂这些语言。在星期二,通话通常使用西班牙语和法语,因此需要至少一位客服人员精通这两种语言。无论使用哪种语言,都必须始终至少有两个代理可用。
每天几次调整
在此联络中心示例中,每天有三次班次,规划时间范围为两天。例如,特定星期一 8:30-16:30 的偏差表示为:
{
"shifts": [
{
"id": "Monday-2024-7-1 8:30-16:30",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 8,
"minutes": 30
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 16,
"minutes": 30
}
}
]
}
6 个偏移的示例
{
"shifts": [
{
"id": "Monday-2024-7-1 8:30-16:30",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 8,
"minutes": 30
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 16,
"minutes": 30
}
},
{
"id": "Monday-2024-7-1 9:00-17:00",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 9
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 17
}
},
{
"id": "Monday-2024-7-1 10:00-18:00",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 10
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 18
}
},
{
"id": "Tuesday-2024-7-2 8:30-16:30",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 8,
"minutes": 30
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 16,
"minutes": 30
}
},
{
"id": "Tuesday-2024-7-2 9:00-17:00",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 9
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 17
}
},
{
"id": "Tuesday-2024-7-2 10:00-18:00",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 10
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 18
}
}
]
}
将语言作为员工的技能
代理懂的语言表示为 skill
。第一个代理 Laren 会说西班牙语和葡萄牙语,表示为:
{
"employees": [
{
"id": "Lauren",
"role_ids": [
"Agent"
],
"skill_ids": [
"ES",
"PR"
]
}
]
}
您还可以添加其他类型的时间安排限制条件、轮班请求和员工偏好设置,如其他示例中所述。
全部 4 名员工的示例
{
"employees": [
{
"id": "Lauren",
"role_ids": [
"Agent"
],
"skill_ids": [
"ES",
"PR"
]
},
{
"id": "Markus",
"role_ids": [
"Agent"
],
"skill_ids": [
"EN",
"PR"
]
},
{
"id": "Hans",
"role_ids": [
"Agent"
],
"skill_ids": [
"EN",
"ES"
],
"shiftRequests": [
{
"shiftIds": [
"Monday-2024-7-1 10:00-18:00"
],
"type": "STATUS_NOT_WORK"
}
]
},
{
"id": "Peter",
"role_ids": [
"Agent"
],
"skill_ids": [
"EN",
"FR"
],
"shiftPreferences": [
{
"shiftId": "Monday-2024-7-1 10:00-18:00",
"preference": 1
}
]
}
]
}
针对代理和语言的需求覆盖率
覆盖范围要求体现了对代理或特定语言的需求。对两个代理的需求是在 roleRequirements
中指定的,而对语言的要求是在 skillRequirements
中指定的。星期一和星期二的覆盖率要求表示为:
{
"coverageRequirements": [
{
"startDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 8,
"minutes": 30
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 18
},
"roleRequirements": [
{
"role_id": "Agent",
"target_employee_count": 1,
"priority": "PRIORITY_HIGH"
}
],
"skillRequirements": [
{
"skill_id": "EN",
"target_employee_count": 1
},
{
"skill_id": "PR",
"target_employee_count": 1
}
]
},
{
"startDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 8,
"minutes": 30
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 18,
"minutes": 0
},
"roleRequirements": [
{
"role_id": "Agent",
"target_employee_count": 1,
"priority": "PRIORITY_HIGH"
}
],
"skillRequirements": [
{
"skill_id": "ES",
"target_employee_count": 1
},
{
"skill_id": "FR",
"target_employee_count": 1
}
]
}
],
"role_ids": [
"Agent"
],
"skill_ids": [
"EN",
"ES",
"FR",
"PR"
]
}
请注意,所有角色和技能 ID 都必须在请求中定义。它们必须与用于定义员工的 ID 一致。
完整请求示例
{
{
"requestId": "contact_center_examples",
"solve_parameters": {
"time_limit": {
"seconds": 60
}
},
"employees": [
{
"id": "Lauren",
"role_ids": [
"Agent"
],
"skill_ids": [
"ES",
"PR"
]
},
{
"id": "Markus",
"role_ids": [
"Agent"
],
"skill_ids": [
"EN",
"PR"
]
},
{
"id": "Hans",
"role_ids": [
"Agent"
],
"skill_ids": [
"EN",
"ES"
],
"shiftRequests": [
{
"shiftIds": [
"Monday-2024-7-1 10:00-18:00"
],
"type": "STATUS_NOT_WORK"
}
]
},
{
"id": "Peter",
"role_ids": [
"Agent"
],
"skill_ids": [
"EN",
"FR"
],
"shiftPreferences": [
{
"shiftId": "Monday-2024-7-1 10:00-18:00",
"preference": 1
}
]
}
],
"shifts": [
{
"id": "Monday-2024-7-1 8:30-16:30",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 8,
"minutes": 30
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 16,
"minutes": 30
}
},
{
"id": "Monday-2024-7-1 9:00-17:00",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 9
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 17
}
},
{
"id": "Monday-2024-7-1 10:00-18:00",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 10
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 18
}
},
{
"id": "Tuesday-2024-7-2 8:30-16:30",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 8,
"minutes": 30
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 16,
"minutes": 30
}
},
{
"id": "Tuesday-2024-7-2 9:00-17:00",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 9
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 17
}
},
{
"id": "Tuesday-2024-7-2 10:00-18:00",
"startDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 10
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 18
}
}
],
"coverageRequirements": [
{
"startDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 8,
"minutes": 30
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 1,
"hours": 18
},
"roleRequirements": [
{
"role_id": "Agent",
"target_employee_count": 1,
"priority": "PRIORITY_HIGH"
}
],
"skillRequirements": [
{
"skill_id": "EN",
"target_employee_count": 1
},
{
"skill_id": "PR",
"target_employee_count": 1
}
]
},
{
"startDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 8,
"minutes": 30
},
"endDateTime": {
"year": 2024,
"month": 7,
"day": 2,
"hours": 18,
"minutes": 0
},
"roleRequirements": [
{
"role_id": "Agent",
"target_employee_count": 1,
"priority": "PRIORITY_HIGH"
}
],
"skillRequirements": [
{
"skill_id": "ES",
"target_employee_count": 1
},
{
"skill_id": "FR",
"target_employee_count": 1
}
]
}
],
"role_ids": [
"Agent"
],
"skill_ids": [
"EN",
"ES",
"FR",
"PR"
]
}
}
响应示例
求解器的响应包含代理的班次分配和优化过程的状态。
以下示例展示了分配的班次:
{
"solutionStatus": "OPTIMAL",
"shiftAssignments": [
{
"employeeId": "Lauren",
"shiftId": "Tuesday-2024-7-2 10:00-18:00",
"roleId": "Agent"
},
{
"employeeId": "Markus",
"shiftId": "Monday-2024-7-1 8:30-16:30",
"roleId": "Agent"
},
{
"employeeId": "Peter",
"shiftId": "Monday-2024-7-1 10:00-18:00",
"roleId": "Agent"
},
{
"employeeId": "Peter",
"shiftId": "Tuesday-2024-7-2 8:30-16:30",
"roleId": "Agent"
}
],
"requestId": "contact_center_examples"
}