Class ProductLatticeOntologyAdapter


  • public class ProductLatticeOntologyAdapter
    extends LatticeOntologyAdapter
    A product lattice-based ontology adapter whose constraints are derived from the component ontology solvers.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Charles Shelton
    Pt.AcceptedRating:
    Red (cshelton)
    Pt.ProposedRating:
    Red (cshelton)
    • Constructor Detail

      • ProductLatticeOntologyAdapter

        public ProductLatticeOntologyAdapter​(ProductLatticeOntologySolver solver,
                                             java.lang.Object component)
                                      throws IllegalActionException
        Construct the product lattice ontology adapter associated with the given component and product lattice ontology solver. The constructed adapter implicitly uses the default constraints set by the solver.
        Parameters:
        solver - The specified product lattice-based ontology solver.
        component - The associated component.
        Throws:
        IllegalActionException - Thrown if the adapter cannot be initialized.
      • ProductLatticeOntologyAdapter

        public ProductLatticeOntologyAdapter​(ProductLatticeOntologySolver solver,
                                             java.lang.Object component,
                                             boolean useDefaultConstraints)
                                      throws IllegalActionException
        Construct the product lattice ontology adapter for the given component and product lattice ontology solver.
        Parameters:
        solver - The specified product lattice-based ontology solver.
        component - The given component.
        useDefaultConstraints - Indicate whether this adapter uses the default actor constraints.
        Throws:
        IllegalActionException - Thrown if the adapter cannot be initialized.
    • Method Detail

      • constraintList

        public java.util.List<Inequality> constraintList()
                                                  throws IllegalActionException
        Return the constraints of this component. The constraints is a list of inequalities. The constraints for the product lattice ontology solver are generated from the component ontology constraint lists.
        Overrides:
        constraintList in class LatticeOntologyAdapter
        Returns:
        The constraints of this component.
        Throws:
        IllegalActionException - Thrown if there is a problem creating the constraints.
      • getPropertyables

        public java.util.List<java.lang.Object> getPropertyables()
        Return a list of property-able objects contained by the component. This is the union of all property-able objects for each LatticeOntologyAdapter for each component ontology.
        Overrides:
        getPropertyables in class OntologyAdapter
        Returns:
        The list of property-able named object.
      • addConstraintsFromTupleOntologyAdapter

        public static void addConstraintsFromTupleOntologyAdapter​(java.util.List<Inequality> constraints,
                                                                  Ontology sourceOntology,
                                                                  LatticeOntologyAdapter productLatticeOntologyAdapter)
                                                           throws IllegalActionException
        Create constraints for the ProductLatticeOntologyAdapter that are derived from the given component LatticeOntologyAdapter.
        Parameters:
        constraints - The list of constraints from the original LatticeOntologyAdapter.
        sourceOntology - The ontology over which the original constraints from the LatticeOntologyAdapter are defined.
        productLatticeOntologyAdapter - The ProductLatticeOntologyAdapter for which we create new constraints.
        Throws:
        IllegalActionException - Thrown if there is an error creating the new constraints.
      • getComponentConceptFromProductLatticeConcept

        public static Concept getComponentConceptFromProductLatticeConcept​(Concept productLatticeConcept,
                                                                           Ontology componentOntology)
                                                                    throws IllegalActionException
        Return the component concept value for the specified ontology from the given product lattice concept. The product lattice concept input argument could be a RecordConcept of ProductLatticeConcepts, which requires special handling beyond what is done in ProductLatticeConcept.getComponentConceptValue(Ontology).
        Parameters:
        productLatticeConcept - The ProductLatticeConcept or RecordConcept of ProductLatticeConcepts from which to get
        componentOntology - The component ontology of the product lattice ontology from which the return concept should be taken.
        Returns:
        The component concept value from the specified component ontology contained in the product lattice concept.
        Throws:
        IllegalActionException - Thrown if there is a problem retrieving the component concept, or if productLatticeConcept is not an instance of ProductLatticeConcept or RecordConcept.
      • getDerivedConceptForProductLattice

        public static Concept getDerivedConceptForProductLattice​(Concept concept,
                                                                 ProductLatticeOntology productOntology)
                                                          throws IllegalActionException
        Get the derived concept for a product lattice ontology from the given concept that is an element in one of the ontologies that comprises the product ontology. The returned concept will be a product lattice concept whose tuple will have every entry as bottom except for the input concept.
        Parameters:
        concept - The given concept that must be from an ontology that comprises the given product lattice ontology.
        productOntology - The given product lattice ontology.
        Returns:
        The derived product lattice concept.
        Throws:
        IllegalActionException - Thrown if the concept's ontology is not part of the given product lattice ontology.
      • getTupleAdapters

        public static java.util.List<LatticeOntologyAdapter> getTupleAdapters​(ProductLatticeOntologySolver solver,
                                                                              java.lang.Object component)
                                                                       throws IllegalActionException
        Return the adapters for each tuple ontology that comprises the product lattice ontology for this solver and model component.
        Parameters:
        solver - The ProductLatticeOntologySolver for this adapter.
        component - The model component object for this adapter.
        Returns:
        The list of LatticeOntologyAdapters for the tuple ontology solvers.
        Throws:
        IllegalActionException - Thrown if there is an error in initializing the tuple ontology adapters.