Specialisation weighting in task selection #69

Open
opened 2026-09-07 20:37:20 +01:00 by liamjd · 0 comments
Owner

Part of milestone #5. Depends on #67.

Pawns prioritise tasks for which they are specialised: haulers haul more than builders do, but a builder will still haul if nothing else is workable.

Design:

  • required_role on Task (an enum such as NONE, BUILDER, HAULER; extend as task types arrive)
  • role on the pawn record (see the pawn roles issue in this milestone)
  • Selection in next_for(pawn) prefers tasks matching the pawn's role, then falls back to any workable task. Whether that is a strict tier before priority or a weighted score is the design decision here; write down which and why in the PR

AC:

  • Unit tests: a hauler offered a builder task and a hauler task of equal priority takes the hauler task; with only a builder task available, it takes that; a much higher priority mismatched task versus a low priority matched task behaves per the documented rule
Part of milestone #5. Depends on #67. Pawns prioritise tasks for which they are specialised: haulers haul more than builders do, but a builder will still haul if nothing else is workable. Design: - `required_role` on `Task` (an enum such as NONE, BUILDER, HAULER; extend as task types arrive) - `role` on the pawn record (see the pawn roles issue in this milestone) - Selection in `next_for(pawn)` prefers tasks matching the pawn's role, then falls back to any workable task. Whether that is a strict tier before priority or a weighted score is the design decision here; write down which and why in the PR AC: - Unit tests: a hauler offered a builder task and a hauler task of equal priority takes the hauler task; with only a builder task available, it takes that; a much higher priority mismatched task versus a low priority matched task behaves per the documented rule
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
liamjd/UntitledColonyBuilder#69
No description provided.