Esempio n. 1
0
        private bool IndexStillExists(SchemaRead schemaRead, SchemaDescriptor descriptor, IndexReference index)
        {
            IndexReference existingIndex = schemaRead.Index(descriptor);

            return(existingIndex != IndexReference.NO_INDEX && existingIndex.Equals(index));
        }
Esempio n. 2
0
 public abstract long IndexSize(IndexReference index);
Esempio n. 3
0
 public abstract long IndexGetCommittedId(IndexReference index);
Esempio n. 4
0
 public abstract long?IndexGetOwningUniquenessConstraintId(IndexReference index);
Esempio n. 5
0
 public abstract Org.Neo4j.Register.Register_DoubleLongRegister IndexUpdatesAndSize(IndexReference index, Org.Neo4j.Register.Register_DoubleLongRegister target);
Esempio n. 6
0
 internal IndexReaders(IndexReference indexReference, Read read)
 {
     this._indexReference = indexReference;
     this._read           = read;
 }
Esempio n. 7
0
 public abstract Org.Neo4j.Storageengine.Api.schema.PopulationProgress IndexGetPopulationProgress(IndexReference index);
Esempio n. 8
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static long readUpdates(org.neo4j.internal.kernel.api.IndexReference index, org.neo4j.internal.kernel.api.SchemaRead schemaRead, org.neo4j.register.Register_DoubleLongRegister register) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException
        private static long ReadUpdates(IndexReference index, SchemaRead schemaRead, Org.Neo4j.Register.Register_DoubleLongRegister register)
        {
            schemaRead.IndexUpdatesAndSize(index, register);
            return(register.ReadFirst());
        }
Esempio n. 9
0
        /// <summary>
        /// Performs an index seek.
        /// </summary>
        /// <param name="read"> The Read instance to use for seeking </param>
        /// <param name="cursors"> Used for cursor allocation </param>
        /// <param name="index"> A reference to an index </param>
        /// <param name="value"> The value to seek for </param>
        /// <returns> A cursor positioned at the data found in index. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public static org.neo4j.internal.kernel.api.NodeValueIndexCursor indexSeek(org.neo4j.internal.kernel.api.Read read, org.neo4j.internal.kernel.api.CursorFactory cursors, org.neo4j.internal.kernel.api.IndexReference index, Object value) throws org.neo4j.internal.kernel.api.exceptions.KernelException
        public static NodeValueIndexCursor IndexSeek(Read read, CursorFactory cursors, IndexReference index, object value)
        {
            Debug.Assert(index.Properties().Length == 1);
            if (value == Values.NO_VALUE || value == null)
            {
                return([email protected]_Fields.Empty);
            }
            else
            {
                NodeValueIndexCursor      cursor = cursors.AllocateNodeValueIndexCursor();
                IndexQuery.ExactPredicate query  = exact(index.Properties()[0], makeValueNeoSafe(value));
                read.NodeIndexSeek(index, cursor, IndexOrder.NONE, false, query);
                return(cursor);
            }
        }
Esempio n. 10
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private long indexUpdates(org.neo4j.internal.kernel.api.IndexReference reference) throws org.neo4j.internal.kernel.api.exceptions.KernelException
        private long IndexUpdates(IndexReference reference)
        {
            return((( GraphDatabaseAPI )_db).DependencyResolver.resolveDependency(typeof(IndexingService)).indexUpdatesAndSize(reference.Schema()).readFirst());
        }
Esempio n. 11
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private double getSelectivity(org.neo4j.internal.kernel.api.IndexReference reference) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException
        private double GetSelectivity(IndexReference reference)
        {
            return(_bridge.getKernelTransactionBoundToThisThread(true).schemaRead().indexUniqueValuesSelectivity(reference));
        }
Esempio n. 12
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public String indexGetFailure(org.neo4j.internal.kernel.api.IndexReference index) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException
        public override string IndexGetFailure(IndexReference index)
        {
            AllStoreHolder.AssertValidIndex(index);
            return(_snapshot.indexGetFailure(index.Schema()));
        }
