Class RecordConcept

  • All Implemented Interfaces:
    java.lang.Cloneable, InequalityTerm, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class RecordConcept
    extends MapTypeInfiniteConcept<Concept>
    A concept that represents the concept values of entries in a record token. A conceptable model element such as a port or node in a Ptolemy expression could contain a token value that is a record data type. A record token is a token that is a collection of multiple token values of different types. For example, we might want to specify a record that indicates the (x,y) pixel position on a black-and-white screen, and also true or false for whether that pixel position is on or off. We can use a record of the form: {x = 34, y = 26, pixelOn = true}

    This RecordConcept allows any record to be assigned concept values for its individual elements from an arbitrary finite ontology. For example, if we wanted to assign a concept to the token above from the constAbstractInterpretation ontology, it would be: {x = Positive, y = Positive, pixelOn = BooleanTrue} This code is adapted from the MonotonicityConcept implementation.

    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Charles Shelton, Ben Lickly, Elizabeth Latronico
    Pt.AcceptedRating:
    Red (blickly)
    Pt.ProposedRating:
    Red (blickly)
    • Method Detail

      • createRecordConcept

        public static RecordConcept createRecordConcept​(Ontology ontology)
        Create a new record concept, belonging to the given ontology, with an automatically generated name.
        Parameters:
        ontology - The ontology to which this concept belongs.
        Returns:
        The newly created RecordConcept.
        Throws:
        InternalErrorException - If there .
      • compare

        public int compare​(Concept concept)
                    throws IllegalActionException
        Compare this concept with the given concept. Returns an int value that corresponds to the ordering between the elements as given in the CPO interface.
        Specified by:
        compare in class InfiniteConcept
        Parameters:
        concept - The concept with which we are comparing.
        Returns:
        CPO.HIGHER if this concept is above the given concept, CPO.LOWER if this concept is below the given concept, CPO.SAME if both concepts are the same, and CPO.INCOMPARABLE if concepts are incomparable.
        Throws:
        IllegalActionException - If the specified concept does not have the same ontology as this one.
        See Also:
        Concept.isAboveOrEqualTo(ptolemy.data.ontologies.Concept)
      • greatestLowerBound

        public Concept greatestLowerBound​(Concept concept)
        Compute the greatest lower bound (GLB) of this and another concept.
        Specified by:
        greatestLowerBound in class InfiniteConcept
        Parameters:
        concept - The other concept
        Returns:
        The concept that is the GLB of this and the given concept.
      • leastUpperBound

        public Concept leastUpperBound​(Concept concept)
        Compute the least upper bound (LUB) of this and another concept.
        Specified by:
        leastUpperBound in class InfiniteConcept
        Parameters:
        concept - The other concept
        Returns:
        The concept that is the LUB of this and the given concept.