Class CrossbarSwitch

    • Field Detail

      • _switchFabricQueue

        protected java.util.HashMap<java.lang.Integer,​java.util.TreeSet<TimedEvent>> _switchFabricQueue
        Switch fabric queues for every output port. A token is in the switch fabric queue if it can be processed and for the amount of time defined by the delay.
      • _waitingOnSwitchFabricQueue

        protected java.util.HashMap<java.lang.Integer,​FIFOQueue> _waitingOnSwitchFabricQueue
        Queue that stores tokens that have been put into the input queue but cannot be processed by the switch fabric because the crossbar switch for this connection is busy.
    • Constructor Detail

      • CrossbarSwitch

        public CrossbarSwitch​(CompositeEntity container,
                              java.lang.String name)
                       throws IllegalActionException,
                              NameDuplicationException
        Construct a CrossbarSwitch with a name and a container. The container argument must not be null, or a NullPointerException will be thrown. This actor will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.
        Parameters:
        container - The container.
        name - The name of this actor.f
        Throws:
        IllegalActionException - If the container is incompatible with this actor.
        NameDuplicationException - If the name coincides with an actor already in the container.
    • Method Detail

      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone this actor into the specified workspace. The new actor is not added to the directory of that workspace (you must do this yourself if you want it there). The result is a new actor with the same ports as the original, but no connections and no container. A container must be set before much can be done with this actor.
        Overrides:
        clone in class BasicSwitch
        Parameters:
        workspace - The workspace for the cloned object.
        Returns:
        A new Bus.
        Throws:
        java.lang.CloneNotSupportedException - If cloned ports cannot have as their container the cloned entity (this should not occur), or if one of the attributes cannot be cloned.
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • fire

        public void fire()
                  throws IllegalActionException
        Move tokens from the input queue to the switch fabric, move tokens from the switch fabric to the output queues and send tokens from the output queues to the target receivers. When moving tokens between queues the appropriate delays are considered.
        Specified by:
        fire in interface Executable
        Overrides:
        fire in class BasicSwitch
        Throws:
        IllegalActionException - Thrown if token cannot be sent to target receiver.
      • _scheduleRefire

        protected void _scheduleRefire()
                                throws IllegalActionException
        Schedule a refiring of the actor at the current or a future time. The actor is refired at current time if there are tokens waiting to be processed by the switch fabric and the state of the crossbar switch indicates that the connection is free. It is refired at a future time if any of the queues contains tokens.
        Overrides:
        _scheduleRefire in class BasicSwitch
        Throws:
        IllegalActionException - If actor cannot be refired at the computed time.