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.
|
evaluate
clone, getCostParameters, setCostParameters
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone
protected 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)
CostFunction
evaluate
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()
ParallelAlgorithm
getThreadPool
in interface ParallelAlgorithm
public void setThreadPool(java.util.concurrent.ThreadPoolExecutor threadPool)
ParallelAlgorithm
setThreadPool
in interface ParallelAlgorithm
threadPool
- Thread pool used for parallelization.public int getNumThreads()
ParallelAlgorithm
getNumThreads
in interface ParallelAlgorithm