Class Controller

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, BranchActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class Controller
    extends CSPActor
    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.
    Since:
    Ptolemy II 0.3
    Version:
    $Id$
    Author:
    John S. Davis II
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (davisj)
    • Field Detail

      • requestInput

        public TypedIOPort 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

        public TypedIOPort 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

        public TypedIOPort 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

        public TypedIOPort 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.