Class Function
java.lang.Object
com.adriangarcia.metaheuristics.tsmbfoa.Function
Function class the xxxx class is in charge of evaluating the
mathematical expressions, it uses the mXparse library to do this function.
- Version:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected double
evaluateConstraints
(String type, int index) protected double
evaluateObjectiveFunction
(double[] values) String[]
getArgs()
protected byte
protected String
getError()
protected ArrayList<Expression>
protected ArrayList<Expression>
protected Expression
protected String[]
protected void
print Errorprotected void
protected void
setConstraints
(String[][] constraintsD, String[][] constraintsI) protected void
setExpressionConstEquality
(ArrayList<Expression> expressionConstEquality) protected void
setExpressionConstInequality
(ArrayList<Expression> expressionConstInequality) protected void
setExpressionOF
(Expression expressionOF) protected void
setFuncion
(String function, String[] variables) protected void
setVariables
(String[] variables)
-
Constructor Details
-
Function
protected Function()Método constructor vacio, para despues parsear la Expresión. -
Function
Constructor method for parsing the function.- Parameters:
function
- A String that is a function:
e.g: (N+2)*D*d^2variables
- A String containing the ordered design variables:
e.g: d,D,N
-
-
Method Details
-
setFuncion
- Parameters:
function
- functionvariables
- variables
-
evaluateObjectiveFunction
protected double evaluateObjectiveFunction(double[] values) - Parameters:
values
- values- Returns:
- double
-
setConstraints
- Parameters:
constraintsD
- constraintsDconstraintsI
- constraintsI
-
evaluateConstraints
- Parameters:
type
- typeindex
- index- Returns:
- double
-
getError
- Returns:
- Error
-
printError
protected void printError()print Error -
getCOD_ERROR
protected byte getCOD_ERROR()- Returns:
- the COD_ERROR
-
getVariables
- Returns:
- the variables
-
getExpressionOF
- Returns:
- the expressionOF
-
setExpressionOF
- Parameters:
expressionOF
- the expressionOF to set
-
getExpressionConstEquality
- Returns:
- the expressionConstEquality
-
setExpressionConstEquality
- Parameters:
expressionConstEquality
- the expressionConstEquality to set
-
getExpressionConstInequality
- Returns:
- the expressionConstInequality
-
setExpressionConstInequality
- Parameters:
expressionConstInequality
- the expressionConstInequality to set
-
setVariables
- Parameters:
variables
- the variables to set
-
getArgs
- Returns:
- the args
-
setArgs
- Parameters:
args
- the args to set
-