Class Function

java.lang.Object
com.adriangarcia.metaheuristics.tsmbfoa.Function

public class Function extends Object
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 Details

    • Function

      protected Function()
      Método constructor vacio, para despues parsear la Expresión.
    • Function

      protected Function(String function, String[] variables)
      Constructor method for parsing the function.
      Parameters:
      function - A String that is a function:
      e.g: (N+2)*D*d^2
      variables - A String containing the ordered design variables:
      e.g: d,D,N
  • Method Details

    • setFuncion

      protected void setFuncion(String function, String[] variables)
      Parameters:
      function - function
      variables - variables
    • evaluateObjectiveFunction

      protected double evaluateObjectiveFunction(double[] values)
      Parameters:
      values - values
      Returns:
      double
    • setConstraints

      protected void setConstraints(String[][] constraintsD, String[][] constraintsI)
      Parameters:
      constraintsD - constraintsD
      constraintsI - constraintsI
    • evaluateConstraints

      protected double evaluateConstraints(String type, int index)
      Parameters:
      type - type
      index - index
      Returns:
      double
    • getError

      protected String getError()
      Returns:
      Error
    • printError

      protected void printError()
      print Error
    • getCOD_ERROR

      protected byte getCOD_ERROR()
      Returns:
      the COD_ERROR
    • getVariables

      protected String[] getVariables()
      Returns:
      the variables
    • getExpressionOF

      protected Expression getExpressionOF()
      Returns:
      the expressionOF
    • setExpressionOF

      protected void setExpressionOF(Expression expressionOF)
      Parameters:
      expressionOF - the expressionOF to set
    • getExpressionConstEquality

      protected ArrayList<Expression> getExpressionConstEquality()
      Returns:
      the expressionConstEquality
    • setExpressionConstEquality

      protected void setExpressionConstEquality(ArrayList<Expression> expressionConstEquality)
      Parameters:
      expressionConstEquality - the expressionConstEquality to set
    • getExpressionConstInequality

      protected ArrayList<Expression> getExpressionConstInequality()
      Returns:
      the expressionConstInequality
    • setExpressionConstInequality

      protected void setExpressionConstInequality(ArrayList<Expression> expressionConstInequality)
      Parameters:
      expressionConstInequality - the expressionConstInequality to set
    • setVariables

      protected void setVariables(String[] variables)
      Parameters:
      variables - the variables to set
    • getArgs

      public String[] getArgs()
      Returns:
      the args
    • setArgs

      protected void setArgs(String[] args)
      Parameters:
      args - the args to set