SmartSender
ptolemy.domains.de.demo.SmartSender.SmartSender

This actor adaptively establishes connections by searching for an unused input port in the model and connecting to it. If the output is connected to something (the width of the output port is greater than zero), then the actor sends an integer on the output port and requests a refiring at a time in the future determined by the <i>firingPeriod</i> parameter. The value of the output is simply the count of the firing, starting at 1. <p> If the output is not connected to anything, then the actor will attempt to connect it. It does this by issuing a change request that, when executed, will search for an unused input port (any unused input port) in and actor in the same container as this actor, and then will connect to it. <p> Note that getWidth() is used rather than numberOfSinks() to determine whether the output is connected. This way, this actors search for an input port can be silenced by just connecting it to a relation. <p> This actor is an illustration of the capability actors can have to affect their environment, to detect faults (in this case, missing connections), and to repair the model. It is designed to be used in the DE domain, or any domain that respects fireAt() calls.

Author(s): Edward A. Lee
Version:$Id: SmartSender.doc.html,v 1.1 2006/02/22 18:42:26 mangal Exp $
Pt.Proposed Rating:Yellow (eal)
Pt.Accepted Rating:Red (eal)


output
The output port, which has type int.


firingPeriod
The period at which this actor will execute. This is a double with a default value of 0.1.