Class InUnitsOf

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

    public class InUnitsOf
    extends Transformer

    An actor that converts input tokens to specified units by dividing the input by the value of the units parameter. This actor is designed to be used with a unit system, which must be included in the model (note that some Ptolemy II applications do not include unit systems).

    The units are specified by the units parameter, which contains a DoubleToken with units. The input tokens and the token in the unit parameter must have the same unit category. Otherwise, an exception will be thrown in the fire() method. Unit categories include the ones defined in the MoML file, such as length, time, mass, and the composite ones formed through the base categories, such as length/time (speed), and length * length (area). The output token is a DoubleToken without units.

    Since:
    Ptolemy II 2.0
    Version:
    $Id$
    Author:
    Yuhong Xiong, Xiaojun Liu, Edward Lee
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (yuhong)