summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-12 17:50:20 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-12 17:50:20 +0200
commit5d617ed918d9fe98a0155dea87dd402ec66fb84e (patch)
treec28e7c0b3a1c9c015d5abbb475f1ac65e4aadf30
parent64c25a29b00f3e7b1e0db10ee9a8c6783d0e1ed6 (diff)
fix old runaway corridor size (was twice as large as needed)
-rw-r--r--strategy.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/strategy.py b/strategy.py
index 961a4e1..a1937e2 100644
--- a/strategy.py
+++ b/strategy.py
@@ -25,8 +25,8 @@ class Strategy:
if (not cell.is_virus and dist < 500+2*cell.size and cell.mass > 1.25 * my_smallest) or (cell.is_virus and dist < my_largest and cell.mass < my_largest):
angle = math.atan2(relpos[1],relpos[0])
- corridor_width = 2 * math.asin(cell.size / dist)
- forbidden_intervals += canonicalize_angle_interval((angle-corridor_width, angle+corridor_width))
+ corridor_halfwidth = math.asin(cell.size / dist)
+ forbidden_intervals += canonicalize_angle_interval((angle-corridor_halfwidth, angle+corridor_halfwidth))
runaway = True
# wall avoidance