The multiway branches are created within the parent actor that contains this controller. The executeBranches() method takes those branches (an array) as an argument, and returns when every branch is successful. A successful branch is a branch that succeeds with its communication. Only branches whose guards are true are enabled. If no branch is enabled, i.e. if all the guards are false, then executeBranches() returns immediately. If exactly one branch is enabled, then the corresponding communication is an ordinary rendezvous. If more than one branch is enabled, a separate thread is created and started for each enabled branch. The executeBranches() method then waits for all of the branches to succeed. When the last branch thread has finished, the method returns, allowing the parent actor thread to continue. @author Edward A. Lee @version $Id: MultiwayBranchController.java,v 1.18 2007/12/07 06:28:02 cxh Exp $ @since Ptolemy II 5.2 @Pt.ProposedRating Yellow (eal) @Pt.AcceptedRating Red (bilung) @see ConditionalBranch @see BranchActor @see ConditionalReceive @see ConditionalSend
|
|