Task Scheduling
How MAFIS assigns tasks to agents in lifelong mode and what schedulers are available.
In lifelong MAPF, agents continuously receive new tasks after completing their current ones. The component that decides which goal to assign to which agent is the TaskScheduler.
Available Schedulers
Random
Picks a pickup or delivery cell uniformly at random. Serves as the baseline scheduler.
Closest
Two-phase batch assignment. Phase 1 creates random task candidates from all pickup cells. Phase 2 assigns each agent the nearest task from the pool via greedy matching. Preserves locality benefit without positional convergence.
Both schedulers are intentionally fault-blind: dead agents are pre-filtered before the scheduler sees them. The schedulers have no awareness of congestion, queue state, or blocked zones. This rigid design isolates solver behavior as the experimental variable.
Task Model
Agents follow an 8-state task cycle using zones defined by the topology:
- Free → Scheduler assigns a pickup cell from the topology’s pickup zone
- TravelEmpty → Agent travels to pickup cell (no cargo)
- Loading → Agent loads cargo at pickup cell (1-tick minimum dwell)
- TravelToQueue → Agent travels to the back of a delivery queue line
- Queuing → Agent shuffles forward in queue (one slot per tick)
- TravelLoaded → Agent travels to delivery cell (promoted from queue front)
- Unloading → Agent unloads cargo at delivery cell
- Free → Task complete (throughput increments), cycle repeats
Each completed delivery = one throughput unit. If the topology has no queue lines, agents skip steps 4-5 and go directly from Loading to TravelLoaded.