Esempio n. 13
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.storageengine.api.schema.PopulationProgress indexGetPopulationProgress(org.neo4j.internal.kernel.api.IndexReference index) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException
        public override PopulationProgress IndexGetPopulationProgress(IndexReference index)
        {
            AllStoreHolder.AssertValidIndex(index);
            _ktx.assertOpen();
            return(_stores.indexGetPopulationProgress(_snapshot, index));
        }
Esempio n. 14
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.internal.kernel.api.InternalIndexState indexGetState(org.neo4j.internal.kernel.api.IndexReference index) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException
        public override InternalIndexState IndexGetState(IndexReference index)
        {
            AllStoreHolder.AssertValidIndex(index);
            _ktx.assertOpen();
            return(_stores.indexGetState(_snapshot, ( IndexDescriptor )index));
        }
Esempio n. 15
0
        public virtual void Drop(string name)
        {
            IndexReference indexReference = GetValidIndexReference(name);

            Tx.schemaWrite().indexDrop(indexReference);
        }
 public override void WorkshopInit(DeltinScript translateInfo)
 {
     Nodes    = translateInfo.VarCollection.Assign("Nodes", true, false);
     Segments = translateInfo.VarCollection.Assign("Segments", true, false);
 }
        internal FulltextIndexTransactionState(FulltextIndexProvider provider, Log log, IndexReference indexReference)
        {
            FulltextIndexAccessor accessor = provider.GetOpenOnlineAccessor(( StoreIndexDescriptor )indexReference);

            log.Debug("Acquired online fulltext schema index accessor, as base accessor for transaction state: %s", accessor);
            _descriptor = accessor.Descriptor;
            SchemaDescriptor schema = _descriptor.schema();

            _toCloseLater = new List <AutoCloseable>();
            _writer       = accessor.TransactionStateIndexWriter;
            _modifiedEntityIdsInThisTransaction = new LongHashSet();
            _visitingNodes  = Schema.entityType() == EntityType.NODE;
            _txStateVisitor = new FulltextIndexTransactionStateVisitor(_descriptor, _modifiedEntityIdsInThisTransaction, _writer);
        }
        public void Get()
        {
            IndexReference neighborIndex             = actionSet.VarCollection.Assign("Dijkstra: Neighbor Index", actionSet.IsGlobal, AssignExtended);
            IndexReference neighborDistance          = actionSet.VarCollection.Assign("Dijkstra: Distance", actionSet.IsGlobal, AssignExtended);
            IndexReference neighborSegmentAttributes = actionSet.VarCollection.Assign("Dijkstra: Neighbor Attributes", actionSet.IsGlobal, AssignExtended);

            InitializeVariables();

            actionSet.AddAction(While(Info.LoopCondition));

            // Invoke LoopStart
            Info.OnLoop();

            // Get neighboring indexes
            var connectedSegments = actionSet.VarCollection.Assign("Dijkstra: Connected Segments", actionSet.IsGlobal, AssignExtended);

            connectedSegments.Set(actionSet, GetConnectedSegments());

            // Loop through neighboring indexes
            ForeachBuilder forBuilder = new ForeachBuilder(actionSet, connectedSegments.GetVariable());

            // Invoke OnConnectLoop
            Info.OnConnectLoop();

            actionSet.AddAction(ArrayBuilder <Element> .Build(
                                    // Get the index from the segment data
                                    neighborIndex.SetVariable(
                                        FirstOf(Filter(
                                                    BothNodes(forBuilder.IndexValue),
                                                    Compare(ArrayElement(), Operator.NotEqual, Current.GetVariable())
                                                    ))
                                        ),

                                    // Get the distance between the current and the neighbor index.
                                    neighborDistance.SetVariable(
                                        DistanceBetween(
                                            nodes[neighborIndex.Get()],
                                            nodes[Current.Get()]
                                            ) + Distances.Get()[Current.Get()]
                                        )
                                    ));

            // Get the attributes from the current node to the neighbor node.
            actionSet.AddAction(neighborSegmentAttributes.SetVariable(Filter(attributes,
                                                                             And(
                                                                                 Compare(YOf(ArrayElement()), Operator.Equal, Current.Get()),
                                                                                 Compare(XOf(ArrayElement()), Operator.Equal, neighborIndex.Get())
                                                                                 )
                                                                             )));

            string ifComment =
                @"If the distance between this node and the neighbor node is lower than the node's current parent,
then the current node is closer and should be set as the neighbor's parent.
Alternatively, if the neighbor's distance is 0, that means it was not set so this should
be set as the parent regardless.

Additionally, make sure that any of the neighbor's attributes is in the attribute array.";

            // Set the current neighbor's distance if the new distance is less than what it is now.
            actionSet.AddAction(ifComment, If(And(
                                                  Or(
                                                      Not(Distances.Get()[neighborIndex.Get()]),
                                                      neighborDistance.Get() < Distances.Get()[neighborIndex.Get()]
                                                      ),
                                                  Or(
                                                      // There are no attributes.
                                                      Not(CountOf(neighborSegmentAttributes.Get())),
                                                      // There are attributes and the attribute array contains one of the attributes.
                                                      Any(
                                                          neighborSegmentAttributes.Get(),
                                                          Contains(Info.EnabledAttributes, ZOf(ArrayElement()))
                                                          )
                                                      )
                                                  )));

            actionSet.AddAction(
                "Set the neighbor's distance to be the distance between the current node and neighbor node.",
                Distances.SetVariable(neighborDistance.Get(), index: neighborIndex.Get())
                );
            actionSet.AddAction(
                @"Set the neighbor's parent ('parentArray[neighborIndex]') to be current. 1 is added to current because
0 means no parent was set yet (the first node will have current equal 0). This value will be subtracted
back by 1 when used.",
                ParentArray.SetVariable(Current.Get() + 1, index: neighborIndex.Get())
                );

            actionSet.AddAction(End());                                                                     // End the if.
            forBuilder.Finish();                                                                            // End the for.
            actionSet.AddAction(Unvisited.ModifyVariable(Operation.RemoveFromArrayByValue, Current.Get())); // Remove the current node from the unvisited array.
            Info.OnLoopEnd();                                                                               // External end loop logic.
            Current.Set(actionSet, LowestUnvisited());                                                      // Set current to the unvisited node with the lowest distance.
            actionSet.AddAction(End());                                                                     // End the while loop.
            Info.Finished();                                                                                // Done.

            // Reset variables.
            actionSet.AddAction(ArrayBuilder <Element> .Build(
                                    // Current.SetVariable(0),
                                    // Distances.SetVariable(0),
                                    // neighborIndex.SetVariable(0),
                                    // neighborDistance.SetVariable(0),
                                    // ParentArray.SetVariable(0)
                                    Current.SetVariable(0),
                                    Distances.SetVariable(0),
                                    connectedSegments.SetVariable(0),
                                    neighborIndex.SetVariable(0),
                                    neighborDistance.SetVariable(0),
                                    ParentArray.SetVariable(0)
                                    ));
        }
