This predicate is useful for scheduling daily events. The given time will be translated into the equivalent absolute time, and that time will definitely be within the next 24 hours. For example,
tcp_daily(13, 0, 0, Timeval)unifies Timeval with the
timeval/2representation for 1 pm. If the goal was submitted at noon, Timeval will represent an hour later. If the goal was submitted at 2 pm, Timeval will represent 1 pm the following day.
Hour, Minute, and Second must all be integers.
The following example wakes up every 24 hours
... tcp_daily(H, M, S, Timeval) tcp_schedule_wakeup(Timeval, time(H,M,S)), repeat, tcp_select(X), dispatch(X), fail. dispatch(wakeup(T)):- T = time(H,M,S), tcp_daily(H, M, S, Timeval), tcp_schedule_wakeup(Timeval, T), ...