java.lang.Object
de.grogra.task.Task
de.grogra.util.concurrent.PTaskManager
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a task to be solved duringsolve()
.describe()
protected void
dispose
(PartialTask task) This method is invoked when an active solver is removed or invokesTask.partialTaskDone(Solver)
in order to tell this task that the partial task of the solver is no longer processed.protected boolean
done()
Returnstrue
iff the complete task has been solved.protected void
protected PartialTask
nextPartialTask
(int solverIndex) This method returns the next partial task for this task.protected void
void
setSolverCount
(int count) Sets the number of 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
-
Constructor Details
-
PTaskManager
public PTaskManager() -
PTaskManager
public PTaskManager(boolean doMonitor)
-
-
Method Details
-
setSolverCount
public void setSolverCount(int count) Sets the number of solvers (same virtual machine) to use. The default value is the number of processors which are available to the virtual machine.- Parameters:
count
- number of solvers to use
-
add
Adds a task to be solved duringsolve()
.- Parameters:
task
- single task to solve
-
nextPartialTask
Description copied from class:Task
This method returns the next partial task for this task. If all parts of the task have been solved or currently are being solved,null
is returned. However, a later invocation may return a partial task if a currently active solver does not completely solve its partial task.- Specified by:
nextPartialTask
in classTask
- Parameters:
solverIndex
- index of solver which will be used for next task- Returns:
- next partial task, or
null
-
dispose
Description copied from class:Task
This method is invoked when an active solver is removed or invokesTask.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. -
done
protected boolean done()Description copied from class:Task
Returnstrue
iff the complete task has been solved. -
prepareSolve
protected void prepareSolve()- Overrides:
prepareSolve
in classTask
-
solve
public void solve() -
finishSolve
protected void finishSolve()- Overrides:
finishSolve
in classTask
-
describe
-