Task Lifecycle¶
The complete journey of a robot task from creation to completion.
Task Types¶
| Type | Description |
|---|---|
| Pick | Retrieve item from storage |
| Drop | Deliver item to destination |
| Transport | Move item between locations |
| Charge | Travel to charging station |
| Maintenance | Go for scheduled maintenance |
Lifecycle Stages¶
┌─────────────────────────────────────────────────────────────┐
│ TASK LIFECYCLE │
├──────────┬───────────┬──────────┬──────────┬────────────────┤
│ Created │ Assigned │ Traveling│ Executing│ Completed │
│ │ │ │ │ │
│ Order │ Robot │ Moving │ At │ Task done, │
│ arrives, │ selected, │ to │ station, │ robot freed │
│ task │ task │ station │ being │ │
│ queued │ scheduled │ │ serviced │ │
└──────────┴───────────┴──────────┴──────────┴────────────────┘
│ │ │ │ │
t₀ t₁ t₂ t₃ t₄
Stage 1: Task Creation¶
Trigger¶
Tasks created when:
- Order arrives
- Replenishment needed
- Charging required
- Maintenance scheduled
Initial State¶
Task {
id: T001
type: Pick
origin: Rack R5
destination: Station S1
status: Pending
created_at: 10:00:00
}
Stage 2: Assignment¶
Assignment Process¶
- Task enters queue
- Policy selects robot
- Robot receives task
- Path calculated
Assignment Policies¶
| Policy | Selection Criteria |
|---|---|
nearest_idle |
Closest available robot |
least_busy |
Robot with fewest tasks |
round_robin |
Sequential assignment |
After Assignment¶
Stage 3: Traveling¶
Robot Movement¶
Robot navigates through calculated path:
Possible Events¶
| Event | Response |
|---|---|
| Path clear | Continue travel |
| Node blocked | Wait or reroute |
| Battery low | Interrupt for charging |
| Higher priority task | May preempt (if configured) |
Travel Metrics¶
- Travel time: Time from start to arrival
- Wait time: Time blocked by traffic
- Distance: Total path length
Stage 4: Execution¶
At Destination¶
Robot arrives at station and begins service:
- Enter station queue (if needed)
- Wait for service slot
- Receive service
- Complete task actions
Service Time¶
Variable based on task:
Queue Behavior¶
Stage 5: Completion¶
Task Finished¶
Robot Released¶
Robot transitions to:
- Idle: No pending tasks
- Next task: If tasks queued
- Charging: If battery low
Time Breakdown¶
Task Time Components¶
┌─────────────────────────────────────────────────────────┐
│ Total Task Time │
├──────────┬──────────┬──────────┬───────────┬───────────┤
│ Queue │ Travel │ Wait │ Queue │ Service │
│ Wait │ Time │ (traffic)│ (station)│ Time │
│ │ │ │ │ │
│ t_q │ t_t │ t_w │ t_sq │ t_s │
└──────────┴──────────┴──────────┴───────────┴───────────┘
Total = t_q + t_t + t_w + t_sq + t_s
Key Metrics¶
| Metric | Formula |
|---|---|
| Task time | completion_time - creation_time |
| Travel ratio | travel_time / task_time |
| Wait ratio | (traffic_wait + queue_wait) / task_time |
| Service ratio | service_time / task_time |
Task Interruption¶
Preemption¶
Higher priority tasks may interrupt:
- Current task paused
- Urgent task executed
- Original task resumed
Battery Interrupt¶
Low battery forces charging:
Failure Interrupt¶
Robot failure stops task:
Example Timeline¶
10:00:00.000 Order O1 created
10:00:00.100 Task T1 created (pick SKU001 from R5)
10:00:00.250 T1 assigned to Robot R3
10:00:00.300 R3 starts traveling to R5
10:00:04.500 R3 arrives at R5
10:00:04.600 R3 picks item
10:00:04.700 R3 starts traveling to Station S1
10:00:08.200 R3 arrives at S1
10:00:08.300 R3 joins station queue (position 2)
10:00:15.100 R3 reaches service slot
10:00:21.400 Service complete
10:00:21.500 Task T1 completed
10:00:21.600 R3 becomes idle