|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.grogra.task.Task de.grogra.rgg.ConcurrentTasks
public final class ConcurrentTasks
This class implements a list of ConcurrentTask
s. 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 Summary | |
---|---|
ConcurrentTasks()
|
Method Summary | |
---|---|
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()
|
Methods inherited from class de.grogra.task.Task |
---|
addSolver, getSolverCount, getSolvers, isSolving, isStopped, partialTaskDone, removeSolver, removeSolvers, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConcurrentTasks()
Method Detail |
---|
public void add(ConcurrentTask task)
solve()
.
task
- single task to solveprotected void dispose(PartialTask task)
Task
Task.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.
dispose
in class Task
task
- partial task which is no longer processedprotected boolean done()
Task
true
iff the complete task has been solved.
done
in class Task
protected void finishSolve()
finishSolve
in class Task
protected PartialTask nextPartialTask(int solverIndex)
Task
null
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 Task
solverIndex
- index of solver which will be used for next task
null
protected void prepareSolve()
prepareSolve
in class Task
public void setLocalSolverCount(int count)
count
- number of local solvers to usepublic void solve()
solve
in class Task
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |