Example:


\begin{picture}(380,1)(0,0)
\put (0,0){\framebox{(}380,1)}
\end{picture}

The following example shows two agents that behave in accordance with two timers.

go:-
    timer(T1,100), 
    timer(T2,1000),
    ping(T1),
    pong(T2),
    repeat,fail.


ping(T),{time(T)} => write(ping),nl.
pong(T),{time(T)} => write(pong),nl.

\begin{picture}(380,1)(0,0)
\put (0,0){\framebox{(}380,1)}
\end{picture}

Note that the two calls 'repeat,fail' are needed after the two agents are created. Without them, the query go would succeed before any time event is posted and, thus, neither of the agents could get a chance to be activated.



Neng-Fa Zhou 2013-01-25