当前位置: 首页>>代码示例>>Java>>正文


Java Evaluation.INCLUDE_AND_CONTINUE属性代码示例

本文整理汇总了Java中org.neo4j.graphdb.traversal.Evaluation.INCLUDE_AND_CONTINUE属性的典型用法代码示例。如果您正苦于以下问题:Java Evaluation.INCLUDE_AND_CONTINUE属性的具体用法?Java Evaluation.INCLUDE_AND_CONTINUE怎么用?Java Evaluation.INCLUDE_AND_CONTINUE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.neo4j.graphdb.traversal.Evaluation的用法示例。


在下文中一共展示了Evaluation.INCLUDE_AND_CONTINUE属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: evaluate

/**
 * Evaluates a node and determines whether to include and / or continue.
 * Continues on and returns exactly those nodes that:
 * <ul>
 *   <li>haven't been visited yet and</li>
 *   <li>are the start node
 *   <ul>
 *     <li>have a sequence &lt; threshold (and thus belong to the same cluster)</li>
 *   </ul>
 * </ul>
 */
@Override
public Evaluation evaluate(Path path) {
	Node end = path.endNode();
	int score = is.compute(new Neo4jScoreContainer(end));
	end.setProperty(SequenceProperties.INTERESTINGNESS.name(), score);
	String id = (String) end.getProperty(ID.name());

	if (!visited.contains(id)
			&& (path.startNode().getId() == path.endNode().getId()
			|| score < threshold)) {
		visited.add(id);
		return Evaluation.INCLUDE_AND_CONTINUE;
	}
	return Evaluation.EXCLUDE_AND_PRUNE;
}
 
开发者ID:ProgrammingLife2015,项目名称:dnainator,代码行数:26,代码来源:ClusterEvaluator.java

示例2: evaluate

@Override
public Evaluation evaluate(Path path, BranchState branchState) {
    if (path.endNode().hasLabel(stopLabel)) {
        return Evaluation.EXCLUDE_AND_PRUNE;
    } else {
        return Evaluation.INCLUDE_AND_CONTINUE;
    }
}
 
开发者ID:maxdemarzi,项目名称:cypher_hip_hop,代码行数:8,代码来源:HipHopEvaluator.java

示例3: evaluate

@Override
public Evaluation evaluate(Path path, BranchState<Double> branchState) {
    // Path with just the single node, ignore it and continue
    if (path.length() == 0 ) {
        return Evaluation.INCLUDE_AND_CONTINUE;
    }
    // Make sure last Equipment voltage is equal to or lower than previous voltage
    Double voltage = (Double) path.endNode().getProperty("voltage", 999.0);
    if (voltage <= branchState.getState()) {
        return Evaluation.INCLUDE_AND_CONTINUE;
    } else {
        return Evaluation.EXCLUDE_AND_PRUNE;
    }
}
 
开发者ID:maxdemarzi,项目名称:power_grid,代码行数:14,代码来源:EnergizationEvaluator.java

示例4: evaluate

@Override
public Evaluation evaluate(Path path) {
  long currentId = path.endNode().getId();
  if (!nodePredicate.apply(path.endNode())) {
    inMemoryIndex.get(currentId);
    return Evaluation.EXCLUDE_AND_PRUNE;
  }

  long startId = path.startNode().getId(); // Vi
  InOutList listPair = inMemoryIndex.get(currentId);

  if (0 == path.length()) {
    // first node in the traverse - add itself to the in-out list
    listPair.getInList().add(currentId);
    listPair.getOutList().add(currentId);
    return Evaluation.INCLUDE_AND_CONTINUE;
  }
  else if (direction == Direction.INCOMING ) {
    // doing reverse BFS
    if (nodesAreConnected(currentId, startId)) {
      return Evaluation.EXCLUDE_AND_PRUNE;
    } else {
      listPair.getOutList().add(startId);
      return Evaluation.INCLUDE_AND_CONTINUE;
    }
  } else {
    //doing BFS
    if (nodesAreConnected(startId, currentId)) { // cur is w
      return Evaluation.EXCLUDE_AND_PRUNE;
    } else {
      listPair.getInList().add(startId);
      return Evaluation.INCLUDE_AND_CONTINUE;
    }
  }
}
 
开发者ID:SciGraph,项目名称:SciGraph,代码行数:35,代码来源:ReachabilityEvaluator.java

示例5: evaluate

