Priority¶
Task and robot priority systems.
Why Priority?¶
Not all tasks are equal:
- Urgent orders need faster processing
- VIP customers expect better service
- Some robots may have special capabilities
Priority ensures important work gets done first.
Priority Levels¶
Numeric Priority¶
Higher number = higher priority:
Priority 10: Emergency/VIP
Priority 7: Express orders
Priority 5: Standard orders (default)
Priority 3: Low priority
Priority 1: Background tasks
Named Levels¶
Task Priority¶
Assignment¶
Tasks receive priority from:
Order-based:
Time-based:
Rule-based:
policies:
priority:
rules:
- condition: "sku.category == 'perishable'"
priority: 8
- condition: "customer.tier == 'vip'"
priority: 7
Dynamic Priority¶
Priority can change over time:
Task created: Priority 5
30 min remaining: Priority 6
10 min remaining: Priority 8
Overdue: Priority 10
Priority Effects¶
Task Allocation¶
Higher priority tasks assigned first:
Station Queue¶
Priority affects queue position:
Station Queue (with priority):
Position 1: R1 with priority 8 task
Position 2: R2 with priority 7 task
Position 3: R3 with priority 5 task (arrived first)
Traffic Priority¶
Higher priority robots may have right-of-way:
Priority Schemes¶
FIFO (First In, First Out)¶
No priority consideration:
Strict Priority¶
Always process highest priority first:
Risk: Low priority tasks may starve.
Weighted Fair¶
Balance priority with fairness:
Higher priority gets more service but doesn't completely block lower priority.
Aging¶
Priority increases with wait time:
Prevents starvation of low-priority tasks.
Preemption¶
Concept¶
Higher priority task interrupts lower priority:
R1 executing Task A (priority 3)
Task B arrives (priority 9)
Preemption:
- Task A paused
- R1 assigned Task B
- Task A resumed later (or reassigned)
Configuration¶
Preemption Points¶
When can preemption occur:
| Point | Description |
|---|---|
| Any time | Can interrupt mid-task |
| At node | Only at node arrival |
| At completion | Only between tasks |
Robot Priority¶
Static Priority¶
Some robots have permanent priority:
Task-Inherited Priority¶
Robot inherits priority from current task:
R1 with priority 3 task → Robot priority 3
R2 with priority 8 task → Robot priority 8
Traffic conflict: R2 wins
Configuration Example¶
policies:
priority:
# Base scheme
scheme: aging
age_factor: 0.1
# Task priority sources
default_priority: 5
due_time_boost: true
urgent_threshold_s: 300
urgent_boost: 3
# Preemption
preemption_enabled: true
min_priority_difference: 4
preemption_point: at_node
# Robot priority
robot_priority: task_inherited
# Traffic
traffic_priority: true
Priority Metrics¶
Task Metrics¶
| Metric | Description |
|---|---|
| Avg completion by priority | Time by priority level |
| Priority violations | High priority delayed |
| Starvation count | Tasks waiting too long |
Fairness Metrics¶
| Metric | Description |
|---|---|
| Wait time variance | Spread of wait times |
| Completion rate by priority | Tasks completed per level |
| Preemption count | How often preemption occurs |
Best Practices¶
Don't Overuse High Priority¶
Reserve high priority for truly urgent tasks.
Use Aging for Fairness¶
Prevents low-priority starvation:
Monitor Priority Distribution¶
Track how priorities are distributed: