2007-05-26

Another update for Temporal Facts

I've just added support for 'since'. This allows you to specify a time frame for each Fact.

If you do:

>>> import pyrete
>>> pyrete.shell()
pyRete> import flags
pyRete> watch(FACTS)
pyRete> import datetime
pyRete> import time
pyRete> t1 = datetime.datetime.fromtimestamp(time.time() + 5)
pyRete> t2 = datetime.datetime.fromtimestamp(time.time() + 15)
pyRete> assert_fact(1, since = t1, until = t2)
==> Fact-1 : 1 { Since: 2007-05-26 20:20:49; Until: 2007-05-26 20:20:59; }
pyRete> list_facts()
<== Fact-1 : 1
Facts:
# None
pyRete>
You get a time frame of 10 seconds for Fact-1.

Inga kommentarer: