public class FeatureFunction
extends java.lang.Object
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 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)
|
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.
|
public static final int ATOMIC
public static final int NUMBER
public static final int SUM
public static final int SUBSTRACTION
public static final int PRODUCT
public FeatureFunction(java.lang.String feature)
feature
- Feature.public FeatureFunction(double n, FeatureFunction feature)
feature
- Feature.n
- Constant.public FeatureFunction(double n)
n
- Constant.public FeatureFunction(FeatureFunction feature1, FeatureFunction feature2)
feature1
- Minuhend feature.feature2
- Subtracted feature.public FeatureFunction(java.util.ArrayList<FeatureFunction> featureList)
featureList
- List of features to be added.public int getType()
public double getNumber()
public java.util.HashSet<java.lang.String> getFeatures()
public Expression toExpression(Individual a, MILPHelper milp)
a
- Subject individual of the features.milp
- Instance of the MILPHelper class.public java.lang.String toString()
toString
in class java.lang.Object