Examples of FclObject


Examples of net.sourceforge.jFuzzyLogic.fcl.FclObject

      parameters[i] = new Value();

    //---
    // Create function tree
    //---
    FclObject fun = createFuncionTree(functionBlock, tree);

    // First item (tree's root) is a function? => Ok add tree
    if( fun instanceof MffFunction ) function = (MffFunction) fun;
    else {
      // First item is NOT a function (e.g. a variable or a double)? => Make it a function (using 'Nop')
      FclObject args[] = new FclObject[1];
      args[0] = fun;
      function = new MffNop(functionBlock, args);
    }
  }
View Full Code Here

Examples of net.sourceforge.jFuzzyLogic.fcl.FclObject

    if( debug ) Gpr.debug("Tree: " + tree.toStringTree());
    String treeName = tree.getText().toUpperCase();

    // Select appropriate function (and create it)
    if( treeName.equals("+") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffSum(functionBlock, terms);
    } else if( treeName.equals("-") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffSubstract(functionBlock, terms);
    } else if( treeName.equals("*") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffTimes(functionBlock, terms);
    } else if( treeName.equals("/") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffDivide(functionBlock, terms);
    } else if( treeName.equals("^") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffPow(functionBlock, terms);
    } else if( treeName.equals("%") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffModulus(functionBlock, terms);
    } else if( treeName.equalsIgnoreCase("exp") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffExp(functionBlock, terms);
    } else if( treeName.equalsIgnoreCase("ln") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffLn(functionBlock, terms);
    } else if( treeName.equalsIgnoreCase("log") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffLog(functionBlock, terms);
    } else if( treeName.equalsIgnoreCase("sin") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffSin(functionBlock, terms);
    } else if( treeName.equalsIgnoreCase("cos") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffCos(functionBlock, terms);
    } else if( treeName.equalsIgnoreCase("tan") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffTan(functionBlock, terms);
    } else if( treeName.equalsIgnoreCase("abs") ) {
      FclObject terms[] = parseTerms(functionBlock, tree);
      return new MffAbs(functionBlock, terms);
    } else {
      // Parse it as a 'Value'
      return new Value(tree, functionBlock);
    }
View Full Code Here

Examples of net.sourceforge.jFuzzyLogic.fcl.FclObject

  private FclObject[] parseTerms(FunctionBlock functionBlock, Tree tree) {
    if( debug ) Gpr.debug("Tree:" + tree.toStringTree());

    Tree child = tree.getChild(0);
    int numberOfChilds = tree.getChildCount();
    FclObject terms[] = new FclObject[numberOfChilds];

    for( int i = 0; i < numberOfChilds; i++ ) {
      child = tree.getChild(i);
      if( debug ) Gpr.debug("\t\tChild:" + child.toStringTree());
      terms[i] = createFuncionTree(functionBlock, child);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.