|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.proactive.branchnbound.core.queue.TaskQueue
public abstract class TaskQueue
This class must be extended by all task queues.
It contains and describes all methods needed by the API for handling task allocation, managing results, and backuping / restoring computation.
Field Summary | |
---|---|
static org.apache.log4j.Logger |
logger
The logger. |
Constructor Summary | |
---|---|
TaskQueue()
|
Method Summary | |
---|---|
abstract void |
addAll(java.util.Collection tasks)
Adding a set of tasks in the queue. |
abstract void |
addResult(Result result)
Add a found result for the final gather. |
abstract void |
addTask(Task t)
Add a task for computing in the queue. |
abstract void |
backupResults(java.io.OutputStream backupResultFile)
Backuping in a stream all current found results. |
abstract void |
backupTasks(Task rootTask,
java.util.Vector pendingTasks,
java.io.OutputStream backupOutputStream)
Write all tasks for backuping. |
abstract void |
flushAll()
Empty the queue for a new computation. |
abstract java.util.Collection |
getAllResults()
|
Result |
getBestCurrentResult()
|
abstract Task |
getRootTaskFromBackup()
Restore the root task. |
abstract BooleanMutableWrapper |
hasNext()
|
abstract IntMutableWrapper |
howManyResults()
|
void |
informNewBestResult(Result newBest)
***FOR INTERNAL USE ONLY*** Inform the queue of the best current solution. |
abstract BooleanWrapper |
isHungry()
|
abstract void |
loadResults(java.io.InputStream backupResultFile)
Restoring results from a backup. |
abstract void |
loadTasks(java.io.InputStream taskFile)
Restoring all tasks from a previous backup. |
abstract Task |
next()
Return the next task to be computed, and remove it from the queue. |
abstract void |
setHungryLevel(int level)
Set the hungry level for this queue. |
abstract IntMutableWrapper |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.log4j.Logger logger
Constructor Detail |
---|
public TaskQueue()
Method Detail |
---|
public abstract void addAll(java.util.Collection tasks)
tasks
- a Collection
of Task
classes.public abstract IntMutableWrapper size()
public abstract BooleanMutableWrapper hasNext()
true
if the queue has more tasks not computed.public abstract Task next()
public abstract void flushAll()
public abstract BooleanWrapper isHungry()
true
if the queue has reached the hungry level.setHungryLevel(int)
public abstract void setHungryLevel(int level)
level
- the starving task level.isHungry()
public abstract void backupTasks(Task rootTask, java.util.Vector pendingTasks, java.io.OutputStream backupOutputStream)
rootTask
- the root task.pendingTasks
- the pending tasks.backupOutputStream
- the stream for backuping.public abstract void loadTasks(java.io.InputStream taskFile)
taskFile
- the stream for restoring.public abstract Task getRootTaskFromBackup()
loadTasks(InputStream)
must be
called before.
loadTasks(InputStream)
public abstract void addResult(Result result)
result
- the found result.public abstract IntMutableWrapper howManyResults()
public abstract java.util.Collection getAllResults()
Collection
with all current found results.public abstract void backupResults(java.io.OutputStream backupResultFile)
backupResultFile
- the stream for backuping.public abstract void loadResults(java.io.InputStream backupResultFile)
backupResultFile
- the stream for restoring.public abstract void addTask(Task t)
t
- the task to be computed.public void informNewBestResult(Result newBest)
***FOR INTERNAL USE ONLY***
Inform the queue of the best current solution.
newBest
- the best current solution.public Result getBestCurrentResult()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |