public void addElementSink(ElementSink sink) { elementLock.lock(); wrappedElement.addElementSink(sink); elementLock.unlock(); }
public void addElementSink(ElementSink sink) { elementLock.lock(); wrappedElement.addElementSink(sink); elementLock.unlock(); }
/** * Initialize the algorithm for a given graph with a given entity count. The * entities are created at random locations on the graph. * * @param graph * The graph to explore. */ public void init(Graph graph) { if (context.graph != null) throw new RuntimeException( "cannot begin a random walk if the previous one was not finished, use end()."); context.graph = graph; entities.clear(); for (int i = 0; i < entityCount; i++) entities.add(createEntity()); equipGraph(); graph.addElementSink(this); }
/** * Initialize the algorithm for a given graph with a given entity count. The * entities are created at random locations on the graph. * * @param graph * The graph to explore. */ public void init(Graph graph) { if (context.graph != null) throw new RuntimeException( "cannot begin a random walk if the previous one was not finished, use end()."); context.graph = graph; entities.clear(); for (int i = 0; i < entityCount; i++) entities.add(createEntity()); equipGraph(); graph.addElementSink(this); }
public void init(Graph graph) { this.graph = graph; graph.addElementSink(this); double initialRank = 1.0 / graph.getNodeCount(); for (Node node : graph) node.addAttribute(rankAttribute, initialRank); newRanks = new ArrayList<Double>(graph.getNodeCount()); upToDate = false; iterationCount = 0; }
public void init(Graph graph) { this.graph = graph; graph.addElementSink(this); double initialRank = 1.0 / graph.getNodeCount(); for (Node node : graph) node.addAttribute(rankAttribute, initialRank); newRanks = new ArrayList<Double>(graph.getNodeCount()); upToDate = false; iterationCount = 0; }