Class Repeat

    • Field Detail

      • numberOfTimes

        public PortParameter numberOfTimes
        The repetition factor. It is of type integer and has a default value of 2. It must be greater than zero.
      • blockSize

        public Parameter blockSize
        The number of tokens in a block. It is of type integer and has a default value of 1. It must be greater than zero.
    • Method Detail

      • fire

        public void fire()
                  throws IllegalActionException
        Consume blockSize input tokens from the input port. Produce blockSize*numberOfTimes tokens on the output port, consisting of numberOfTimes repetitions of the input. For example, if blockSize = 3 and numberOfTimes = 2, then on the following input:
          1 2 3 4 5 6

        two invocations of this method will send the following output:
          1 2 3 1 2 3 4 5 6 4 5 6

        Specified by:
        fire in interface Executable
        Overrides:
        fire in class AtomicActor<TypedIOPort>
        Throws:
        IllegalActionException - If there is no director.