Link with tow(or more) source - using To

Grassel Guido NRC/Hki (guido.grassel@research.nokia.com)
Thu, 30 Oct 1997 15:43:25 +0200

Hello MUG!

Andrea's idea is quite intersting, its really amazing how many things can be
done with TokenGroup.

Andreas just wrote:
::>Hmm, what do you think about the following? I haven't tried it, but it
might
::>work:

We have a problem if object 2 gets deactivated before object 3 gets
activated or vica versa because the token position in the TG is always
increased but never decreased. But the idea with the token position is
good.

I have a different, more complete solution than the one I sent earlier
today. It uses a interger variable that is increased when object 2 or 3
becomes activate, and it is decreased when one of them is stopped. Aftyer
increasing the variable a TestVariable action is used to test if the
variable is equal to two. The variable is equal to two if and only if both
objects 2 and 3 are activated.

:{IntVariable
10
InitialValue 0
}
{:link
11
:event-source 2
:event-type IsRunning
:link-effect (
: Add (10 1)
:TestVariable (10 1 2)
)
}
{:link
12
:event-source 2
:event-type IsRunning
:link-effect (
Add (10 1)
:TestVariable (10 1 2)
)
}
{:link
21
:event-source 2
:event-type IsStopped
:link-effect (
Subtract (10 1)
)
}
{:link
22
:event-source 2
:event-type IsStopped
:link-effect (
Subtract (10 1)
)
}
{:link
20
:event-source 10
:event-type TestEvent
:event-data True
:link-effect (
:Run (4)
)
}

Regards
Guido

-----------------------------------------------------------------
Guido Grassel guido.grassel@research.nokia.com
Nokia Research Center tel/fax: +358 9 4376-6827/6855

mailing address: location:
P.O. Box 422 Itälahdenkatu 22b
FIN-00045 Nokia Group 00210 Helsinki-Lauttasaari
Finland