public class LatticeOntologyAdapter extends OntologyAdapter
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Inequality> |
_ownConstraints
The list of Inequality constraints contained by this LatticeOntologyAdapter.
|
protected java.util.List<Inequality> |
_subAdapterConstraints
The list of permanent property constraints.
|
protected boolean |
_useDefaultConstraints
Indicate whether this adapter uses the default actor constraints.
|
LatticeOntologySolver.ConstraintType |
interconnectConstraintType
The default constraint type for connections between actors.
|
_annotationEvaluator, _solver
Constructor and Description |
---|
LatticeOntologyAdapter(LatticeOntologySolver solver,
java.lang.Object component)
Construct the lattice ontology adapter associated with the given
component and solver.
|
LatticeOntologyAdapter(LatticeOntologySolver solver,
java.lang.Object component,
boolean useDefaultConstraints)
Construct the lattice ontology adapter for the given component and
property lattice.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_addDefaultConstraints(LatticeOntologySolver.ConstraintType actorConstraintType)
Add default constraints for the actor referred to by this OntologyAdapter
based on the given ConstraintType.
|
protected void |
_addSubAdapterConstraints()
Iterate through the list of sub adapters and gather the constraints for
each one.
|
protected ParseTreeAnnotationEvaluator |
_annotationEvaluator()
Create a new ParseTreeAnnotationEvaluator that is tailored for the
ontology.
|
protected void |
_constrainAttributes()
Set default Inequality constraints for all attributes that can
be evaluated to a Concept in the Ontology.
|
protected void |
_constrainObject(LatticeOntologySolver.ConstraintType constraintType,
java.lang.Object sink,
java.util.List sourceList)
Set default constraints between the given object and a list of objects based
on the given constraintType.
|
protected void |
_constrainObjectLists(LatticeOntologySolver.ConstraintType constraintType,
java.util.List sourceList,
java.util.List sinkList)
Set the default constraint between the given list of source objects
and list of sink objects based on the given constraintType.
|
protected void |
_constrainSingleObject(LatticeOntologySolver.ConstraintType constraintType,
java.lang.Object source,
java.lang.Object sink)
Set the default constraint between the given source and sink object
based on the given constraintType.
|
protected java.util.List |
_getConstrainedPorts(boolean constraintSource)
Return the list of constrained ports given the flag whether source or
sink ports should be constrained.
|
protected static java.util.List |
_getConstraintingPorts(boolean constraintSource,
TypedIOPort port)
Return the list of constraining ports on a given port, given whether
source or sink ports should be constrained.
|
protected java.util.List<OntologyAdapter> |
_getSubAdapters()
Return the list of sub-adapters.
|
protected void |
_setConnectionConstraintType(LatticeOntologySolver.ConstraintType constraintType)
Set the default constraint type for connections for the model component referred
to by this OntologyAdapter for the given OntologySolver, depending on what type of
component it is.
|
protected static java.util.List<Inequality> |
_union(java.util.List<Inequality> list1,
java.util.List<Inequality> list2)
Return the union of the two specified lists of inequality constraints by
appending the second list to the end of the first list.
|
java.util.List<Inequality> |
constraintList()
Return the constraints of this component.
|
InequalityTerm |
getPropertyTerm(java.lang.Object object)
Return the InequalityTerm associated with the given model object.
|
LatticeOntologySolver |
getSolver()
Return the associated property solver.
|
boolean |
isConstraintSource()
Returns true if the interconnectConstraintType is for sources, false otherwise.
|
void |
reinitialize()
Reset and initialize the LatticeOntologyAdapter.
|
void |
setAtLeast(java.lang.Object greater,
java.lang.Object lesser)
Set an inequality constraint between the two specified objects, such that
the concept value of the greater term is greater than or equal to the
concept value of the lesser term.
|
void |
setAtMost(java.lang.Object lesser,
java.lang.Object greater)
Set an inequality constraint between the two specified objects, such that
the concept value of the greater term is greater than or equal to the
concept value of the lesser term.
|
void |
setSameAs(java.lang.Object object1,
java.lang.Object object2)
Set two inequality constraints between the specified objects,
such that the Concept value of object1 is equal to the Concept value
of object2.
|
_getASTNodeAdapters, _getAttributeParseTrees, _getPropertyableAttributes, _getSinkPortList, _getSourcePortList, getComponent, getContainerEntity, getName, getParseTree, getPropertyables, putAttribute, setComponent, setEquals, toString
public LatticeOntologySolver.ConstraintType interconnectConstraintType
protected java.util.List<Inequality> _ownConstraints
protected boolean _useDefaultConstraints
protected java.util.List<Inequality> _subAdapterConstraints
public LatticeOntologyAdapter(LatticeOntologySolver solver, java.lang.Object component) throws IllegalActionException
solver
- The specified lattice-based ontology solver.component
- The associated component.IllegalActionException
- Thrown if the adapter cannot be
initialized.public LatticeOntologyAdapter(LatticeOntologySolver solver, java.lang.Object component, boolean useDefaultConstraints) throws IllegalActionException
solver
- The specified lattice-based ontology solver.component
- The given component.useDefaultConstraints
- Indicate whether this adapter uses the
default actor constraints.IllegalActionException
- Thrown if the adapter cannot be
initialized.public java.util.List<Inequality> constraintList() throws IllegalActionException
IllegalActionException
- Not thrown in this base class.public InequalityTerm getPropertyTerm(java.lang.Object object)
object
- The given model object for which to find the InequalityTerm in
the OntologySolverpublic LatticeOntologySolver getSolver()
getSolver
in class OntologyAdapter
public boolean isConstraintSource()
public void reinitialize() throws IllegalActionException
reinitialize
in class OntologyAdapter
IllegalActionException
- Thrown if
OntologyAdapter.getPropertyables()
throws it.public void setAtLeast(java.lang.Object greater, java.lang.Object lesser)
greater
- The model object on the LHS of the ≥ inequalitylesser
- The model object on the RHS of the ≥ inequalitypublic void setAtMost(java.lang.Object lesser, java.lang.Object greater)
lesser
- The model object on the RHS of the ≥ inequalitygreater
- The model object on the LHS of the ≥ inequalitypublic void setSameAs(java.lang.Object object1, java.lang.Object object2)
object1
- The model object on the LHS of the equalityobject2
- The model object on the RHS of the equalityprotected void _addDefaultConstraints(LatticeOntologySolver.ConstraintType actorConstraintType) throws IllegalActionException
actorConstraintType
- The given ConstraintType for the default constraints
for the actor referred to by this OntologyAdapterIllegalActionException
- If an exception is thrownLatticeOntologySolver.ConstraintType
protected void _addSubAdapterConstraints() throws IllegalActionException
IllegalActionException
- Thrown if there is any errors in
getting the sub adapters and gathering the constraints for each one.protected ParseTreeAnnotationEvaluator _annotationEvaluator()
_annotationEvaluator
in class OntologyAdapter
protected void _constrainAttributes()
protected void _constrainObject(LatticeOntologySolver.ConstraintType constraintType, java.lang.Object sink, java.util.List sourceList) throws IllegalActionException
constraintType
- The given ConstraintType to be used for the default constraintssink
- The given object that represents the sink for the default constraintssourceList
- The list of objects passed in as a List that
represents the sources for the default constraintsIllegalActionException
- If an exception is thrownLatticeOntologySolver.ConstraintType
protected void _constrainObjectLists(LatticeOntologySolver.ConstraintType constraintType, java.util.List sourceList, java.util.List sinkList) throws IllegalActionException
constraintType
- The given ConstraintType to be used for the default constraintsourceList
- A list of source objectssinkList
- A list of sink objectsIllegalActionException
- If an exception is thrownLatticeOntologySolver.ConstraintType
protected void _constrainSingleObject(LatticeOntologySolver.ConstraintType constraintType, java.lang.Object source, java.lang.Object sink) throws IllegalActionException
constraintType
- The given ConstraintType to be used for the default constraintsource
- The source object for the default constraintssink
- The sink object for the default constraintsIllegalActionException
- If an exception is thrownLatticeOntologySolver.ConstraintType
protected java.util.List _getConstrainedPorts(boolean constraintSource)
constraintSource
- The flag that indicates whether source or sink
ports are constrained.protected static java.util.List _getConstraintingPorts(boolean constraintSource, TypedIOPort port)
constraintSource
- The flag that indicates whether source or sink
ports are constrained.port
- The given port.protected java.util.List<OntologyAdapter> _getSubAdapters() throws IllegalActionException
_getSubAdapters
in class OntologyAdapter
IllegalActionException
- Not thrown in this base class.protected void _setConnectionConstraintType(LatticeOntologySolver.ConstraintType constraintType) throws IllegalActionException
constraintType
- The default ConstraintType for generic model component
connections; will be used if the model component is not one of the following
types
for Ptolemy expression language AST nodes; will be used it the model component
is an AST nodeIllegalActionException
- If an exception is thrownLatticeOntologySolver.ConstraintType
protected static java.util.List<Inequality> _union(java.util.List<Inequality> list1, java.util.List<Inequality> list2)
list1
- The first list.list2
- The second list.