
Controller |
ptolemy.domains.csp.demo.BusContention.Controller |
A CSP actor that serves as a controller of a shared resource. This
actor has four "informal" states that are cycled through in the
fire() method. In these four states this actor accepts and grants
requests for access to a shared resource. An Actor that wants to
request or be granted access to a shared resource must connect to
this controller via the requestInput and requestOutput ports. To
aid in monitoring such requests, the controller connects to a
ContentionAlarm actor through its contendInput and contendOutput
ports.
In state one the controller waits for requests on its requestInput
port. Once the first request has been received, the controller
moves to state two and sends a message to the ContentionAlarm
notifying it that a request has occurred at the current time. The
controller then moves to state three and performs a conditional
rendezvous on its contendInput and requestInput ports. Once an input
has been received from the ContentionAlarm, then the controller knows
that that the request contention period is over and it moves to state
four. In state four the controller notifies the resource requestors as
to whether their requests were granted based on priority relative to
other contenders.
Author(s): John S. Davis II
Version:$Id: Controller.doc.html,v 1.1 2006/02/22 18:40:26 mangal Exp $
Pt.Proposed Rating:Red (davisj)
Pt.Accepted Rating:Red (cxh)
requestInput
The resource request input port. Resource requests are made
through this port with a token that include's the requestor's
priority level. The type of this port is BaseType.INT. This
port is a multiport.
requestOutput
The resource request output port. Resources are granted through
this port. The type of this port is BaseType.BOOLEAN. This port
is a multiport.
contendInput
The contention input port. The availability of data on this
port indicates that additional resource contention does not
exist at the current time. The type of this port is
BaseType.GENERAL.
contendOutput
The contention output port. Output data on this port can be
used to trigger a ContentionAlarm. The type of this port is
BaseType.GENERAL.