Class Component

  • All Implemented Interfaces:
    java.io.Serializable

    public class Component
    extends java.lang.Object
    implements java.io.Serializable
    A Component is described by - a name - a collection of provided interfaces - a list of required interfaces - a set of parameters - a list of dependencies and can be used to describe any kind of components and model complex multi-component systems. More specifically, Components are used to model the search space of HASCO. By recursively resolving required interfaces until there are no open choices left, HASCO may transform your component description automatically into an HTN planning problem to automatically optimize a component setup for a specific task.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Component​(java.lang.String name)
      Constructor creating an empty Component with a specific name.
      Component​(java.lang.String name, java.util.Collection<java.lang.String> providedInterfaces, java.util.List<Interface> requiredInterfaces, ai.libs.jaicore.basic.sets.PartialOrderedSet<Parameter> parameters, java.util.Collection<Dependency> dependencies)
      Constructor for a component giving the provided and required interfaces, the collection of parameters and a list of dependencies.
      Component​(java.lang.String name, java.util.Collection<java.lang.String> providedInterfaces, java.util.List<Interface> requiredInterfaces, ai.libs.jaicore.basic.sets.PartialOrderedSet<Parameter> parameters, java.util.List<Dependency> dependencies)
      Constructor for a component giving the provided and required interfaces, the collection of parameters and a list of dependencies.
    • Constructor Detail

      • Component

        public Component​(java.lang.String name)
        Constructor creating an empty Component with a specific name.
        Parameters:
        name - The name of the Component.
      • Component

        public Component​(java.lang.String name,
                         java.util.Collection<java.lang.String> providedInterfaces,
                         java.util.List<Interface> requiredInterfaces,
                         ai.libs.jaicore.basic.sets.PartialOrderedSet<Parameter> parameters,
                         java.util.Collection<Dependency> dependencies)
        Constructor for a component giving the provided and required interfaces, the collection of parameters and a list of dependencies.
        Parameters:
        name - The name of the Component.
        providedInterfaces - The collection of provided interfaces.
        requiredInterfaces - The list of required interfaces.
        parameters - Parameters of the Component.
        dependencies - A list of dependencies to constrain the values of parameters (may be empty).
      • Component

        public Component​(java.lang.String name,
                         java.util.Collection<java.lang.String> providedInterfaces,
                         java.util.List<Interface> requiredInterfaces,
                         ai.libs.jaicore.basic.sets.PartialOrderedSet<Parameter> parameters,
                         java.util.List<Dependency> dependencies)
        Constructor for a component giving the provided and required interfaces, the collection of parameters and a list of dependencies.
        Parameters:
        name - The name of the Component.
        providedInterfaces - The collection of provided interfaces.
        requiredInterfaces - The list of required interfaces.
        parameters - Parameters of the Component.
        dependencies - A list of dependencies to constrain the values of parameters (may be empty).
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns:
        The name of the Component.
      • getRequiredInterfaces

        public java.util.List<Interface> getRequiredInterfaces()
        Returns:
        The list of required interfaces.
      • getRequiredInterfaceNames

        public java.util.List<java.lang.String> getRequiredInterfaceNames()
        Returns:
        The list of names of required interfaces.
      • getRequiredInterfaceIds

        public java.util.List<java.lang.String> getRequiredInterfaceIds()
        Returns:
        The list of ids of required interfaces.
      • getProvidedInterfaces

        public java.util.Collection<java.lang.String> getProvidedInterfaces()
        Returns:
        The collection of provided interfaces.
      • getParameters

        public ai.libs.jaicore.basic.sets.PartialOrderedSet<Parameter> getParameters()
        Returns:
        The set of parameters of this Component.
      • getParameterWithName

        public Parameter getParameterWithName​(java.lang.String paramName)
        Returns the parameter for a given name.
        Parameters:
        paramName - The name of the parameter to be returned.
        Returns:
        The parameter for the given name.
      • getDependencies

        public java.util.Collection<Dependency> getDependencies()
        Returns:
        The collection of dependencies on the parameters of this Component.
      • addProvidedInterface

        public boolean addProvidedInterface​(java.lang.String interfaceName)
        Adds another provided interface to the collection of provided interfaces.
        Parameters:
        interfaceName - The interface to be added to the provided interfaces.
      • addRequiredInterface

        public void addRequiredInterface​(java.lang.String interfaceID,
                                         java.lang.String interfaceName,
                                         java.lang.Integer min,
                                         java.lang.Integer max)
        Adds an additional required interface with an ID (local identifier) and an interface name (provided interface of another Component) to the required interfaces of this Component.
        Parameters:
        interfaceID - The local identifier to reference the specific required interface.
        interfaceName - The provided interface of another component.
        min - Minimun times the interface is required?
        max - Maximum times the interface is required?
      • addRequiredInterface

        public void addRequiredInterface​(java.lang.String interfaceID,
                                         java.lang.String interfaceName)
      • addParameter

        public void addParameter​(Parameter param)
        Adds a parameter to the set of parameters iff the parameter or another parameter with the same name does not yet exist.
        Parameters:
        param - The parameter to be added.
      • addDependency

        public void addDependency​(Dependency dependency)
        Adds a dependency constraint to the dependencies of this Component.
        Parameters:
        dependency - The dependency to be added.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object