tasks
Class EuclideanTspTask

java.lang.Object
  extended by api.Task
      extended by tasks.EuclideanTspTask
All Implemented Interfaces:
TaskInterface, java.io.Serializable

public class EuclideanTspTask
extends Task

See Also:
Serialized Form

Constructor Summary
EuclideanTspTask(double[][] userPath)
          Constructor that is called by a client.
EuclideanTspTask(java.util.List<City> entirePath, java.util.List<java.lang.Integer> partialPath, int dID)
          Constructor that is called recursively by the run method.
 
Method Summary
 Result run(Shared shared)
          Determines whether the size of the TSP is suitable for a single machine, or if it should be broken up into sub-tasks.
 void setInput(Result r)
          Does nothing because this Task take no inputs.
 
Methods inherited from class api.Task
getDrainID, getInputCount, getTaskID, setComputer, setShared, setTaskID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EuclideanTspTask

public EuclideanTspTask(double[][] userPath)
Constructor that is called by a client. Specifies only the original path to be figured out.

Parameters:
userPath -

EuclideanTspTask

public EuclideanTspTask(java.util.List<City> entirePath,
                        java.util.List<java.lang.Integer> partialPath,
                        int dID)
Constructor that is called recursively by the run method. It allows for a partial path to be specified, representing the cities already visited. It also specifies where the output of this object, and it children, needs to drain to.

Parameters:
entirePath -
partialPath -
dID -
Method Detail

setInput

public void setInput(Result r)
Does nothing because this Task take no inputs.

Specified by:
setInput in interface TaskInterface
Specified by:
setInput in class Task
Parameters:
r - The result object to be set.

run

public Result run(Shared shared)
Determines whether the size of the TSP is suitable for a single machine, or if it should be broken up into sub-tasks.

Specified by:
run in interface TaskInterface
Specified by:
run in class Task
Returns:
null if it is only spawning children tasks. Otherwise a result which specifies the best path, given the partial path, and the length of that best path.