DataType - Type of data generated by the Distributionpublic class ParallelNegativeLogLikelihood<DataType> extends NegativeLogLikelihood<DataType> implements ParallelAlgorithm
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ParallelNegativeLogLikelihood.NegativeLogLikelihoodTask<DataType>
Task for computing partial log likelihoods
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.ArrayList<ParallelNegativeLogLikelihood.NegativeLogLikelihoodTask<DataType>> |
tasks
Tasks to compute partial log likelihoods
|
protected java.util.concurrent.ThreadPoolExecutor |
threadPool
Thread pool for executing the tasks.
|
costParameters| Constructor and Description |
|---|
ParallelNegativeLogLikelihood()
Default constructor
|
ParallelNegativeLogLikelihood(java.util.Collection<? extends DataType> costParameters)
Creates a new instance of ParallelNegativeLogLikelihood
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Double |
evaluate(ComputableDistribution<DataType> target)
Computes the cost of the given target.
|
int |
getNumThreads()
Gets the number of threads in the thread pool.
|
java.util.concurrent.ThreadPoolExecutor |
getThreadPool()
Gets the thread pool for the algorithm to use.
|
void |
setThreadPool(java.util.concurrent.ThreadPoolExecutor threadPool)
Sets the thread pool for the algorithm to use.
|
evaluateclone, getCostParameters, setCostParametersequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcloneprotected transient java.util.concurrent.ThreadPoolExecutor threadPool
protected transient java.util.ArrayList<ParallelNegativeLogLikelihood.NegativeLogLikelihoodTask<DataType>> tasks
public ParallelNegativeLogLikelihood()
public ParallelNegativeLogLikelihood(java.util.Collection<? extends DataType> costParameters)
costParameters - Data generated by the target distributionpublic java.lang.Double evaluate(ComputableDistribution<DataType> target)
CostFunctionevaluate in interface Evaluator<ComputableDistribution<DataType>,java.lang.Double>evaluate in interface CostFunction<ComputableDistribution<DataType>,java.util.Collection<? extends DataType>>evaluate in class NegativeLogLikelihood<DataType>target - The object to evaluate.public java.util.concurrent.ThreadPoolExecutor getThreadPool()
ParallelAlgorithmgetThreadPool in interface ParallelAlgorithmpublic void setThreadPool(java.util.concurrent.ThreadPoolExecutor threadPool)
ParallelAlgorithmsetThreadPool in interface ParallelAlgorithmthreadPool - Thread pool used for parallelization.public int getNumThreads()
ParallelAlgorithmgetNumThreads in interface ParallelAlgorithm