gov.sandia.cognition.learning.function.cost
Class ParallelClusterDistortionMeasure<DataType,ClusterType extends Cluster<DataType>>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.function.cost.ClusterDistortionMeasure<DataType,ClusterType>
          extended by gov.sandia.cognition.learning.function.cost.ParallelClusterDistortionMeasure<DataType,ClusterType>
Type Parameters:
DataType - Type of data to compute the distortion over
ClusterType - Type of clusters to use
All Implemented Interfaces:
ParallelAlgorithm, Evaluator<Collection<? extends ClusterType>,Double>, CostFunction<Collection<? extends ClusterType>,ClusterDivergenceFunction<? super ClusterType,? super DataType>>, CloneableSerializable, Serializable, Cloneable

public class ParallelClusterDistortionMeasure<DataType,ClusterType extends Cluster<DataType>>
extends ClusterDistortionMeasure<DataType,ClusterType>
implements ParallelAlgorithm

A parallel implementation of ClusterDistortionMeasure.

Since:
3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Constructor Summary
ParallelClusterDistortionMeasure()
          Creates a new instance of ParallelClusterDistortionMeasure
ParallelClusterDistortionMeasure(ClusterDivergenceFunction<ClusterType,DataType> costParameters)
          Creates a new instance of ClusterDistortionMeasure
 
Method Summary
 Double evaluate(Collection<? extends ClusterType> target)
          Computes the cost of the given target.
 int getNumThreads()
          Gets the number of threads in the thread pool.
 ThreadPoolExecutor getThreadPool()
          Gets the thread pool for the algorithm to use.
 void setThreadPool(ThreadPoolExecutor threadPool)
          Sets the thread pool for the algorithm to use.
 
Methods inherited from class gov.sandia.cognition.learning.function.cost.ClusterDistortionMeasure
clone, evaluate, getCostParameters, setCostParameters
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Constructor Detail

ParallelClusterDistortionMeasure

public ParallelClusterDistortionMeasure()
Creates a new instance of ParallelClusterDistortionMeasure


ParallelClusterDistortionMeasure

public ParallelClusterDistortionMeasure(ClusterDivergenceFunction<ClusterType,DataType> costParameters)
Creates a new instance of ClusterDistortionMeasure

Parameters:
costParameters - Divergence function that defines the cost function
Method Detail

evaluate

public Double evaluate(Collection<? extends ClusterType> target)
Description copied from interface: CostFunction
Computes the cost of the given target.

Specified by:
evaluate in interface Evaluator<Collection<? extends ClusterType extends Cluster<DataType>>,Double>
Specified by:
evaluate in interface CostFunction<Collection<? extends ClusterType extends Cluster<DataType>>,ClusterDivergenceFunction<? super ClusterType extends Cluster<DataType>,? super DataType>>
Overrides:
evaluate in class ClusterDistortionMeasure<DataType,ClusterType extends Cluster<DataType>>
Parameters:
target - The object to evaluate.
Returns:
The cost of the given object.

getThreadPool

public ThreadPoolExecutor getThreadPool()
Description copied from interface: ParallelAlgorithm
Gets the thread pool for the algorithm to use.

Specified by:
getThreadPool in interface ParallelAlgorithm
Returns:
Thread pool used for parallelization.

setThreadPool

public void setThreadPool(ThreadPoolExecutor threadPool)
Description copied from interface: ParallelAlgorithm
Sets the thread pool for the algorithm to use.

Specified by:
setThreadPool in interface ParallelAlgorithm
Parameters:
threadPool - Thread pool used for parallelization.

getNumThreads

public int getNumThreads()
Description copied from interface: ParallelAlgorithm
Gets the number of threads in the thread pool.

Specified by:
getNumThreads in interface ParallelAlgorithm
Returns:
Number of threads in the thread pool