Class QSSDirector

  • All Implemented Interfaces:
    java.lang.Cloneable, Executable, Initializable, SuperdenseTimeDirector, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
    Direct Known Subclasses:
    QSSDirectorTest

    public class QSSDirector
    extends DEDirector
    A director that extends the discrete-event model of computation to include a Quantized-State System (QSS) solver to perform integration. This solver performs using a discrete-event style, quantizing the magnitude of signals rather than the time, as done by a conventional ODE solver. The absoluteQuantum and relativeQuantum parameters determine the quantization granularity. For information about QSS, see QSSIntegrator and QSSBase.

    Note that the expression function smoothToken(double, {double}) is available in the expression language. This function creates a SmoothToken with value equal to the first argument and any number of derivatives given in the second argument. Actors in this domain can use such tokens, when they are provided, to perform more accurate calculations.

    Since:
    Ptolemy II 11.0
    Version:
    $Id$
    Author:
    Thierry S. Nouidui and Edward A. Lee
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Field Detail

      • absoluteQuantum

        public Parameter absoluteQuantum
        The minimum quantum for QSS integrations under the control of this director. This is a double that defaults to 1E-4.
      • QSSSolver

        public StringParameter QSSSolver
        The class name of the QSS solver used for integration. This is a string that defaults to "QSS1". Solvers are all required to be in package "org.ptolemy.qss". Note that if the solver is changed during the execution of the model, the change will not take effect until the model re-initialized.
      • relativeQuantum

        public Parameter relativeQuantum
        The relative quantum to use for QSS integrations under the control of this director. If the value here is greater than zero, then the quantum will be the larger of the absoluteQuantum and |x| * relativeQuantum, where x is the current value of the state being quantized. This is a double that defaults to be 0.0, which causes the absoluteQuantum to be used.
      • quantumScaleFactor

        public Parameter quantumScaleFactor
        The quantum scale factor to use for QSS integrations under the control of this director. This value is used to scale the value of the absolute and relative quantum to achieve a finer quantization. This is a double which value must be greater than 0.0 and less or equal to 1.0.
    • Constructor Detail

      • QSSDirector

        public QSSDirector​(CompositeEntity container,
                           java.lang.String name)
                    throws IllegalActionException,
                           NameDuplicationException
        Construct a director in the given container with the given name. The container argument must not be null, or a NullPointerException will be thrown. If the name argument is null, then the name is set to the empty string. Increment the version number of the workspace.
        Parameters:
        container - Container of the director.
        name - Name of this director.
        Throws:
        IllegalActionException - If the director is not compatible with the specified container.
        NameDuplicationException - If the container not a CompositeActor and the name collides with an entity in the container.
    • Method Detail

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        React to a change in an attribute. If the changed attribute matches a parameter of the director, then the corresponding local copy of the parameter value will be updated.
        Overrides:
        attributeChanged in class DEDirector
        Parameters:
        attribute - The changed parameter.
        Throws:
        IllegalActionException - If the new parameter value is not valid.
      • getQSSSolverNames

        public static java.lang.String[] getQSSSolverNames()
        Gets the list of all available QSS solver names.
      • configureSolverParameter

        public static void configureSolverParameter​(StringParameter solverParameter,
                                                    java.lang.String defaultSolver)
        Set the default solver method and list solver alternatives for the specified solver.
        Parameters:
        solverParameter - The parameter specifying the solver method.
        defaultSolver - The default solver to use.
      • getAbsoluteQuantum

        public final double getAbsoluteQuantum()
        Return the value of the absoluteQuantum parameter.
        Returns:
        The absolute quantum.
      • getRelativeQuantum

        public final double getRelativeQuantum()
        Return the value of the relativeQuantum parameter.
        Returns:
        The relative quantum.
      • getQuantumScaleFactor

        public final double getQuantumScaleFactor()
        Return the value of the quantumScaleFactor parameter.
        Returns:
        The state output threshold quantum.
      • newQSSSolver

        public QSSBase newQSSSolver​(java.lang.String type)
                             throws IllegalActionException
        Return a new QSS solver of the specified type.
        Parameters:
        type - The type of solver.
        Returns:
        A QSS solver.
        Throws:
        IllegalActionException - If creating the solver fails.
      • _instantiateQSSSolver

        protected final QSSBase _instantiateQSSSolver​(java.lang.String className)
                                               throws IllegalActionException
        Instantiate an QSSSolver from its class name. Given the solver's full class name, this method will try to instantiate it by looking for the corresponding java class. This method is based on _instantiateODESolver of the CT domain.
        Parameters:
        className - The solver's full class name.
        Returns:
        A new QSS solver.
        Throws:
        IllegalActionException - If the solver can not be created.