edu.ucsb.cs.jicos.applications.branchandbound
Class BranchAndBound

java.lang.Object
  extended by edu.ucsb.cs.jicos.services.Task
      extended by edu.ucsb.cs.jicos.applications.branchandbound.BranchAndBound
All Implemented Interfaces:
java.io.Serializable

public class BranchAndBound
extends Task

See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.ucsb.cs.jicos.services.Task
ALL_INPUTS
 
Constructor Summary
BranchAndBound(Solution solution)
          Used to construct a BranchAndBound task that corresponds to the search subtree represented by the Solution passed to it as its argument.
 
Method Summary
 java.lang.Object execute(Environment environment)
          The method that searches the search tree.
 Solution getSolution()
           
 void setSolution(Solution solution)
           
 
Methods inherited from class edu.ucsb.cs.jicos.services.Task
compute, execute, executeIncrementally, executeOnServer, getInput, getTaskId, isAtomic, numInputs, numUnsetInputs, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BranchAndBound

public BranchAndBound(Solution solution)
Used to construct a BranchAndBound task that corresponds to the search subtree represented by the Solution passed to it as its argument.

Parameters:
solution - A partial solution to the problem. It represents a search subtree. Initially, this would be the "starting" solution.
Method Detail

execute

public java.lang.Object execute(Environment environment)
The method that searches the search tree. If the search subtree represented by this task is sufficiently small, it explores it, returning the best solution found, if it is better than the best known solution; otherwise, it "branches": constructs subtasks that correspond to subtrees of this search tree.

Specified by:
execute in class Task
Parameters:
environment - Contains the the problem input & the shared object. The latter holds the cost of the best solution found so far.
Returns:
If the task is atomic (i.e., does not construct subtasks), it returns either null, if it finds no solution better than what it already knows about, or a Solution, if it does find a new minimum cost Solution. When the task does construct subtasks, it returns a MinSolution task that will receive the results of the spawned subtasks.

getSolution

public Solution getSolution()
Returns:
Returns the solution.

setSolution

public void setSolution(Solution solution)
Parameters:
solution - The solution to set.


Jicos: http://cs.ucsb.edu/projects/jicos