public void Enumerate(LookupArray lookupArray, int[] indexesToAdd) { foreach (var i in indexesToAdd) { lookupArray.Occupy(i); } var lookupArrayIndexes = lookupArray.ToArray(); CollectionAssert.AreEquivalent(lookupArray, lookupArrayIndexes); }
public void Enumerate(LookupArray lookupArray, int[] indexesToAdd) { foreach (var i in indexesToAdd) { lookupArray.Occupy(i); } var lookupArrayIndexes = lookupArray.ToArray(); Assert.Equal(lookupArray, lookupArrayIndexes); }
public void Contains(LookupArray lookupArray, int[] indexesToAdd) { for (int j = 0; j < 256; j++) { foreach (var i in indexesToAdd) { lookupArray.Occupy(i); } foreach (var i in indexesToAdd) { Assert.IsTrue(lookupArray.Contains(i)); } lookupArray.Clear(); for (int i = 0; i < lookupArray.Capacity; i++) { Assert.IsFalse(lookupArray.Contains(i)); } } }
public DijkstraAlgorithm(int amountOfNodes) { _openSet = new IndexMinHeap <DijkstraNode>(amountOfNodes); _closedSet = new LookupArray(amountOfNodes); }
public AStarAlgorithm(int amountOfNodes, IDistanceHeuristic heuristic) { _openSet = new IndexMinHeap <AstarNode>(amountOfNodes); _closedSet = new LookupArray(amountOfNodes); _heuristic = heuristic; }