public ThreadPoolExecutor getThreadPool() { if (this.threadPool == null) { this.setThreadPool(ParallelUtil.createThreadPool()); } return this.threadPool; }
public void stop() { if (this.getAlgorithm() != null) { this.getAlgorithm().stop(); } }
@Override public int getIteration() { return this.getAlgorithm().getIteration(); }
/** * Gets the number of threads in a ParallelAlgorithm by querying the * thread pool * @param algorithm * ParallelAlgorithm to consider * @return * Number of threads used by the ParallelAlgorithm's thread pool */ public static int getNumThreads( final ParallelAlgorithm algorithm) { return (algorithm == null) ? 0 : getNumThreads(algorithm.getThreadPool()); }
/** * Creates a new instance of {@code AbstractIterativeAlgorithm}. * * @param iteration The initial iteration number. */ public AbstractIterativeAlgorithm( final int iteration) { super(); this.setIteration(iteration); this.setListeners(null); }
/** * Creates a new instance of AnytimeAlgorithmWrapper * @param algorithm * Underlying algorithm to wrap. */ public AnytimeAlgorithmWrapper( final InternalAlgorithm algorithm) { super(); this.setAlgorithm(algorithm); }
public void algorithmStarted( final IterativeAlgorithm algorithm) { this.fireAlgorithmStarted(); }
@Override public DirichletProcessClustering clone() { return (DirichletProcessClustering) super.clone(); }
public void stepStarted( final IterativeAlgorithm algorithm) { this.fireStepStarted(); }
/** * Creates a new instance of AbstractParallelAlgorithm * @param threadPool * Thread pool used for parallelization. */ public AbstractParallelAlgorithm( final ThreadPoolExecutor threadPool) { super(); this.setThreadPool(threadPool); }
/** * Creates a new instance of {@code AbstractAnytimeAlgorithm}. * * @param maxIterations * Maximum number of iterations before stopping */ public AbstractAnytimeAlgorithm( final int maxIterations) { super(); this.setMaxIterations(maxIterations); }
public void algorithmEnded( final IterativeAlgorithm algorithm) { this.fireAlgorithmEnded(); }
public ThreadPoolExecutor getThreadPool() { if (this.threadPool == null) { this.setThreadPool(ParallelUtil.createThreadPool()); } return this.threadPool; }
/** * Gets the number of threads in a ParallelAlgorithm by querying the * thread pool * @param algorithm * ParallelAlgorithm to consider * @return * Number of threads used by the ParallelAlgorithm's thread pool */ public static int getNumThreads( final ParallelAlgorithm algorithm) { return (algorithm == null) ? 0 : getNumThreads(algorithm.getThreadPool()); }
public void stop() { if (this.getAlgorithm() != null) { this.getAlgorithm().stop(); } }
@Override public int getIteration() { return this.getAlgorithm().getIteration(); }
public ThreadPoolExecutor getThreadPool() { if (this.threadPool == null) { this.setThreadPool(ParallelUtil.createThreadPool()); } return this.threadPool; }
/** * Gets the number of threads in a ParallelAlgorithm by querying the * thread pool * @param algorithm * ParallelAlgorithm to consider * @return * Number of threads used by the ParallelAlgorithm's thread pool */ public static int getNumThreads( final ParallelAlgorithm algorithm) { return (algorithm == null) ? 0 : getNumThreads(algorithm.getThreadPool()); }
public void stop() { if (this.getAlgorithm() != null) { this.getAlgorithm().stop(); } }
@Override public int getIteration() { return this.getAlgorithm().getIteration(); }