fuzzydl

## Class FeatureFunction

- java.lang.Object
- - fuzzydl.FeatureFunction

-     public class FeatureFunction
      extends java.lang.Object

  Function involving several features.
  Author:
    Fernando Bobillo

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ATOMIC` Feature.
    `static int` | `NUMBER` Number
    `static int` | `PRODUCT` Product of a number and a feature.
    `static int` | `SUBSTRACTION` Substraction function.
    `static int` | `SUM` Sum function.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FeatureFunction(java.util.ArrayList<FeatureFunction> featureList)` Constructor for the function (feature1 + feature2 + ... + featureN)
    `FeatureFunction(double n)` Constructor for the function (n)
    `FeatureFunction(double n, FeatureFunction feature)` Constructor for the function (n * feature)
    `FeatureFunction(FeatureFunction feature1, FeatureFunction feature2)` Constructor for the function (feature1 - feature2)
    `FeatureFunction(java.lang.String feature)` Constructor for the function (feature)

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.HashSet<java.lang.String>` | `getFeatures()` Gets an array of features that take part in the function.
    `double` | `getNumber()` Gets the parameter n of the function.
    `int` | `getType()` Gets the type of the function.
    `Expression` | `toExpression(Individual a, MILPHelper milp)` Returns a Expression representing the function.
    `java.lang.String` | `toString()` Gets the name of the object.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### ATOMIC

          public static final int ATOMIC

      Feature.
      See Also:
        Constant Field Values

    - #### NUMBER

          public static final int NUMBER

      Number
      See Also:
        Constant Field Values

    - #### SUM

          public static final int SUM

      Sum function.
      See Also:
        Constant Field Values

    - #### SUBSTRACTION

          public static final int SUBSTRACTION

      Substraction function.
      See Also:
        Constant Field Values

    - #### PRODUCT

          public static final int PRODUCT

      Product of a number and a feature.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FeatureFunction

          public FeatureFunction(java.lang.String feature)

      Constructor for the function (feature)
      Parameters:
        `feature` - Feature.

    - #### FeatureFunction

          public FeatureFunction(double n,
                                 FeatureFunction feature)

      Constructor for the function (n * feature)
      Parameters:
        `feature` - Feature.
        `n` - Constant.

    - #### FeatureFunction

          public FeatureFunction(double n)

      Constructor for the function (n)
      Parameters:
        `n` - Constant.

    - #### FeatureFunction

          public FeatureFunction(FeatureFunction feature1,
                                 FeatureFunction feature2)

      Constructor for the function (feature1 - feature2)
      Parameters:
        `feature1` - Minuhend feature.
        `feature2` - Subtracted feature.

    - #### FeatureFunction

          public FeatureFunction(java.util.ArrayList<FeatureFunction> featureList)

      Constructor for the function (feature1 + feature2 + ... + featureN)
      Parameters:
        `featureList` - List of features to be added.

  - ### Method Detail

    - #### getType

          public int getType()

      Gets the type of the function.
      Returns:
        Type of the function.

    - #### getNumber

          public double getNumber()

      Gets the parameter n of the function.
      Returns:
        Parameter n of the function.

    - #### getFeatures

          public java.util.HashSet<java.lang.String> getFeatures()

      Gets an array of features that take part in the function.
      Returns:
        Features that take part in the function..

    - #### toExpression

          public Expression toExpression(Individual a,
                                         MILPHelper milp)

      Returns a Expression representing the function.
      Parameters:
        `a` - Subject individual of the features.
        `milp` - Instance of the MILPHelper class.
      Returns:
        An expression representing the function.

    - #### toString

          public java.lang.String toString()

      Gets the name of the object.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        Name of the object.