示例#1
0
  /**
   * Returns if the classifier of the class subsumes the classifier passed as a parameter.
   *
   * @param cl is the subsumed classifier.
   * @return a boolean indicating if it subsumes
   */
  public boolean doesSubsume(Classifier cl) {
    int i;

    // First, check if the condition is the same
    if (action != cl.getAction()) return false;

    // Then, check that is more general
    if (parameters.couldSubsume()) {
      for (i = 0; i < rep.length; i++) {
        if (!rep[i].isMoreGeneral(cl.rep[i])) return false;
      }
      return true;
    }
    return false;
  } // end doesSubsume
示例#2
0
  /**
   * Returns if the classifier of the class is equal to the classifier given as a parameter.
   *
   * @param cl is a classifier.
   * @return a boolean indicating if they are equals.
   */
  public boolean equals(Classifier cl) {
    int i;

    try {
      // Checking the action
      if (action != cl.getAction()) return false;

      // Checking the condition
      for (i = 0; i < rep.length; i++) {
        if (!rep[i].equals(cl.rep[i])) return false;
      }
      return true;

    } catch (Exception e) {
      return false;
    }
  } // end equals