Package ptolemy.data.ontologies.lattice
Class ProductLatticeOntologyAdapter
- java.lang.Object
-
- ptolemy.data.ontologies.OntologyAdapter
-
- ptolemy.data.ontologies.lattice.LatticeOntologyAdapter
-
- ptolemy.data.ontologies.lattice.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)
-
-
Field Summary
-
Fields inherited from class ptolemy.data.ontologies.lattice.LatticeOntologyAdapter
_ownConstraints, _subAdapterConstraints, _useDefaultConstraints, interconnectConstraintType
-
Fields inherited from class ptolemy.data.ontologies.OntologyAdapter
_annotationEvaluator, _solver
-
-
Constructor Summary
Constructors Constructor Description ProductLatticeOntologyAdapter(ProductLatticeOntologySolver solver, java.lang.Object component)
Construct the product lattice ontology adapter associated with the given component and product lattice ontology solver.ProductLatticeOntologyAdapter(ProductLatticeOntologySolver solver, java.lang.Object component, boolean useDefaultConstraints)
Construct the product lattice ontology adapter for the given component and product lattice ontology solver.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addConstraintsFromTupleOntologyAdapter(java.util.List<Inequality> constraints, Ontology sourceOntology, LatticeOntologyAdapter productLatticeOntologyAdapter)
Create constraints for the ProductLatticeOntologyAdapter that are derived from the given component LatticeOntologyAdapter.java.util.List<Inequality>
constraintList()
Return the constraints of this component.static Concept
getComponentConceptFromProductLatticeConcept(Concept productLatticeConcept, Ontology componentOntology)
Return the component concept value for the specified ontology from the given product lattice concept.static Concept
getDerivedConceptForProductLattice(Concept concept, ProductLatticeOntology productOntology)
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.java.util.List<java.lang.Object>
getPropertyables()
Return a list of property-able objects contained by the component.static java.util.List<LatticeOntologyAdapter>
getTupleAdapters(ProductLatticeOntologySolver solver, java.lang.Object component)
Return the adapters for each tuple ontology that comprises the product lattice ontology for this solver and model component.-
Methods inherited from class ptolemy.data.ontologies.lattice.LatticeOntologyAdapter
_addDefaultConstraints, _addSubAdapterConstraints, _annotationEvaluator, _constrainAttributes, _constrainObject, _constrainObjectLists, _constrainSingleObject, _getConstrainedPorts, _getConstraintingPorts, _getSubAdapters, _setConnectionConstraintType, _union, getPropertyTerm, getSolver, isConstraintSource, reinitialize, setAtLeast, setAtMost, setSameAs
-
Methods inherited from class ptolemy.data.ontologies.OntologyAdapter
_getASTNodeAdapters, _getAttributeParseTrees, _getPropertyableAttributes, _getSinkPortList, _getSourcePortList, getComponent, getContainerEntity, getName, getParseTree, putAttribute, setComponent, setEquals, toString
-
-
-
-
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 classLatticeOntologyAdapter
- 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 classOntologyAdapter
- 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 aRecordConcept
of ProductLatticeConcepts, which requires special handling beyond what is done inProductLatticeConcept.getComponentConceptValue(Ontology)
.- Parameters:
productLatticeConcept
- The ProductLatticeConcept or RecordConcept of ProductLatticeConcepts from which to getcomponentOntology
- 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.
-
-