Package net.sourceforge.jFuzzyLogic.membership

Examples of net.sourceforge.jFuzzyLogic.membership.Value


   * @return A new membership function
   */
  private MembershipFunction fclTreeFuzzifyTermSingletonsPoints(Tree tree, int numberOfPoints) {
    if( debug ) Gpr.debug("Tree: " + tree.toStringTree());

    Value x[] = new Value[numberOfPoints];
    Value y[] = new Value[numberOfPoints];
    for( int childNum = 0; childNum < tree.getChildCount(); childNum++ ) {
      Tree child = tree.getChild(childNum);
      String leaveName = child.getText();
      if( debug ) Gpr.debug("Sub-Parsing: " + leaveName);

      // It's a set of points? => Defines a piece-wise linear membership function
      if( leaveName.equalsIgnoreCase("(") ) {
        x[childNum] = new Value(child.getChild(0), this); // Parse and add each point
        y[childNum] = new Value(child.getChild(1), this);

        if( (y[childNum].getValue() < 0) || (y[childNum].getValue() > 1) ) throw new RuntimeException("\n\tError parsing line " + child.getLine() + " character " + child.getCharPositionInLine() + ": Membership function out of range (should be between 0 and 1). Value: '" + y[childNum] + "'\n\tTree: " + child.toStringTree());

        if( debug ) Gpr.debug("Parsed point " + childNum + " x=" + x[childNum] + ", y=" + y[childNum]);
      } else throw new RuntimeException("Unknown (or unimplemented) option : " + leaveName);
View Full Code Here


   * @param tree : Tree to parse
   * @return A new membership function
   */
  private MembershipFunction fclTreeFuzzifyTermTrapetzoidal(Tree tree) {
    if( debug ) Gpr.debug("Tree: " + tree.toStringTree());
    Value min = new Value(tree.getChild(0), this);
    Value midLow = new Value(tree.getChild(1), this);
    Value midHigh = new Value(tree.getChild(2), this);
    Value max = new Value(tree.getChild(3), this);
    MembershipFunction membershipFunction = new MembershipFunctionTrapetzoidal(min, midLow, midHigh, max);
    return membershipFunction;
  }
View Full Code Here

   * @param tree : Tree to parse
   * @return A new membership function
   */
  private MembershipFunction fclTreeFuzzifyTermTriangular(Tree tree) {
    if( debug ) Gpr.debug("Tree: " + tree.toStringTree());
    Value min = new Value(tree.getChild(0), this);
    Value mid = new Value(tree.getChild(1), this);
    Value max = new Value(tree.getChild(2), this);
    MembershipFunction membershipFunction = new MembershipFunctionTriangular(min, mid, max);
    return membershipFunction;
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.jFuzzyLogic.membership.Value

Copyright © 2018 www.massapicom. 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.