[kepler-users] PN Director Question

supriya gulati supgulati at gmail.com
Wed Oct 21 16:14:51 PDT 2009


Hello,

I am trying to implement an actor that has two input ports-input and window.
In the implementation, I want that the actor should execute different set of
lines depending on if the tokens are present or not present at the window
port. I am trying to do something like:
if(window.hasToken()){
  ArrayToken tokenD = (ArrayToken) input.get(0);
System.out.println("There is a token at the window port");
}
else
 System.out.println("There is no token at the window port");

I observer that when I use a PN director, the value of  window.hasToken() is
true even if there is no token at the window port. I actually used an
arraytosequence actor to output the array tokens to my actor.So even if the
input to arraytosequence is { }, my actor returns true for window.hasToken()
and enters the "if" block. However after executing the first line of the
"if" block, it stops i.e it does not print the next line. Can someone tell
me why the PN director sets the value false when there is no token at the
window port?

Thanks,
-- 
Regards,
Supriya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/attachments/20091021/6a650871/attachment.html>


More information about the Kepler-users mailing list