Esempio n. 19
0
 public abstract string IndexGetFailure(IndexReference index);
        }                                           // The subroutine's return handler.

        public SubroutineCatalogItem(Subroutine subroutine, IParameterHandler parameterHandler, IndexReference objectStack, ReturnHandler returnHandler)
        {
            Subroutine       = subroutine;
            ParameterHandler = parameterHandler;
            ObjectStack      = objectStack;
            ReturnHandler    = returnHandler;
        }
Esempio n. 21
0
 public abstract InternalIndexState IndexGetState(IndexReference index);
 private static void SetInitialDistances(ActionSet actionSet, IndexReference distancesVar, Element currentIndex)
 {
     actionSet.AddAction(distancesVar.SetVariable(LeastNot0, null, currentIndex));
 }
Esempio n. 23
0
 public abstract Org.Neo4j.Register.Register_DoubleLongRegister IndexSample(IndexReference index, Org.Neo4j.Register.Register_DoubleLongRegister target);
        private static void SetInitialUnvisited(ActionSet actionSet, Element nodeArray, IndexReference unvisitedVar)
        {
            // Create an array counting up to the number of values in the nodeArray array.
            // For example, if nodeArray has 6 variables unvisitedVar will be set to [0, 1, 2, 3, 4, 5].

            // Empty the unvisited array.
            actionSet.AddAction(unvisitedVar.SetVariable(new V_EmptyArray()));

            IndexReference current = actionSet.VarCollection.Assign("unvisitedBuilder", actionSet.IsGlobal, assignExtended);

            actionSet.AddAction(current.SetVariable(0));

            // While current < the count of the node array.
            actionSet.AddAction(Element.Part <A_While>((Element)current.GetVariable() < Element.Part <V_CountOf>(nodeArray)));

            actionSet.AddAction(unvisitedVar.ModifyVariable(Operation.AppendToArray, (Element)current.GetVariable()));
            actionSet.AddAction(current.ModifyVariable(Operation.Add, 1));

            // End the while.
            actionSet.AddAction(new A_End());
        }
