|
|||||||||||
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
org.objectweb.proactive.branchnbound.core.queue.BasicQueueImpl
A FIFO queue for providing tasks. The tasks are provided as the same order of their arrival in the queue.
Field Summary |
Fields inherited from class org.objectweb.proactive.branchnbound.core.queue.TaskQueue |
logger |
Constructor Summary | |
BasicQueueImpl()
The no args constructor for ProActive activate. |
Method Summary | |
void |
addAll(java.util.Collection tasks)
Adding a set of tasks in the queue. |
void |
addResult(Result result)
Add a found result for the final gather. |
void |
addTask(Task t)
Add a task for computing in the queue. |
void |
backupResults(java.io.OutputStream backupResultOutputStream)
Backuping in a stream all current found results. |
void |
backupTasks(Task rootTask,
java.util.Vector pendingTasks,
java.io.OutputStream backupOutputStream)
Write all tasks for backuping. |
void |
flushAll()
Empty the queue for a new computation. |
java.util.Collection |
getAllResults()
|
Task |
getRootTaskFromBackup()
Restore the root task. |
BooleanMutableWrapper |
hasNext()
|
IntMutableWrapper |
howManyResults()
|
BooleanWrapper |
isHungry()
|
void |
loadResults(java.io.InputStream backupResultInputStream)
Restoring results from a backup. |
void |
loadTasks(java.io.InputStream taskInputStream)
Restoring all tasks from a previous backup. |
Task |
next()
Return the next task to be computed, and remove it from the queue. |
void |
setHungryLevel(int level)
Set the hungry level for this queue. |
IntMutableWrapper |
size()
|
Methods inherited from class org.objectweb.proactive.branchnbound.core.queue.TaskQueue |
getBestCurrentResult, informNewBestResult |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicQueueImpl()
Method Detail |
public void addAll(java.util.Collection tasks)
TaskQueue
addAll
in class TaskQueue
tasks
- a Collection
of Task
classes.TaskQueue.addAll(java.util.Collection)
public IntMutableWrapper size()
size
in class TaskQueue
TaskQueue.size()
public BooleanMutableWrapper hasNext()
hasNext
in class TaskQueue
true
if the queue has more tasks not computed.TaskQueue.hasNext()
public Task next()
TaskQueue
next
in class TaskQueue
TaskQueue.next()
public void flushAll()
TaskQueue
flushAll
in class TaskQueue
TaskQueue.flushAll()
public BooleanWrapper isHungry()
isHungry
in class TaskQueue
true
if the queue has reached the hungry level.TaskQueue.isHungry()
public void setHungryLevel(int level)
TaskQueue
setHungryLevel
in class TaskQueue
level
- the starving task level.TaskQueue.setHungryLevel(int)
public void backupTasks(Task rootTask, java.util.Vector pendingTasks, java.io.OutputStream backupOutputStream)
TaskQueue
backupTasks
in class TaskQueue
rootTask
- the root task.pendingTasks
- the pending tasks.backupOutputStream
- the stream for backuping.TaskQueue.backupTasks(org.objectweb.proactive.branchnbound.core.Task, java.util.Vector, java.io.OutputStream)
public void loadTasks(java.io.InputStream taskInputStream)
TaskQueue
loadTasks
in class TaskQueue
taskInputStream
- the stream for restoring.TaskQueue.loadTasks(java.io.InputStream)
public Task getRootTaskFromBackup()
TaskQueue
loadTasks(InputStream)
must be
called before.
getRootTaskFromBackup
in class TaskQueue
TaskQueue.getRootTaskFromBackup()
public void addResult(Result result)
TaskQueue
addResult
in class TaskQueue
result
- the found result.TaskQueue.addResult(org.objectweb.proactive.branchnbound.core.Result)
public IntMutableWrapper howManyResults()
howManyResults
in class TaskQueue
TaskQueue.howManyResults()
public java.util.Collection getAllResults()
getAllResults
in class TaskQueue
Collection
with all current found results.TaskQueue.getAllResults()
public void backupResults(java.io.OutputStream backupResultOutputStream)
TaskQueue
backupResults
in class TaskQueue
backupResultOutputStream
- the stream for backuping.TaskQueue.backupResults(java.io.OutputStream)
public void loadResults(java.io.InputStream backupResultInputStream)
TaskQueue
loadResults
in class TaskQueue
backupResultInputStream
- the stream for restoring.TaskQueue.loadResults(java.io.InputStream)
public void addTask(Task t)
TaskQueue
addTask
in class TaskQueue
t
- the task to be computed.TaskQueue.addTask(org.objectweb.proactive.branchnbound.core.Task)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |