de.grogra.rgg
public final class ConcurrentTasks extends Task
ConcurrentTasks. The
individual tasks are added via add(ConcurrentTask) and executed
via solve().
It is assumed that the only effect of the individual concurrent tasks is to
fill the queues of their current extent
(see Graph.getQueues()). The queues are
collected and, after all tasks have been processed, are applied as last
action of the solve() method.
| Constructor and Description |
|---|
ConcurrentTasks() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(ConcurrentTask task)
Adds a task to be solved during
solve(). |
protected void |
dispose(PartialTask task)
This method is invoked when an active solver is removed or
invokes
Task.partialTaskDone(Solver) in order to tell this
task that the partial task of the solver is no longer processed. |
protected boolean |
done()
Returns
true iff the complete task has been solved. |
protected void |
finishSolve() |
protected PartialTask |
nextPartialTask(int solverIndex)
This method returns the next partial task for this task.
|
protected void |
prepareSolve() |
void |
setLocalSolverCount(int count)
Sets the number of local solvers (same virtual machine) to use.
|
void |
solve() |
addSolver, getSolverCount, getSolvers, isSolving, isStopped, partialTaskDone, removeSolver, removeSolvers, stoppublic void add(ConcurrentTask task)
solve().task - single task to solveprotected void dispose(PartialTask task)
TaskTask.partialTaskDone(Solver) in order to tell this
task that the partial task of the solver is no longer processed.
Note that the solver may not have completely processed
its partial task.protected boolean done()
Tasktrue iff the complete task has been solved.protected void finishSolve()
finishSolve in class Taskprotected PartialTask nextPartialTask(int solverIndex)
Tasknull is returned. However, a later invocation
may return a partial task if a currently active solver
does not completely solve its partial task.nextPartialTask in class TasksolverIndex - index of solver which will be used for next tasknullprotected void prepareSolve()
prepareSolve in class Taskpublic void setLocalSolverCount(int count)
count - number of local solvers to use