Beispiel #1
0
  /**
   * Calculates the coreDistance for the specified DataObject. The returned list contains three
   * elements: At index=0 --> list with all k next-neighbours; At index=1 --> list with all
   * dataObjects within epsilon; At index=2 --> coreDistance as Double-value
   *
   * @param minPoints minPoints-many neighbours within epsilon must be found to have a non-undefined
   *     coreDistance
   * @param epsilon Specifies the range for the query
   * @param dataObject Calculate coreDistance for this dataObject
   * @return list with the k-next neighbours (PriorityQueueElements) and a list with candidates from
   *     the epsilon-range-query (EpsilonRange_ListElements) and the double-value for the calculated
   *     coreDistance
   */
  public List coreDistance(int minPoints, double epsilon, DataObject dataObject) {
    List list = k_nextNeighbourQuery(minPoints, epsilon, dataObject);

    if (((List) list.get(1)).size() < minPoints) {
      list.add(new Double(DataObject.UNDEFINED));
      return list;
    } else {
      List nextNeighbours_List = (List) list.get(0);
      PriorityQueueElement priorityQueueElement =
          (PriorityQueueElement) nextNeighbours_List.get(nextNeighbours_List.size() - 1);
      if (priorityQueueElement.getPriority() <= epsilon) {
        list.add(new Double(priorityQueueElement.getPriority()));
        return list;
      } else {
        list.add(new Double(DataObject.UNDEFINED));
        return list;
      }
    }
  }