Skip to content

Commit

Permalink
Merge pull request #1 from mvcisback/master
Browse files Browse the repository at this point in the history
Merge from master
  • Loading branch information
Gaudeval authored Aug 14, 2020
2 parents f3b84ef + 4f883d1 commit 0195ab2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mtl/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ def _eval_mtl(x, t=0, quantitative=False):
if not quantitative:
sig = booleanize_signal(sig)

start_time = sig.items()[0][0]

if t is None:
res = [(t, v[phi]) for t, v in f(sig).items()]
res = [(t, v[phi]) for t, v in f(sig).items() if t >= start_time]
return res if quantitative else [(t, v > 0) for t, v in res]

if t is False:
t = f(sig).items()[0][0]
if t is False: # Use original signals starting time.
t = start_time

res = interp(f(sig), t, phi)
return res if quantitative else res > 0
Expand Down Expand Up @@ -150,8 +152,7 @@ def eval_mtl_next(phi, dt):
f = eval_mtl(phi.arg, dt)

def _eval(x):
v = (f(x) << dt)
return v[max(v.start, 0):].retag({phi.arg: phi})
return (f(x) << dt).retag({phi.arg: phi})

return _eval

Expand Down

0 comments on commit 0195ab2

Please sign in to comment.