🗒️ ./run Notes:
Want to use assignment logic like Phantom? Here’s how to steal the core idea:
Step 1: Build a cost matrix
Phantom does this by measuring things like:
- Travel distance (for workers and Queens)
- Enemy threat (for overseers and combat units)
- Cool-down or value (for injects or transfuses)
Each row = a unit, each column = a task, each cell = cost or reward.
Step 2: Feed it to a solver
Phantom uses highspy under the hood, but you can start simple with:
scipy.optimize.linear_sum_assignment
It gives you the best overall mapping of Units → Targets, not just local best guesses.
Step 3: Replace your greedy logic
Instead of:
“Send the closest Queen to the nearest Hatchery”
do what Phantom does:
“Assign all Queens to Hatcheries so total travel is minimized and no target gets double-booked.”
Same for drones. Same for stalkers. Same for any unit with targets.