Class ProductLatticeOntologySolver

    • 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 OntologySolver
        name - 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 class OntologySolverBase
        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 class LatticeOntologySolver
        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 class LatticeOntologySolver
      • _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 class LatticeOntologySolver
        Parameters:
        component - The specified component.
        Returns:
        The LatticeOntologyAdapter for the specified component.
        Throws:
        IllegalActionException - Thrown if the LatticeOntologyAdapter cannot be instantiated.