Esempio n. 25
0
 public abstract long NodesCountIndexed(IndexReference index, long nodeId, int propertyKeyId, Value value);
        public void Get()
        {
            var firstNode = ClosestNodeToPosition(Nodes, position);

            Assign();

            current = actionSet.VarCollection.Assign("Dijkstra: Current", actionSet.IsGlobal, assignExtended);
            IndexReference distances = actionSet.VarCollection.Assign("Dijkstra: Distances", actionSet.IsGlobal, false);

            unvisited = actionSet.VarCollection.Assign("Dijkstra: Unvisited", actionSet.IsGlobal, false);
            IndexReference connectedSegments = actionSet.VarCollection.Assign("Dijkstra: Connected Segments", actionSet.IsGlobal, assignExtended);
            IndexReference neighborIndex     = actionSet.VarCollection.Assign("Dijkstra: Neighbor Index", actionSet.IsGlobal, assignExtended);
            IndexReference neighborDistance  = actionSet.VarCollection.Assign("Dijkstra: Distance", actionSet.IsGlobal, assignExtended);

            parentArray = actionSet.VarCollection.Assign("Dijkstra: Parent Array", actionSet.IsGlobal, false);

            // Set the current variable as the first node.
            actionSet.AddAction(current.SetVariable(firstNode));
            SetInitialDistances(actionSet, distances, (Element)current.GetVariable());
            SetInitialUnvisited(actionSet, Nodes, unvisited);

            actionSet.AddAction(Element.Part <A_While>(LoopCondition()));

            // !WAIT actionSet.AddAction(A_Wait.MinimumWait);

            // Get neighboring indexes
            actionSet.AddAction(connectedSegments.SetVariable(GetConnectedSegments(
                                                                  Nodes,
                                                                  Segments,
                                                                  (Element)current.GetVariable(),
                                                                  reversed
                                                                  )));

            // Loop through neighboring indexes
            ForeachBuilder forBuilder = new ForeachBuilder(actionSet, connectedSegments.GetVariable());

            actionSet.AddAction(A_Wait.MinimumWait);

            actionSet.AddAction(ArrayBuilder <Element> .Build(
                                    // Get the index from the segment data
                                    neighborIndex.SetVariable(
                                        Element.TernaryConditional(
                                            new V_Compare(
                                                current.GetVariable(),
                                                Operators.NotEqual,
                                                Node1(forBuilder.IndexValue)
                                                ),
                                            Node1(forBuilder.IndexValue),
                                            Node2(forBuilder.IndexValue)
                                            )
                                        ),

                                    // Get the distance between the current and the neighbor index.
                                    neighborDistance.SetVariable(
                                        Element.Part <V_DistanceBetween>(
                                            Nodes[(Element)neighborIndex.GetVariable()],
                                            Nodes[(Element)current.GetVariable()]
                                            ) + ((Element)distances.GetVariable())[(Element)current.GetVariable()]
                                        )
                                    ));

            // Set the current neighbor's distance if the new distance is less than what it is now.
            actionSet.AddAction(Element.Part <A_If>(
                                    (Element)neighborDistance.GetVariable()
                                    <
                                    WorkingDistance((Element)distances.GetVariable(), (Element)neighborIndex.GetVariable())
                                    ));

            actionSet.AddAction(distances.SetVariable((Element)neighborDistance.GetVariable(), null, (Element)neighborIndex.GetVariable()));
            actionSet.AddAction(parentArray.SetVariable((Element)current.GetVariable() + 1, null, (Element)neighborIndex.GetVariable()));

            actionSet.AddAction(new A_End());
            forBuilder.Finish();

            actionSet.AddAction(ArrayBuilder <Element> .Build(
                                    // Add the current to the visited array.
                                    unvisited.SetVariable(Element.Part <V_RemoveFromArray>(unvisited.GetVariable(), current.GetVariable())),

                                    // Set the current node as the smallest unvisited.
                                    current.SetVariable(LowestUnvisited(Nodes, (Element)distances.GetVariable(), (Element)unvisited.GetVariable()))
                                    ));

            actionSet.AddAction(new A_End());

            GetResult();

            actionSet.AddAction(ArrayBuilder <Element> .Build(
                                    current.SetVariable(-1),
                                    distances.SetVariable(-1),
                                    connectedSegments.SetVariable(-1),
                                    neighborIndex.SetVariable(-1),
                                    neighborDistance.SetVariable(-1),
                                    parentArray.SetVariable(-1)
                                    ));

            Reset();
        }
