Class ActorConstraintsDefinitionAdapter

    • Field Detail

      • _constraintTermExpressions

        protected java.util.List<StringParameter> _constraintTermExpressions
        The list of expressions that represent the constraint terms for each constraint in the actor.
    • Constructor Detail

      • ActorConstraintsDefinitionAdapter

        public ActorConstraintsDefinitionAdapter​(LatticeOntologySolver solver,
                                                 ComponentEntity component,
                                                 java.util.List<StringParameter> constraintExpressions)
                                          throws IllegalActionException
        Construct the lattice ontology adapter for the given component and property lattice.
        Parameters:
        solver - The specified lattice-based ontology solver.
        component - The given component.
        constraintExpressions - The list of constraint expressions for each port or component in the actor.
        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 are generated from the expressions passed in from an ActorConstraintsDefinitionAttribute that allows the user to define actor constraints in the OntologySolver model.
        Overrides:
        constraintList in class LatticeOntologyAdapter
        Returns:
        The list of constraints for this component.
        Throws:
        IllegalActionException - If there is a problem parsing the constraint expression strings to create the actor constraints.
      • getPropertyables

        public java.util.List<java.lang.Object> getPropertyables()
        Return a list of property-able ports and attributes contained by the component. If any of the actor element expressions are set to IGNORE then they are not added to the list of property-able objects.
        Overrides:
        getPropertyables in class OntologyAdapter
        Returns:
        The list of property-able ports and attributes.
      • _getConceptFunctionTerm

        protected ConceptFunctionInequalityTerm _getConceptFunctionTerm​(NamedObj actorElement,
                                                                        java.lang.String functionString)
                                                                 throws IllegalActionException
        Return the inequality term representing the concept function defined by the specified string.
        Parameters:
        actorElement - The actor element for which this concept function constraint is being defined.
        functionString - The string containing the expression for the concept function.
        Returns:
        The concept function inequality term that implements the concept function and contains the correct inequality term inputs.
        Throws:
        IllegalActionException - If the string cannot be correctly parsed and the concept function cannot be created.
      • _getPropertyableAttributes

        protected java.util.List<Attribute> _getPropertyableAttributes()
        Return the list of property-able Attributes. This list is defined by the expressions for each attribute taken from the ActorConstraintsDefinitionAttribute. Any attribute that is set to IGNORE is not added to the list of property-able attributes.
        Overrides:
        _getPropertyableAttributes in class OntologyAdapter
        Returns:
        The list of property-able Attributes.
      • _setConstraints

        protected void _setConstraints​(NamedObj actorElement,
                                       java.lang.String constraintExpressionString)
                                throws IllegalActionException
        Set the constraints for the actor attribute or port based on the parsed expression string.
        Parameters:
        actorElement - The attribute or port from the actor to be constrained.
        constraintExpressionString - The expression string that is parsed to get the constraints for the actor attribute or port.
        Throws:
        IllegalActionException - If the constraint cannot be set due to problems parsing the expression.