本文整理汇总了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 < 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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
}
示例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;
}
示例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;
}
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例10: evaluate
@Override
public Evaluation evaluate(Path path) {
return evaluateNode(path.endNode()) ? Evaluation.INCLUDE_AND_CONTINUE : Evaluation.EXCLUDE_AND_CONTINUE;
}