Esempio n. 27
0
 public abstract double IndexUniqueValuesSelectivity(IndexReference index);
        /// <summary>
        /// Perform an index scan and assert that the correct nodes and values were found.
        ///
        /// Since this method modifies TX state for the test it is not safe to call this method more than once in the same transaction.
        /// </summary>
        /// <param name="expected"> the expected nodes and values </param>
        /// <param name="tx"> the transaction </param>
        /// <param name="index"> the index </param>
        /// <param name="needsValues"> if the index is expected to provide values </param>
        /// <param name="anotherValueFoundByQuery"> a values that would be found by, if a node with that value existed. This method
        /// will create a node with that value, after initializing the cursor and assert that the new node is not found. </param>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void assertNodeAndValueForScan(java.util.Set<org.neo4j.helpers.collection.Pair<long,org.neo4j.values.storable.Value>> expected, Transaction tx, IndexReference index, boolean needsValues, Object anotherValueFoundByQuery) throws Exception
        private void AssertNodeAndValueForScan(ISet <Pair <long, Value> > expected, Transaction tx, IndexReference index, bool needsValues, object anotherValueFoundByQuery)
        {
            using (NodeValueIndexCursor nodes = tx.Cursors().allocateNodeValueIndexCursor())
            {
                tx.DataRead().nodeIndexScan(index, nodes, IndexOrder.None, needsValues);
                AssertNodeAndValue(expected, tx, needsValues, anotherValueFoundByQuery, nodes);
            }
        }
