Exemplo n.º 1
0
        protected internal override Traverser InstantiateTraverser(Node start, Node end)
        {
            GraphDatabaseService db       = start.GraphDatabase;
            TraversalDescription sideBase = Db.traversalDescription().breadthFirst().uniqueness(NODE_PATH);

            return(Db.bidirectionalTraversalDescription().mirroredSides(sideBase.Expand(_expander)).sideSelector(LEVEL_STOP_DESCENT_ON_RESULT, _maxDepth).collisionEvaluator(toDepth(_maxDepth)).traverse(start, end));
        }
Exemplo n.º 2
0
        protected internal override Traverser InstantiateTraverser(Node start, Node end)
        {
            GraphDatabaseService db   = start.GraphDatabase;
            TraversalDescription side = Db.traversalDescription().breadthFirst().uniqueness(_uniqueness).order((startSource, _expander) => new LiteDepthFirstSelector(startSource, _startThreshold, _expander));

            return(Db.bidirectionalTraversalDescription().startSide(side.Expand(_expander).evaluator(toDepth(_onDepth / 2))).endSide(side.Expand(_expander.reverse()).evaluator(toDepth(_onDepth - _onDepth / 2))).collisionEvaluator(atDepth(_onDepth)).traverse(start, end));
        }
Exemplo n.º 3
0
        protected internal override Traverser InstantiateTraverser(Node start, Node end)
        {
            // Bidirectional traversal
            GraphDatabaseService db    = start.GraphDatabase;
            TraversalDescription @base = Db.traversalDescription().depthFirst().uniqueness(Uniqueness());

            return(Db.bidirectionalTraversalDescription().startSide(@base.Expand(_expander).evaluator(toDepth(_maxDepth / 2))).endSide(@base.Expand(_expander.reverse()).evaluator(toDepth(_maxDepth - _maxDepth / 2))).traverse(start, end));
        }
 private void TestCIsReturnedOnDepthTwo(TraversalDescription description)
 {
     using (Transaction transaction = BeginTx())
     {
         description = description.Expand(PathExpanders.forTypeAndDirection(_one, OUTGOING));
         int i = 0;
         foreach (Path position in description.Traverse(Node("A")))
         {
             assertEquals(i++, position.Length());
         }
     }
 }