Package ptolemy.data.ontologies.lattice
Class ProductLatticeOntologySolver
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.moml.MoMLModelAttribute
-
- ptolemy.data.ontologies.OntologySolverBase
-
- ptolemy.data.ontologies.OntologySolver
-
- ptolemy.data.ontologies.lattice.LatticeOntologySolver
-
- ptolemy.data.ontologies.lattice.ProductLatticeOntologySolver
-
- All Implemented Interfaces:
java.lang.Cloneable
,Testable
,Changeable
,Configurable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class ProductLatticeOntologySolver extends LatticeOntologySolver
A solver for product lattice-based ontologies. This is a derived class ofLatticeOntologySolver
that specially handles adapters for ProductLatticeOntologies.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Charles Shelton
- Pt.AcceptedRating:
- Red (cshelton)
- Pt.ProposedRating:
- Red (cshelton)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.data.ontologies.lattice.LatticeOntologySolver
LatticeOntologySolver.ConstraintType
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.data.ontologies.lattice.LatticeOntologySolver
_initialConstraintList, _resolvedConstraintList, _resolvedUnacceptableList, ADD_FUNCTION_NAME, AND_FUNCTION_NAME, DIVIDE_FUNCTION_NAME, MULTIPLY_FUNCTION_NAME, NEGATE_FUNCTION_NAME, NOT_FUNCTION_NAME, OR_FUNCTION_NAME, RECIPROCAL_FUNCTION_NAME, solverStrategy, solvingFixedPoint, SUBTRACT_FUNCTION_NAME
-
Fields inherited from class ptolemy.data.ontologies.OntologySolver
_eol, _momlHandler
-
Fields inherited from class ptolemy.data.ontologies.OntologySolverBase
_adapterStore, _nonSettables, _ontologySolverUtilities, _resolvedProperties, ontologySolverUtilitiesWrapper
-
Fields inherited from class ptolemy.moml.MoMLModelAttribute
_model, modelURL
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Constructor Description ProductLatticeOntologySolver(NamedObj container, java.lang.String name)
Constructor for the ProductLatticeOntologySolver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected OntologyAdapter
_getAdapter(java.lang.Object component)
Return the LatticeOntologyAdapter for the specified component.java.util.List<LatticeOntologySolver>
getAllContainedOntologySolvers()
Return all the LatticeOntologySolvers contained in the ProductLatticeOntologySolver's model.ProductLatticeOntology
getOntology()
Return the product lattice ontology for this constraint solver.LatticeOntologySolver
getRelatedSolver(Ontology containedOntology)
Return the LatticeOntologySolver associated with the given ontology that is contained in the ProductLatticeOntologySolver model, or null if there is none.void
initialize()
Initialize the solver: Reset the solver (superclass) and then collect all of the initial constraints from the model.void
reset()
Reset the solver.-
Methods inherited from class ptolemy.data.ontologies.lattice.LatticeOntologySolver
_clearLists, _getConceptTermManager, _getConstraintType, _resolveConcepts, clone, getAdapter, getAdapter, getAdapter, getAffectedTerms, getConceptTerm, getConceptTermManager, getConstraintManager, getInitialSolverInformation, getResolvedSolverInformation, getUnacceptableTerms, getUnacceptableTermsAsString, hasUnacceptableTerms, isAnnotatedTerm, isLeastFixedPoint, resolveConcepts, test, train
-
Methods inherited from class ptolemy.data.ontologies.OntologySolver
checkErrors, checkResolutionErrors, configure, displayConcepts, getMoMLHandler, invokeSolver, invokeSolver, isSettable
-
Methods inherited from class ptolemy.data.ontologies.OntologySolverBase
_getAdapter, _getPackageName, _toplevel, cleanConstants, clearResolvedConcept, getAllAdapters, getAllConceptableNamedObjs, getAllContainedOntologies, getAllPropertyables, getAllSolvers, getAttribute, getConcept, getOntologySolverUtilities, getParser, getParseTree, markAsNonSettable, resetAll, setConcept, setOntologySolverUtilities
-
Methods inherited from class ptolemy.moml.MoMLModelAttribute
_exportMoMLContents, attributeChanged, getConfigureSource, getConfigureText, getContainedModel
-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
-
-
-
Constructor Detail
-
ProductLatticeOntologySolver
public ProductLatticeOntologySolver(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Constructor for the ProductLatticeOntologySolver.- Parameters:
container
- The model that contains the OntologySolvername
- The name of the OntologySolver- Throws:
IllegalActionException
- If there is any problem creating the OntologySolver object.NameDuplicationException
- If there is already a component in the container with the same name
-
-
Method Detail
-
getAllContainedOntologySolvers
public java.util.List<LatticeOntologySolver> getAllContainedOntologySolvers()
Return all the LatticeOntologySolvers contained in the ProductLatticeOntologySolver's model. These are the solvers that are associated with each ontology that comprises the product lattice ontology for this solver.- Returns:
- The list of LatticeOntologySolvers contained in the solver model, or null if the solver model is null.
-
getOntology
public ProductLatticeOntology getOntology() throws IllegalActionException
Return the product lattice ontology for this constraint solver. If this solver contains more than one product lattice ontology, then return the last one added. If it contains no product lattice ontologies, then return null. A product lattice ontology solver must contain at least one product lattice ontology. Ontologies that are not product lattice ontologies are ignored.- Overrides:
getOntology
in classOntologySolverBase
- Returns:
- The product lattice ontology for this constraint solver.
- Throws:
IllegalActionException
- Thrown if there is an error getting the ontology objects from the solver model.
-
getRelatedSolver
public LatticeOntologySolver getRelatedSolver(Ontology containedOntology) throws IllegalActionException
Return the LatticeOntologySolver associated with the given ontology that is contained in the ProductLatticeOntologySolver model, or null if there is none.- Parameters:
containedOntology
- The ontology that is a subcomponent of the product lattice ontology.- Returns:
- The LatticeOntologySolver that is associated with the given ontology.
- Throws:
IllegalActionException
- If there is an error getting the contained LatticeOntologySolvers.
-
initialize
public void initialize() throws IllegalActionException
Initialize the solver: Reset the solver (superclass) and then collect all of the initial constraints from the model. For a ProductLatticeOntologySolver, all the LatticeOntologySolvers for the ontologies that compose the ProductLatticeOntology must have their solver utilities object set to the same object as the ProductLatticeOntologySolver.- Overrides:
initialize
in classLatticeOntologySolver
- Throws:
IllegalActionException
- If an exception occurs when collecting the constraints.
-
reset
public void reset()
Reset the solver. This removes the internal states of the solver (e.g. previously recorded properties, statistics, etc.). Also resets the ConceptTermManager to null and clears the trained constraints. For the ProductLatticeOntologySolver, also reset the solvers for the component ontologies in the solver model.- Overrides:
reset
in classLatticeOntologySolver
-
_getAdapter
protected OntologyAdapter _getAdapter(java.lang.Object component) throws IllegalActionException
Return the LatticeOntologyAdapter for the specified component. This instantiates a new OntologyAdapter if it does not already exist for the specified component. This returns specific LatticeOntologyAdapters for the LatticeOntologySolver. For the ProductLatticeOntologySolver it will create new adapters that are derived from the adapters of the individual LatticeOntologySolvers for the component ontologies of the product lattice ontology, unless the user has specified new adapters in the solver model.- Overrides:
_getAdapter
in classLatticeOntologySolver
- Parameters:
component
- The specified component.- Returns:
- The LatticeOntologyAdapter for the specified component.
- Throws:
IllegalActionException
- Thrown if the LatticeOntologyAdapter cannot be instantiated.
-
-