src/main/java/science/atlarge/graphalytics/giraph/algorithms/ffm/ForestFireModelWorkerContext.java
/**
	 * @param vertexId a vertex in this worker's partition
	 */
@param vertexId a vertex in this worker's partition
@param vertexId a vertex in this worker ' s partition
public synchronized void registerVertex(long vertexId) {
		if (numberOfNewVertices == 0) {
			return;
		}
		AmbassadorSelection candidate = new AmbassadorSelection(rnd.nextFloat(), vertexId);
		if (candidateAmbassadors.size() < numberOfNewVertices) {
			candidateAmbassadors.add(candidate);
		} else if (candidateAmbassadors.peek().compareTo(candidate) <= 0) {
			candidateAmbassadors.add(candidate);
			candidateAmbassadors.poll();
		}
	}
public synchronized void registerVertex ( long vertexId ) { if ( numberOfNewVertices == 0 ) { return ; } AmbassadorSelection candidate = new AmbassadorSelection ( rnd . nextFloat ( ) , vertexId ) ; if ( candidateAmbassadors . size ( ) < numberOfNewVertices ) { candidateAmbassadors . add ( candidate ) ; } else if ( candidateAmbassadors . peek ( ) . compareTo ( candidate ) <= 0 ) { candidateAmbassadors . add ( candidate ) ; candidateAmbassadors . poll ( ) ; } }
@param vertexId a vertex in this worker's partition
@param vertexId a vertex in this worker ' s partition
// Consider the given vertex as a potential ambassador by assigning it a random score // Fill the list of candidates // Replace the lowest scoring candidate if the new vertex has a higher score