nct.filter
Class DuplicateThresholdFilter<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>

java.lang.Object
  extended by nct.filter.DuplicateThresholdFilter<NodeType,WeightType>
All Implemented Interfaces:
Filter<NodeType,WeightType>

public class DuplicateThresholdFilter<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>
extends java.lang.Object
implements Filter<NodeType,WeightType>

This class will throw out any solutions with a certain percentage of duplicate nodes. This filter is NOT synchronized! (HashSet)


Constructor Summary
DuplicateThresholdFilter(double thresh)
          Sets the threshold according to the given value.
 
Method Summary
 java.util.List<Graph<NodeType,WeightType>> filter(java.util.List<Graph<NodeType,WeightType>> solutions)
          Given the solutions, this filter compares the nodes contained in each graph, calculates the percentage of identical nodes, and throws out any solutions that have a percent identity greater than or equal to the specified threshold.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DuplicateThresholdFilter

public DuplicateThresholdFilter(double thresh)
Sets the threshold according to the given value.

Parameters:
thresh - The threshold to check against
Method Detail

filter

public java.util.List<Graph<NodeType,WeightType>> filter(java.util.List<Graph<NodeType,WeightType>> solutions)
Given the solutions, this filter compares the nodes contained in each graph, calculates the percentage of identical nodes, and throws out any solutions that have a percent identity greater than or equal to the specified threshold. This function will not affect the solutions list but is not a deep copy either.

Specified by:
filter in interface Filter<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>
Parameters:
solutions - The List of solutions to process.
Returns:
Either a filtered solution set or null if solutions is null.