Package net.sourceforge.jFuzzyLogic

Examples of net.sourceforge.jFuzzyLogic.FIS


    "   RULE 3 : IF service IS excellent AND food IS delicious THEN tip is generous;\n" + //
    "END_RULEBLOCK\n" + //
    "\n" + //
    "END_FUNCTION_BLOCK\n";

    FIS fis = FIS.createFromString(fcl, true);
    System.out.println(fis);

    // Create a plot
    JDialogFis jdf = new JDialogFis(fis, 800, 600);

    // Set different values for 'food' and 'service'. Evaluate the system and show variables
    for( double service = 0.0, food = 1; service <= 10; service += 0.1 ) {
      food = service;
      // Evaluate system using these parameters
      fis.getVariable("service").setValue(service);
      fis.getVariable("food").setValue(food);
      fis.evaluate();

      // Print result & update plot
      System.out.println(String.format("Service: %2.2f\tfood:%2.2f\t=> tip: %2.2f %%", service, food, fis.getVariable("tip").getValue()));
      jdf.repaint();

      // Small delay
      Thread.sleep(100);
    }
View Full Code Here


        "   RULE 3 : IF service IS excellent AND food IS delicious THEN tip is generous;\n" + //
        "END_RULEBLOCK\n" + //
        "\n" + //
        "END_FUNCTION_BLOCK\n";

    FIS fis = FIS.createFromString(fcl, true);
    FunctionBlock functionBlock = fis.getFunctionBlock("tipper");
    functionBlock.chart();

    // Set inputs
    functionBlock.setVariable("service", 3);
    functionBlock.setVariable("food", 7);
View Full Code Here

public class TestTipper {

  public static void main(String[] args) throws Exception {
    // Load from 'FCL' file
    String fileName = "fcl/tipper.fcl";
    FIS fis = FIS.load(fileName, true);
    if( fis == null ) { // Error while loading?
      System.err.println("Can't load file: '" + fileName + "'");
      return;
    }

    // Show ruleset
    FunctionBlock functionBlock = fis.getFunctionBlock(null);
    functionBlock.chart();

    // Set inputs
    functionBlock.setVariable("service", 3);
    functionBlock.setVariable("food", 7);
View Full Code Here

        // Create a plot
        if (fisPanel != null) {
            System.out.println(" Remove existing fis panel");
            fuzzyLayout.getTabPanel().remove(fisPanel);
        }
        FIS fis = fuzzyController.getFis();
        List<Variable> list = fuzzyController.getVariables();
        fisPanel = new DemoPanelFis(fuzzyController.getVariables(), list.size(), 1);
        fuzzyLayout.getTabPanel().add("Graphs", fisPanel);
    }
View Full Code Here

    //            init();
    //        }
  }

  public void reload(String str) {
    FIS newfis;
    try {
      newfis = FIS.createFromString(str, true);
      fis = newfis;
      fisString = str;
      //          functionBlock = fis.getFunctionBlock(null);
View Full Code Here

   
   
    public static void main(String args[]) {
        InputStream inputStream=Test.class.getResourceAsStream("ip2.fcl");
       
        FIS fis=FIS.load(inputStream, true);
       
    }
View Full Code Here

    System.out.println("ParameterOptimizationDemo: Begin");

    //---
    // Load FIS (Fuzzy Inference System)
    //---
    FIS fis = FIS.load("fcl/qualify.fcl");
    FunctionBlock functionBlock = fis.getFunctionBlock(null);
    // functionBlock.chart();
    RuleBlock ruleBlock = functionBlock.getFuzzyRuleBlock(null);

    //---
    // Create a list of parameter to optimize
View Full Code Here

  public TestExecutioner() {}

  public List<Double> execute(String fileName, String[] inputVariables, int steps, int stepSize) {

    // Load FIS
    FIS fis = FIS.load(fileName, false);
    if( fis == null ) { // Error while loading?
      System.err.println("Can't load file: '" + fileName + "'");
      return null;
    }

    FunctionBlock functionBlock = fis.getFunctionBlock(null);

    // Time recording
    List<Double> timeRecords = new ArrayList<Double>();
    long startTime;
    int curStep = 0;
View Full Code Here

TOP

Related Classes of net.sourceforge.jFuzzyLogic.FIS

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.