Esempio n. 29
0
 public abstract long LockingNodeUniqueIndexSeek(IndexReference index, params IndexQuery.ExactPredicate[] predicates);
        public void Get()
        {
            var firstNode = GetClosestNode(actionSet, Nodes, Source);

            Assign();

            current   = actionSet.VarCollection.Assign("Dijkstra: Current", actionSet.IsGlobal, assignExtended);
            distances = actionSet.VarCollection.Assign("Dijkstra: Distances", actionSet.IsGlobal, false);
            unvisited = actionSet.VarCollection.Assign("Dijkstra: Unvisited", actionSet.IsGlobal, false);
            IndexReference connectedSegments         = actionSet.VarCollection.Assign("Dijkstra: Connected Segments", actionSet.IsGlobal, assignExtended);
            IndexReference neighborIndex             = actionSet.VarCollection.Assign("Dijkstra: Neighbor Index", actionSet.IsGlobal, assignExtended);
            IndexReference neighborDistance          = actionSet.VarCollection.Assign("Dijkstra: Distance", actionSet.IsGlobal, assignExtended);
            IndexReference neighborSegmentAttributes = actionSet.VarCollection.Assign("Dijkstra: Neighbor Attributes", actionSet.IsGlobal, assignExtended);

            parentArray = GetParentArray();

            // Set the current variable as the first node.
            actionSet.AddAction(current.SetVariable(firstNode));
            SetInitialDistances(actionSet, distances, (Element)current.GetVariable());
            SetInitialUnvisited();

            actionSet.AddAction(Element.Part <A_While>(LoopCondition()));

            // Invoke LoopStart
            OnLoop.Invoke(actionSet);

            // Get neighboring indexes
            actionSet.AddAction(connectedSegments.SetVariable(GetConnectedSegments(
                                                                  Segments,
                                                                  (Element)current.GetVariable()
                                                                  )));

            // Loop through neighboring indexes
            ForeachBuilder forBuilder = new ForeachBuilder(actionSet, connectedSegments.GetVariable());

            // Invoke OnConnectLoop
            OnConnectLoop.Invoke(actionSet);

            actionSet.AddAction(ArrayBuilder <Element> .Build(
                                    // Get the index from the segment data
                                    neighborIndex.SetVariable(
                                        Element.Part <V_FirstOf>(Element.Part <V_FilteredArray>(
                                                                     BothNodes(forBuilder.IndexValue),
                                                                     new V_Compare(
                                                                         new V_ArrayElement(),
                                                                         Operators.NotEqual,
                                                                         current.GetVariable()
                                                                         )
                                                                     ))
                                        ),

                                    // Get the distance between the current and the neighbor index.
                                    neighborDistance.SetVariable(
                                        Element.Part <V_DistanceBetween>(
                                            Nodes[(Element)neighborIndex.GetVariable()],
                                            Nodes[(Element)current.GetVariable()]
                                            ) + ((Element)distances.GetVariable())[(Element)current.GetVariable()]
                                        )
                                    ));

            // Get the attributes from the current node to the neighbor node.
            actionSet.AddAction(neighborSegmentAttributes.SetVariable(Element.Part <V_FilteredArray>(Attributes,
                                                                                                     Element.Part <V_And>(
                                                                                                         new V_Compare(
                                                                                                             Element.Part <V_YOf>(new V_ArrayElement()),
                                                                                                             Operators.Equal,
                                                                                                             current.Get()
                                                                                                             ),
                                                                                                         new V_Compare(
                                                                                                             Element.Part <V_XOf>(new V_ArrayElement()),
                                                                                                             Operators.Equal,
                                                                                                             neighborIndex.Get()
                                                                                                             )
                                                                                                         )
                                                                                                     )));

            // Set the current neighbor's distance if the new distance is less than what it is now.
            actionSet.AddAction(Element.Part <A_If>(Element.Part <V_And>(
                                                        Element.Part <V_Or>(
                                                            new V_Compare(
                                                                ((Element)distances.GetVariable())[(Element)neighborIndex.GetVariable()],
                                                                Operators.Equal,
                                                                new V_Number(0)
                                                                ),
                                                            (Element)neighborDistance.GetVariable() < ((Element)distances.GetVariable())[(Element)neighborIndex.GetVariable()]
                                                            ),
                                                        Element.Part <V_Or>(
                                                            // There are no attributes.
                                                            Element.Part <V_Not>(Element.Part <V_CountOf>(neighborSegmentAttributes.Get())),
                                                            // There are attributes and the attribute array contains one of the attributes.
                                                            Element.Part <V_IsTrueForAny>(
                                                                neighborSegmentAttributes.Get(),
                                                                Element.Part <V_ArrayContains>(attributes, Element.Part <V_ZOf>(new V_ArrayElement()))
                                                                )
                                                            )
                                                        )));

            actionSet.AddAction(distances.SetVariable((Element)neighborDistance.GetVariable(), null, (Element)neighborIndex.GetVariable()));
            actionSet.AddAction(parentArray.SetVariable((Element)current.GetVariable() + 1, null, (Element)neighborIndex.GetVariable()));

            // End the if.
            actionSet.AddAction(new A_End());
            // End the for.
            forBuilder.Finish();

            // Remove the current node from the unvisited array.
            actionSet.AddAction(unvisited.ModifyVariable(Operation.RemoveFromArrayByValue, (Element)current.GetVariable()));
            EndLoop();
            actionSet.AddAction(current.SetVariable(LowestUnvisited(Nodes, (Element)distances.GetVariable(), (Element)unvisited.GetVariable())));

            actionSet.AddAction(new A_End());

            GetResult();

            actionSet.AddAction(ArrayBuilder <Element> .Build(
                                    current.SetVariable(0),
                                    distances.SetVariable(0),
                                    connectedSegments.SetVariable(0),
                                    neighborIndex.SetVariable(0),
                                    neighborDistance.SetVariable(0),
                                    parentArray.SetVariable(0)
                                    ));
        }