Class PacketDropFaultGenerator

    • Field Detail

      • packetDropProbability

        public Parameter packetDropProbability
        The service time. This is a double with default 0.1. It is required to be positive.
    • Constructor Detail

      • PacketDropFaultGenerator

        public PacketDropFaultGenerator​(CompositeEntity container,
                                        java.lang.String name)
                                 throws IllegalActionException,
                                        NameDuplicationException
        Construct a Bus 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.
        Throws:
        IllegalActionException - If the container is incompatible with this actor.
        NameDuplicationException - If the name coincides with an actor already in the container.
    • Method Detail

      • getReceiver

        public IntermediateReceiver getReceiver​(Receiver receiver)
        Create an intermediate receiver that wraps a given receiver.
        Parameters:
        receiver - The receiver that is being wrapped.
        Returns:
        A new intermediate receiver.
      • getReceiver

        public Receiver getReceiver​(Receiver receiver,
                                    IOPort port)
                             throws IllegalActionException
        Create a receiver to mediate a communication via the specified receiver. This receiver is linked to a specific port of the communication aspect.
        Parameters:
        receiver - Receiver whose communication is to be mediated.
        port - Port of the communication aspect.
        Returns:
        A new receiver.
        Throws:
        IllegalActionException - If the receiver cannot be created.
      • 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 AtomicCommunicationAspect
        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)
      • sendToken

        public void sendToken​(Receiver source,
                              Receiver receiver,
                              Token token)
                       throws IllegalActionException
        Initiate a send of the specified token to the specified receiver. This method will schedule a refiring of this actor if there is not one already scheduled.
        Parameters:
        source - Sender of the token.
        receiver - The receiver to send to.
        token - The token to send.
        Throws:
        IllegalActionException - If the refiring request fails.
      • reset

        public void reset()
        Reset the communication aspect and clear the tokens.