Class PthalesAtomicActor

    • Field Detail

      • _INTERNAL_REPETITIONS

        protected static java.lang.String _INTERNAL_REPETITIONS
        The name of the internal repetitions parameter.
      • _REPETITIONS

        protected static java.lang.String _REPETITIONS
        The name of the total repetitions parameter.
    • Constructor Detail

      • PthalesAtomicActor

        public PthalesAtomicActor​(CompositeEntity container,
                                  java.lang.String name)
                           throws NameDuplicationException,
                                  IllegalActionException
        Create a new actor in the specified container with the specified name. The name must be unique within the container or an exception is thrown. The container argument must not be null, or a NullPointerException will be thrown.
        Parameters:
        container - The container.
        name - The name of this actor within the container.
        Throws:
        IllegalActionException - If this actor cannot be contained by the proposed container (see the setContainer() method).
        NameDuplicationException - If the name coincides with an entity already in the container.
      • PthalesAtomicActor

        public PthalesAtomicActor​(Workspace workspace)
                           throws IllegalActionException,
                                  NameDuplicationException
        Construct an actor in the specified workspace with an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace. The object is added to the workspace directory. Increment the version number of the workspace.
        Parameters:
        workspace - The workspace that will list the entity.
        Throws:
        IllegalActionException - If the actor cannot be contained by the proposed container.
        NameDuplicationException - If the container already has an actor with this name.
    • Method Detail

      • convertReal

        public FloatToken[] convertReal​(float[] realOut)
        Convert from an array used in a JNI function to Tokens.
        Parameters:
        realOut - The array used in a JNI function.
        Returns:
        An arry of Tokens.
      • convertToken

        public float[] convertToken​(Token[] tokensIn)
        Convert from Tokens to array to be used in a JNI function.
        Parameters:
        tokensIn - The tokens to be converted.
        Returns:
        The array to be used in a JNI function.
      • getIteration

        public static int getIteration​(ComponentEntity actor)
        Returns the total iterations value.
        Parameters:
        actor - associated actor
        Returns:
        total repetitions number
      • getIterations

        public static int[] getIterations​(ComponentEntity actor)
        Returns the total iterations values.
        Parameters:
        actor - associated actor
        Returns:
        size array of repetitions
      • getRepetitions

        public static java.lang.Integer[] getRepetitions​(ComponentEntity actor)
        Returns the total repetitions values.
        Parameters:
        actor - associated actor
        Returns:
        size array of repetitions
      • getInternalRepetitions

        public static java.lang.Integer[] getInternalRepetitions​(ComponentEntity actor)
        Returns the internal repetitions values.
        Parameters:
        actor - associated actor
        Returns:
        size array of repetitions
      • _computeIteration

        protected static int _computeIteration​(java.lang.Integer[] totalRepetitions,
                                               java.lang.Integer[] internalRepetitions)
        Compute the number of iterations to repeat the C function.
        Parameters:
        totalRepetitions - The array of total repetitions.
        internalRepetitions - The array of internal repetitions, where an internal repetition is the loop inside the C function.
        Returns:
        number of iterations to repeat the C function.
      • _computeIterations

        protected static int[] _computeIterations​(java.lang.Integer[] totalRepetitions,
                                                  java.lang.Integer[] internalRepetitions)
        Compute iteration numbers of the actor, where external means the number of times C function is called.
        Parameters:
        totalRepetitions - The array of total repetitions.
        internalRepetitions - The array of internal repetitions, where an internal repetition is the loop inside the C function.
        Returns:
        external iteration numbers
      • _parseRepetitions

        protected static java.lang.Integer[] _parseRepetitions​(ComponentEntity actor,
                                                               java.lang.String name)
        Return a data structure giving the dimension data contained by a parameter with the specified name in the specified port or actor. The dimension data is indexed by dimension name and contains two integers, a value and a stride, in that order.
        Parameters:
        actor - The name of the actor
        name - The name of the parameter
        Returns:
        The dimension data, or an empty array if the parameter does not exist.