Class ConfigurableParameter<F>

  • Type Parameters:
    F -
    Direct Known Subclasses:
    ConfigurableParameterGraphElement, ConfigurableParameterInteger

    public abstract class ConfigurableParameter<F>
    extends java.lang.Object
    A configurable parameter has a name (getId()), a domain that is either given as discrete enumeration or as a range of values in an interval, and a default value.
    Author:
    dfahland
    • Constructor Detail

      • ConfigurableParameter

        public ConfigurableParameter​(java.lang.String id,
                                     F[] values,
                                     F defaultValue)
                              throws InvalidConfigurationException
        Create new configurable parameter ranging over a discrete domain of values, wit given default value.
        Parameters:
        element -
        values -
        defaultValue -
        Throws:
        InvalidConfigurationException
      • ConfigurableParameter

        public ConfigurableParameter​(java.lang.String id,
                                     F min,
                                     F max,
                                     F defaultValue)
                              throws InvalidConfigurationException
        Create a new configurable parameter ranging over values from the given interval with a given default value.
        Parameters:
        element -
        min -
        max -
        defaultValue -
        Throws:
        InvalidConfigurationException
    • Method Detail

      • setIntervalDomain

        public void setIntervalDomain​(F min,
                                      F max)
        Set a range of values the feature can take.
        Parameters:
        min -
        max -
      • getIntervalMin

        public F getIntervalMin()
        Returns:
        minimum value if domain is an interval (isIntervalDomain())
      • getIntervalMax

        public F getIntervalMax()
        Returns:
        maximum value if domain is an interval (isIntervalDomain())
      • setDiscreteDomain

        public void setDiscreteDomain​(F[] values)
        Set a list of values the feature can take.
        Parameters:
        values -
      • getDiscreteDomain

        public F[] getDiscreteDomain()
        Returns:
        list of values, if domain is discrete (isIntervalDomain())
      • isIntervalDomain

        public boolean isIntervalDomain()
        Returns:
        true iff domain of the feature is an interval domain (this is the case when setIntervalDomain(Object, Object) is used to set the domain), and false iff domain of the feature is a discrete domain (this is the case when setDiscreteDomain(Object[]) is used to set the domain)
      • getValue

        public F getValue()
        Returns:
        currently chosen value of the feature
      • isValidValue

        public boolean isValidValue​(F value)
        Parameters:
        value -
        Returns:
        true iff the given value is in the domain of the feature
      • isValidIntervalValue

        protected abstract boolean isValidIntervalValue​(F value)
      • getId

        public java.lang.String getId()
      • setId

        public void setId​(java.lang.String id)