Hello,<br><br>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:<br>
if(window.hasToken()){<br> ArrayToken tokenD = (ArrayToken) input.get(0);<br>System.out.println("There is a token at the window port");<br>}<br>else<br> System.out.println("There is no token at the window port");<br>
<br>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?<br>
<br>Thanks,<br>-- <br>Regards,<br>Supriya<br>