Class MobileModel

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

    public class MobileModel
    extends TypedCompositeActor
    This is a composite actor with an input port that accepts MoML descriptions of changes that are applied to the contents. Rather than specified before executing, the inside model can be dynamically changed either locally or remotely. Currently, the model that dynamically applied to this actor is specified by a moml string from the modelString input. Currently, it only accepts models with one input and one output, and requires the model name its input port as "input", output port as "output".
    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Yang Zhao
    Pt.AcceptedRating:
    Red (reviewmoderator)
    Pt.ProposedRating:
    Red (eal)
    • Field Detail

      • input

        public TypedIOPort input
        The input port for incoming data to the inside model.
      • modelString

        public TypedIOPort modelString
        The input port for model changing request of the inside model. The type is string.
      • output

        public TypedIOPort output
        The output port for the result after firing the inside model upon the incoming data. Notice that the type is determined by the type of the defaultValue parameter.
      • director

        public Parameter director
        The inside Director for executing the inside model.
      • refresh

        public Parameter refresh
        This Parameter specifies whether to replace the previous model when there is model changing request or not. The type of this parameter is boolean. Select this parameter if it does replace.
      • connectPorts

        public Parameter connectPorts
        the Parameter specifies whether to connect the input and output to the inside model. The type of this parameter is boolean.
      • defaultValue

        public Parameter defaultValue
        The default output token when there is no inside model defined. The default value is 0, and the default type is int. Notice that the type of the output port is determined by the type of this parameter.
    • Constructor Detail

      • MobileModel

        public MobileModel​(Workspace workspace)
                    throws IllegalActionException
        Construct an actor in the specified workspace with no container and 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.
        Parameters:
        workspace - The workspace that will list the actor.
        Throws:
        IllegalActionException - If populating the actor with ports and parameters fails.
      • MobileModel

        public MobileModel​(CompositeEntity container,
                           java.lang.String name)
                    throws IllegalActionException,
                           NameDuplicationException
        Construct an actor with a name and a container. The container argument must not be null, or a NullPointerException will be thrown.
        Parameters:
        container - The container.
        name - The name of this actor.
        Throws:
        IllegalActionException - If the container is incompatible with this actor or if populating the actor with ports and parameters fails.
        NameDuplicationException - If the name coincides with an actor already in the container.