home Forums # Technical Support How to pass input variable to fuzzy function and get out put result

Tagged: 

This topic contains 0 replies, has 1 voice, and was last updated by Chandana Chandana 1 year, 9 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2595
    Chandana
    Chandana
    Participant

    I did below sample program for testing.

    How can pass input variable to fuzzy function and get out put result.

    public class Test {

    public static void main(String[] args) {

    String inputOne = “colorOne”;
    String inputTwo = “ColorTwo”;
    String output = fuzzyFuction(inputOne, inputTwo);
    System.out.println(output);

    }

    private static String fuzzyFuction(String inputOne, String inputTwo) {

    String configurationFile = “E:\\Test\\src\\ObstacleAvoidance.fll”;
    Engine engine = null;
    try {
    engine = new FllImporter().fromFile(new File(configurationFile));
    } catch (Exception ex) {
    FuzzyLite.logger().log(Level.SEVERE, ex.toString(), ex);
    }
    System.out.println(new JavaExporter().toString(engine)); //this will print the engine in Java code
    return null;

    }
    }

    Engine: ObstacleAvoidance
    InputVariable: obstacle
    enabled: true
    range: 0.000 1.000
    lock-range: false
    term: left Ramp 1.000 0.000
    term: right Ramp 0.000 1.000
    OutputVariable: mSteer
    enabled: true
    range: 0.000 1.000
    lock-range: false
    aggregation: Maximum
    defuzzifier: Centroid 100
    default: nan
    lock-previous: false
    term: left Ramp 1.000 0.000
    term: right Ramp 0.000 1.000
    RuleBlock: mamdani
    enabled: true
    conjunction: none
    disjunction: none
    implication: AlgebraicProduct
    activation: General
    rule: if obstacle is left then mSteer is right
    rule: if obstacle is right then mSteer is left

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.