Package org.drools.analytics.components

Examples of org.drools.analytics.components.PatternPossibility


    LiteralRestriction lr1 = new LiteralRestriction();
    lr1.setRuleName(ruleName1);
    LiteralRestriction lr2 = new LiteralRestriction();
    lr2.setRuleName(ruleName1);

    PatternPossibility pp1 = new PatternPossibility();
    pp1.setRuleName(ruleName1);
    pp1.add(lr1);
    pp1.add(lr2);

    LiteralRestriction lr3 = new LiteralRestriction();
    lr3.setRuleName(ruleName2);

    PatternPossibility pp2 = new PatternPossibility();
    pp2.setRuleName(ruleName2);
    pp2.add(lr3);

    Redundancy redundancy1 = new Redundancy(lr1, lr3);

    PartialRedundancy pr1 = new PartialRedundancy(pp1, pp2, redundancy1);
    PartialRedundancy pr2 = new PartialRedundancy(pp2, pp1, redundancy1);
View Full Code Here


  private Collection<Object> createSubsumptantRuleData(String ruleName1,
      String ruleName2) {

    Collection<Object> data = new ArrayList<Object>();

    PatternPossibility pp1 = new PatternPossibility();
    pp1.setRuleName(ruleName1);
    PatternPossibility pp2 = new PatternPossibility();
    pp2.setRuleName(ruleName1);

    RulePossibility rp1 = new RulePossibility();
    rp1.setRuleName(ruleName1);
    rp1.add(pp1);
    rp1.add(pp2);

    PatternPossibility pp3 = new PatternPossibility();
    pp3.setRuleName(ruleName2);

    RulePossibility rp2 = new RulePossibility();
    rp2.setRuleName(ruleName2);
    rp2.add(pp3);
View Full Code Here

    patternSolver.add(restriction);
  }

  private void createPatternPossibilities() {
    for (Set<AnalyticsComponent> list : patternSolver.getPossibilityLists()) {
      PatternPossibility possibility = new PatternPossibility();

      possibility.setRuleId(ruleSolver.getRule().getId());
      possibility.setRuleName(ruleSolver.getRule().getRuleName());
      possibility.setPatternId(patternSolver.getPattern().getId());

      for (AnalyticsComponent descr : list) {
        possibility.add((Restriction) descr);
      }

      ruleSolver.add(possibility);
      patternPossibilities.add(possibility);
    }
View Full Code Here

      possibility.setRuleId(ruleSolver.getRule().getId());
      possibility.setRuleName(ruleSolver.getRule().getRuleName());

      for (AnalyticsComponent descr : list) {
        PatternPossibility patternPossibility = (PatternPossibility) descr;
        possibility.add(patternPossibility);
      }

      rulePossibilities.add(possibility);
    }
View Full Code Here

    List<Restriction> result2 = new ArrayList<Restriction>();
    result2.add(r3);
    result2.add(r4);

    Object[] possibilies = list.get(0).getItems().toArray();
    PatternPossibility p1 = (PatternPossibility) possibilies[0];
    PatternPossibility p2 = (PatternPossibility) possibilies[1];

    /*
     * Order may change but it doesn't matter.
     */
    if (p1.getItems().containsAll(result)) {
      assertTrue(p2.getItems().containsAll(result2));
    } else if (p1.getItems().containsAll(result2)) {
      assertTrue(p2.getItems().containsAll(result));
    } else {
      fail("No items found.");
    }
  }
View Full Code Here

    result.add(r);
    result.add(r2);

    Set<Cause> set = list.get(0).getItems();
    for (Cause cause : set) {
      PatternPossibility possibility = (PatternPossibility) cause;
      assertTrue(possibility.getItems().containsAll(result));
    }
  }
View Full Code Here

    AnalyticsRule r1 = new AnalyticsRule();
    r1.setRuleName(ruleName1);
    AnalyticsRule r2 = new AnalyticsRule();
    r2.setRuleName(ruleName2);

    PatternPossibility pp1 = new PatternPossibility();
    pp1.setRuleName(ruleName1);
    PatternPossibility pp2 = new PatternPossibility();
    pp2.setRuleName(ruleName2);

    RulePossibility rp1 = new RulePossibility();
    rp1.setRuleId(r1.getId());
    rp1.setRuleName(ruleName1);
    rp1.add(pp1);
View Full Code Here

    session.setGlobal("result", analysisResult);

    String ruleName1 = "Rule 1";
    String ruleName2 = "Rule 2";

    PatternPossibility pp1 = new PatternPossibility();
    pp1.setRuleName(ruleName1);

    PatternPossibility pp2 = new PatternPossibility();
    pp2.setRuleName(ruleName2);

    Subsumption s1 = new Subsumption(pp1, pp2);
    Subsumption s2 = new Subsumption(pp2, pp1);

    data.add(pp1);
View Full Code Here

    LiteralRestriction lr1 = new LiteralRestriction();
    lr1.setRuleName(ruleName1);
    LiteralRestriction lr2 = new LiteralRestriction();
    lr2.setRuleName(ruleName2);

    PatternPossibility pp1 = new PatternPossibility();
    pp1.setPatternId(p1.getId());
    pp1.setRuleName(ruleName1);
    pp1.add(lr1);

    PatternPossibility pp2 = new PatternPossibility();
    pp2.setPatternId(p2.getId());
    pp2.setRuleName(ruleName2);
    pp2.add(lr2);

    Redundancy r1 = new Redundancy(lr1, lr2);
    Redundancy r2 = new Redundancy(p1, p2);

    data.add(p1);
View Full Code Here

TOP

Related Classes of org.drools.analytics.components.PatternPossibility

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.