@Override
 public boolean evaluate(ConceptAnnotation annotation) {
   if (stycodeset.size() == 0) {
     return true;
   } else {
     Set<String> stycodes = JsonUtils.stringToMap(annotation.getStycodes()).keySet();
     return (CollectionUtils.intersection(stycodeset, stycodes).size() > 0);
   }
 }
Exemplo n.º 2
0
 /**
  * get a vertex from a list.
  *
  * <p>priority: 1. vertices in considerableCandidateVertices4DS; 2. vertices in vertex cover 3.
  * the highest degree one ;
  *
  * @param verList
  * @return
  */
 private Integer getVertexFromCandiateMap(List<Integer> verList) {
   List<Integer> interConsider =
       (List<Integer>) CollectionUtils.intersection(verList, considerableCandidateVertices4DS);
   if (interConsider != null && !interConsider.isEmpty()) {
     return interConsider.get(0);
   }
   interConsider = (List<Integer>) CollectionUtils.intersection(verList, vertexCover);
   if (interConsider != null && !interConsider.isEmpty()) {
     return interConsider.get(0);
   }
   // List<VertexDegree> vdList =
   // AlgorithmUtil.sortVertexAccordingToDegreeInclude(this.g, verList);
   // return vdList.get(0).getVertex();
   IPriorityOrder<Integer, String> pocb = new DegreeDesc<Integer, String>();
   List<Integer> allVList =
       pocb.getOrderedVertexList(new PriorityBean<Integer, String>(g, null, null));
   for (Integer v : allVList) {
     if (verList.contains(v)) {
       return v;
     }
   }
   return null;
 }