org.objectweb.proactive.branchnbound.core
Class Task

java.lang.Object
  extended byorg.objectweb.proactive.branchnbound.core.Task
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public abstract class Task
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

This is the root class of all our API Task classes.

Author:
Alexandre di Costanzo Created on May 2, 2005
See Also:
Serialized Form

Field Summary
protected  java.lang.Object bestKnownSolution
           
protected  Result initLowerBound
           
protected  Result initUpperBound
           
protected static org.apache.log4j.Logger logger
           
protected  Worker worker
           
 
Constructor Summary
Task()
          The no arg constructor for ProActive.
 
Method Summary
 int compareTo(java.lang.Object arg)
           
abstract  Result execute()
           
 Result gather(Result[] results)
          As defined by the user, it returns the best results.
 void immediateTerminate()
          Terminate this task.
abstract  void initLowerBound()
          Compute for the first time the problem lower bound.
abstract  void initUpperBound()
          Compute for the first time the problem upper bound.
 void setBestKnownSolution(java.lang.Object newBestKnownResult)
          ***FOR INTERNAL USE ONLY*** Push the best current solution which is broadcasted in this task.
 void setWorker(Worker worker)
          Associate a worker to this task.
abstract  java.util.Vector split()
          Split this task in sub-tasks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

initLowerBound

protected Result initLowerBound

initUpperBound

protected Result initUpperBound

worker

protected Worker worker

bestKnownSolution

protected java.lang.Object bestKnownSolution
Constructor Detail

Task

public Task()
The no arg constructor for ProActive.

Method Detail

execute

public abstract Result execute()
Returns:
the computed result of this task.

split

public abstract java.util.Vector split()
Split this task in sub-tasks.

Returns:
a collection of tasks.

gather

public Result gather(Result[] results)
As defined by the user, it returns the best results.

Parameters:
results - an array of results.
Returns:
the best user defined result or null if no results was found.

initLowerBound

public abstract void initLowerBound()
Compute for the first time the problem lower bound.


initUpperBound

public abstract void initUpperBound()
Compute for the first time the problem upper bound.


setWorker

public void setWorker(Worker worker)
Associate a worker to this task.

Parameters:
worker - A ProActive Stub on the worker.

compareTo

public int compareTo(java.lang.Object arg)
Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

setBestKnownSolution

public void setBestKnownSolution(java.lang.Object newBestKnownResult)

***FOR INTERNAL USE ONLY***

Push the best current solution which is broadcasted in this task.

Parameters:
newBestKnownResult - the best current solution.

immediateTerminate

public void immediateTerminate()
Terminate this task.



Copyright 2001-2005 INRIA All Rights Reserved.