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


Java Evaluation类代码示例

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


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

示例1: getPatternMatch

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
private Traverser getPatternMatch(Node startNode, final List<String> patterns, final List<NodeLabel> nodeLabels, final List<LinkLabel> linkLabels) {
	TraversalDescription td = database.traversalDescription()
		.depthFirst()
		.evaluator( new Evaluator() {
			public Evaluation evaluate( final org.neo4j.graphdb.Path path ) {
                if ( path.length() == 0 ) {
                    return Evaluation.EXCLUDE_AND_CONTINUE;
                }
                boolean isToken = path.endNode().hasLabel(NodeLabel.WordToken);
                boolean included = isToken && (path.length() == 1 || nodeHasAnnotation(path.endNode(), linkLabels.get(path.length() - 1), patterns.get(path.length() - 1)));
                boolean continued = path.length() < patterns.size();
                return Evaluation.of( included, continued );
            }
        } )
		.relationships(LinkLabel.NEXT, Direction.OUTGOING)
		.relationships(LinkLabel.HAS_TYPE, Direction.INCOMING)
		.relationships(LinkLabel.HAS_LEMMA, Direction.INCOMING)
		.relationships(LinkLabel.HAS_POS_TAG, Direction.INCOMING)
		.relationships(LinkLabel.HAS_HEAD, Direction.INCOMING);
	return td.traverse(startNode);
}
 
开发者ID:Taalmonsters,项目名称:WhiteLab2.0-Neo4J-Plugin,代码行数:22,代码来源:QueryBenchmark.java

示例2: evaluate

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
/**
 * 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,代码行数:27,代码来源:ClusterEvaluator.java

示例3: evaluate

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
public Evaluation evaluate( Path position )
{
    boolean includes = true;
    boolean continues = true;
    for ( Evaluator evaluator : this.evaluators )
    {
        Evaluation bla = evaluator.evaluate( position );
        if ( !bla.includes() )
        {
            includes = false;
        }
        if ( !bla.continues() )
        {
            continues = false;
        }
        if ( !continues && !includes )
        {
            return Evaluation.EXCLUDE_AND_PRUNE;
        }
    }
    return Evaluation.of( includes, continues );
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:23,代码来源:MultiEvaluator.java

示例4: evaluate

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
@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,代码行数:9,代码来源:HipHopEvaluator.java

示例5: evaluate

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
@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,代码行数:15,代码来源:EnergizationEvaluator.java

示例6: evaluate

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
@Override
public Evaluation evaluate(Path path) {
    Node lastNode = path.endNode();
    if (!lastNode.hasLabel(Labels.AirportDay)){
        return Evaluation.EXCLUDE_AND_CONTINUE;
    } else if (destinations.contains( ((String)lastNode.getProperty("key")).substring(0,3) )) {
        return Evaluation.INCLUDE_AND_PRUNE;
    }
    return Evaluation.EXCLUDE_AND_CONTINUE;
}
 
开发者ID:maxdemarzi,项目名称:neo_airlines,代码行数:11,代码来源:ReachedDestinationEvaluator.java

示例7: evaluate

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
@Override
public Evaluation evaluate(Path path) {
    if (path.length() < length) {
        return Evaluation.EXCLUDE_AND_CONTINUE;
    }

    Node lastNode = path.endNode();
    if (!lastNode.hasLabel(Labels.AirportDay)){
        return Evaluation.EXCLUDE_AND_CONTINUE;
    } else if (destinations.contains( ((String)lastNode.getProperty("key")).substring(0,3) )) {
        return Evaluation.INCLUDE_AND_PRUNE;
    }
    return Evaluation.EXCLUDE_AND_PRUNE;
}
 
开发者ID:maxdemarzi,项目名称:neo_airlines,代码行数:15,代码来源:ReachedDestinationAtEvaluator.java

示例8: evaluate

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
@Override
public Evaluation evaluate(Path path) {
    if (!path.endNode().hasRelationship(Direction.OUTGOING)) {
        leaves++;
        depthSum += path.length();
    }

    return Evaluation.EXCLUDE_AND_CONTINUE;
}
 
开发者ID:Glamdring,项目名称:welshare,代码行数:10,代码来源:ViralLinkDaoNeo4j.java

示例9: evaluate

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
@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,代码行数:36,代码来源:ReachabilityEvaluator.java

示例10: evaluate

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
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,代码行数:11,代码来源:TraversalDescriptionImpl.java

示例11: evaluate

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
@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,代码行数:13,代码来源:ChunkingEvaluator.java

示例12: printResult

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
private Evaluation printResult( Evaluation evaluation )
{
    System.out.print( String.format( " %s\n", evaluation.name() ) );
    return evaluation;
}
 
开发者ID:sarmbruster,项目名称:unmanaged-extension,代码行数:6,代码来源:TraversalPrinter.java

示例13: evaluate

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
public Evaluation evaluate( Path path )
{
    printPath( path );
    return printResult( innerEvaluator.evaluate( path ) );
}
 
开发者ID:sarmbruster,项目名称:unmanaged-extension,代码行数:6,代码来源:TraversalPrinter.java

示例14: evaluate

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
@Override
public Evaluation evaluate( Path path )
{
    // TODO deal with this in better way
    throw new UnsupportedOperationException();
}
 
开发者ID:alexaverbuch,项目名称:steps,代码行数:7,代码来源:StepsEvaluator.java

示例15: evaluation

import org.neo4j.graphdb.traversal.Evaluation; //导入依赖的package包/类
public Evaluation evaluation()
{
    return evaluation;
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:5,代码来源:TraversalBranchImpl.java


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