Class RExpression

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

    public class RExpression
    extends TypedAtomicActor
    The RExpression actor is an actor designed to run an R script or function with inputs and outputs determined by the ports created by the user. Port names will correspond to R object names. The RExpression actor is modeled after the Ptolemy expression actor, except that that instead of using a single mathematical expression in Ptolemy's expression language, it uses a set of the more powerful, higher order expressions available under R. Both input and output port will usually be added to the actor; The names of these ports correspond to R variables used in the R script.
    Since:
    Ptolemy II 11.0
    Version:
    $Id$
    Author:
    Dan Higgins, NCEAS, UC Santa Barbara
    • Field Detail

      • log

        public static org.apache.commons.logging.Log log
        The log.
      • expression

        public StringAttribute expression
        The expression that is evaluated to produce the output.
      • save_nosave

        public StringParameter save_nosave
        This setting determines whether or not to save the R workspace when R is closed; set to '--save' if you need to retreive the workspace later in a workflow in another RExpression actor.
      • Rcwd

        public StringParameter Rcwd
        The 'R' working directory (home dir by default).
      • displayGraphicsOutput

        public Parameter displayGraphicsOutput
        If true, then display plot. If false, then don't. (the default).
      • graphicsFormat

        public StringParameter graphicsFormat
        The graphics output format. Currently the format is either a *.pdf or a *.png
      • graphicsOutput

        public Parameter graphicsOutput
        If true, then create a graphics output port. (the default); If false, then don't.
      • numXPixels

        public StringParameter numXPixels
        The width of the output graphics bitmap in pixels.
      • numYPixels

        public StringParameter numYPixels
        The height of the output graphics bitmap in pixels.
      • graphicsFileName

        public TypedIOPort graphicsFileName
        The name of the default graphics output file created by the actor.
      • _graphicsOutputFile

        protected java.lang.String _graphicsOutputFile
        The pathname of the graphics output file.
      • _home

        protected java.lang.String _home
        The home.
    • Method Detail

      • postfire

        public boolean postfire()
                         throws IllegalActionException
        Description copied from class: AtomicActor
        Return true, unless stop() has been called, in which case, return false. Derived classes override this method to define operations to be performed at the end of every iteration of its execution, after one invocation of the prefire() method and any number of invocations of the fire() method. This method typically wraps up an iteration, which may involve updating local state. In derived classes, this method returns false to indicate that this actor should not be fired again.
        Specified by:
        postfire in interface Executable
        Overrides:
        postfire in class AtomicActor<TypedIOPort>
        Returns:
        True if execution can continue into the next iteration.
        Throws:
        IllegalActionException - Not thrown in this base class.
      • preinitialize

        public void preinitialize()
                           throws IllegalActionException
        Description copied from class: AtomicActor
        Create receivers and declare delay dependencies. Derived classes can override this method to perform additional initialization functions, but they should call this base class methods or create the receivers themselves. This method gets executed exactly once prior to any other action methods. It cannot produce output data since type resolution is typically not yet done. It also gets invoked prior to any static scheduling that might occur in the domain, so it can change scheduling information.
        Specified by:
        preinitialize in interface Initializable
        Overrides:
        preinitialize in class AtomicActor<TypedIOPort>
        Throws:
        IllegalActionException - Not thrown in this base class.