]> gitweb.michael.orlitzky.com - dunshire.git/commitdiff
Add a fudge factor of two when checking "unknown" conelp results.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 1 Nov 2016 00:10:51 +0000 (20:10 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 1 Nov 2016 00:10:51 +0000 (20:10 -0400)
dunshire/games.py

index c841caae752b9075ee28030d2a15df5d42354308..4451606c42c27d4e02d4cdfc30c469a1756d99e5 100644 (file)
@@ -505,7 +505,13 @@ class SymmetricLinearGame:
             # objectives match (within a tolerance) and that the
             # primal/dual optimal solutions are within the cone (to a
             # tolerance as well).
-            if abs(p1_value - p2_value) > options.ABS_TOL:
+            #
+            # The fudge factor of two is basically unjustified, but
+            # makes intuitive sense when you imagine that the primal
+            # value could be under the true optimal by ``ABS_TOL``
+            # and the dual value could be over by the same amount.
+            #
+            if abs(p1_value - p2_value) > 2*options.ABS_TOL:
                 raise GameUnsolvableException(self, soln_dict)
             if (p1_optimal not in self._K) or (p2_optimal not in self._K):
                 raise GameUnsolvableException(self, soln_dict)