nct.networkblast.graph
Class ThresholdRandomizer

java.lang.Object
  extended by nct.graph.util.DegreePreservingRandomizer<java.lang.String,java.lang.Double>
      extended by nct.networkblast.graph.ThresholdRandomizer
All Implemented Interfaces:
GraphRandomizer<java.lang.String,java.lang.Double>

public class ThresholdRandomizer
extends DegreePreservingRandomizer<java.lang.String,java.lang.Double>


Field Summary
protected  double threshold
           
 
Fields inherited from class nct.graph.util.DegreePreservingRandomizer
ignoreWeights, rand
 
Constructor Summary
ThresholdRandomizer(java.util.Random r, double thresholdPercentage)
           
 
Method Summary
 boolean weightsSimilar(java.lang.Double A, java.lang.Double B)
          Checks to see if the given weights are "similar".
 
Methods inherited from class nct.graph.util.DegreePreservingRandomizer
randomize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threshold

protected double threshold
Constructor Detail

ThresholdRandomizer

public ThresholdRandomizer(java.util.Random r,
                           double thresholdPercentage)
Method Detail

weightsSimilar

public boolean weightsSimilar(java.lang.Double A,
                              java.lang.Double B)
Description copied from class: DegreePreservingRandomizer
Checks to see if the given weights are "similar". The default (this) implementation treats weights as similar if they are equal. To get different behavior simply extend this class and override this method.

Overrides:
weightsSimilar in class DegreePreservingRandomizer<java.lang.String,java.lang.Double>
Parameters:
A - Weight a to be compared.
B - Weight b to be compared.
Returns:
true if if the weights are "similar", false otherwise.