Class Scale

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

    public class Scale
    extends Transformer
    Produce an output token on each firing with a value that is equal to a scaled version of the input. The actor is polymorphic in that it can support any token type that supports multiplication by the factor parameter. The output type is constrained to be at least as general as both the input and the factor parameter. For data types where multiplication is not commutative (such as matrices), whether the factor is multiplied on the left is controlled by the scaleOnLeft parameter. Setting the parameter to true means that the factor is multiplied on the left, and the input on the right. Otherwise, the factor is multiplied on the right.
    Since:
    Ptolemy II 0.3
    Version:
    $Id$
    Author:
    Edward A. Lee, Steve Neuendorffer
    Pt.AcceptedRating:
    Yellow (yuhong)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • factor

        public Parameter factor
        The factor. This parameter can contain any scalar token that supports multiplication. The default value of this parameter is the IntToken 1.
      • scaleOnLeft

        public Parameter scaleOnLeft
        Multiply on the left. This parameter controls whether the scale factor is multiplied on the left. The default value is a boolean token of value true. Setting is to false will multiply the factor on the right.