public double?GetActivationValueOfVertex(int bookId) { VertexBook book = GetVertex(bookId); if (book == null) { return(null); } return(book.GetActivationValue()); }
public void IncreaseActivationValueOfVertex(int bookId, double increaseAmount) { VertexBook vertex = GetVertex(bookId); if (vertex == null) { AddVertex(bookId, increaseAmount); } else { vertex.SetActivationValue( vertex.GetActivationValue() + increaseAmount); } }
public void printTopKOfGraph(int numberOfVertices) { List <VertexBook> topKVertices = this.bookIdsDictionary.Values .OrderBy(v => v.GetActivationValue()).Reverse().Take(numberOfVertices).ToList(); for (int i = 0; i < topKVertices.Count(); i++) { VertexBook vertexI = topKVertices[i]; System.Console.WriteLine("Book " + i + " : " + vertexI.GetBookID() + " " + vertexI.GetActivationValue()); } }