Optimal Planning Strategy for Ambush Avoidance