public Evaluation evaluate( Path path )
{
    // Before the Evaluator, when PruneEvaluator was used individually a PruneEvaluator
    // was never called with the start node as argument. This condition mimics that behaviour.
    if ( path.length() == 0 )
    {
        return Evaluation.INCLUDE_AND_CONTINUE;
    }
    return pruning.pruneAfter( path ) ? Evaluation.INCLUDE_AND_PRUNE : Evaluation.INCLUDE_AND_CONTINUE;
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:10,代码来源:TraversalDescriptionImpl.java

示例6: evaluate

@Override
public Evaluation evaluate(Path path) {
  Node n = path.endNode();
  UsageFacts facts = dao.readFacts(n.getId());
  int size = facts == null ? -1 : facts.metrics.getNumDescendants() + facts.metrics.getNumSynonyms();
  if (size > minChunkSize && (size < chunkSize || size - facts.metrics.getNumChildren() < minChunkSize)) {
    chunkIds.add(n.getId());
    return Evaluation.INCLUDE_AND_PRUNE;
  } else {
    return Evaluation.INCLUDE_AND_CONTINUE;
  }
}
 
开发者ID:gbif,项目名称:checklistbank,代码行数:12,代码来源:ChunkingEvaluator.java

示例7: evaluate

@Override
public Evaluation evaluate( Path path, BranchState<StepState> state )
{
    int currentStep = state.getState().step();
    int stepStateState = state.getState().state();
    while ( true )
    {
        StepEvaluationResult result = stepEvaluators[currentStep].evaluate( path, stepStateState );
        switch ( result.stepEvaluation() )
        {
        case REJECT_STAY_EXCLUDE_PRUNE:
            /*
             * evaluator failed fatally
             */
            return Evaluation.EXCLUDE_AND_PRUNE;
        case REJECT_ADVANCE_EXCLUDE_CONTINUE:
            /*
             * evaluator failed & exhausted
             * advance evaluator immediately (current step) & retry
             */
            currentStep++;
            stepStateState = result.stepState();
            continue;
        case ACCEPT_ADVANCE_EXCLUDE_CONTINUE:
            /*
             * evaluator succeeded & exhausted
             * advance evaluator for next step
             */
            currentStep++;
            state.setState( new StepState( currentStep, result.stepState() ) );
            return Evaluation.EXCLUDE_AND_CONTINUE;
        case ACCEPT_STAY_EXCLUDE_CONTINUE:
            /*
             * evaluator succeeded but not exhausted
             * reuse evaluator @ next step
             */
            state.setState( new StepState( currentStep, result.stepState() ) );
            return Evaluation.EXCLUDE_AND_CONTINUE;
        case ACCEPT_STAY_INCLUDE_CONTINUE:
            /*
             * final evaluator succeeded but not exhausted
             * return path & reuse evaluator @ next step
             */
            state.setState( new StepState( currentStep, result.stepState() ) );
            return Evaluation.INCLUDE_AND_CONTINUE;
        case ACCEPT_ADVANCE_INCLUDE_PRUNE:
            /*
             * final evaluator succeeded & exhausted
             * return path
             */
            return Evaluation.INCLUDE_AND_PRUNE;
        }
    }
}
 
开发者ID:alexaverbuch,项目名称:steps,代码行数:54,代码来源:StepsEvaluator.java

示例8: evaluate

@Override
public Evaluation evaluate(Path path) {
  Node end = path.endNode();
  Rank r = Rank.values()[(int) end.getProperty(NeoProperties.RANK, Rank.UNRANKED.ordinal())];
  return r.isLinnean() ? Evaluation.INCLUDE_AND_CONTINUE : Evaluation.EXCLUDE_AND_CONTINUE;
}
 
开发者ID:gbif,项目名称:checklistbank,代码行数:6,代码来源:LinneanRankEvaluator.java

示例9: evaluate

@Override
public Evaluation evaluate(Path path) {
  Node end = path.endNode();
  return end.hasLabel(Labels.SYNONYM) ? Evaluation.EXCLUDE_AND_CONTINUE : Evaluation.INCLUDE_AND_CONTINUE;
}
 
开发者ID:gbif,项目名称:checklistbank,代码行数:5,代码来源:AcceptedOnlyEvaluator.java

示例10: evaluate

@Override
public Evaluation evaluate(Path path) {
  return evaluateNode(path.endNode()) ? Evaluation.INCLUDE_AND_CONTINUE : Evaluation.EXCLUDE_AND_CONTINUE;
}
 
开发者ID:gbif,项目名称:checklistbank,代码行数:4,代码来源:RankEvaluator.java


注:本文中的org.neo4j.graphdb.traversal.Evaluation.INCLUDE_AND_CONTINUE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。