fastboolean eval + forgot to add offsets to new get_times function
This commit is contained in:
parent
e477392664
commit
3a7ac439f1
3 changed files with 5 additions and 3 deletions
|
|
@ -34,6 +34,8 @@ def get_times(x, tau, lo=None, hi=None):
|
|||
lo = min(v.first()[0] for v in x.values())
|
||||
if hi is None or hi is oo:
|
||||
hi = max(v.last()[0] for v in x.values())
|
||||
lo += tau
|
||||
hi += tau
|
||||
if lo > hi:
|
||||
return []
|
||||
elif hi == lo:
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ def _(stl):
|
|||
f1, f2 = pointwise_satf(stl.arg1), pointwise_satf(stl.arg2)
|
||||
|
||||
state = False
|
||||
for phi, tau in zip(reversed(f1(x, x.index)), reversed(x.index)):
|
||||
times = get_times(x, t[0])
|
||||
for phi, tau in zip(reversed(f1(x, times)), reversed(times)):
|
||||
if not phi:
|
||||
state = f2(x, [tau])
|
||||
if tau in t:
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ class TestSTLEval(unittest.TestCase):
|
|||
self.assertEqual(stl_eval2(x, 0), not r)
|
||||
|
||||
|
||||
"""
|
||||
@params(ex1, ex2, ex3, ex4, ex5, ex6, ex7, ex8, ex9, ex10, ex11)
|
||||
def test_fasteval(self, phi_str, _):
|
||||
phi = stl.parse(phi_str)
|
||||
|
|
@ -48,4 +47,4 @@ class TestSTLEval(unittest.TestCase):
|
|||
b_fast2 = stl_evalf2(x, 0)
|
||||
self.assertEqual(b_slow, b_fast)
|
||||
self.assertEqual(b_fast, not b_fast2)
|
||||
"""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue