Aalk4308/outpost — pull request #21 by Aalk4308 (2014-11-29 20:45:54+00:00)
Title: Tactical avoidance

After running all strategies, there is now an additional "tactical avoidance" check. If the move would "likely" result in the outpost being disbanded (losing a path home), then the intended target is ignored temporarily and, instead, the outpost is moved toward our home cell.

To determine whether the move would result in an outpost being disbanded would require looking at every possible combination of all opponent moves. We could prune this by only looking at every combination of opponent moves for those sufficient close, although this would not be perfectly accurate and still rather expensive. As a simpler step, we simply look at four cases: (1) all opponent outposts remain stationary, (2) all opponent outposts move up, (3) all opponent outposts move left, and (4) all opponent outposts move up or left, whichever is farther from our home cell. This seems to be reasonably effective.