Cream version 1.06 Core API Specification

jp.ac.kobe_u.cs.cream
Class DefaultSolver

java.lang.Object
  extended by jp.ac.kobe_u.cs.cream.Solver
      extended by jp.ac.kobe_u.cs.cream.DefaultSolver
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
NeighborhoodSearchSolver

public class DefaultSolver
extends Solver

A branch-and-bound solver.

Since:
1.0
See Also:
Solver

Field Summary
static int BISECT
          An option for choosing the value of the selected variable
static int ENUM
          An option for choosing the value of the selected variable
static int RANDOM
          An option for choosing a random value of the selected variable
static int STEP
          An option for choosing the value of the selected variable
 
Fields inherited from class jp.ac.kobe_u.cs.cream.Solver
BETTER, DEFAULT, MAXIMIZE, MINIMIZE, NONE
 
Constructor Summary
DefaultSolver(Network network)
          Constructs a branch-and-bound solver for the given network.
DefaultSolver(Network network, int options)
          Constructs a branch-and-bound solver for the given network and options.
DefaultSolver(Network network, int options, String name)
          Constructs a branch-and-bound solver for the given network, options, and name.
DefaultSolver(Network network, String name)
          Constructs a branch-and-bound solver for the given network and name.
 
Method Summary
 int getChoice()
          Returns the option for choosing variable value.
 Trail getTrail()
          Returns the trail stack.
 void run()
          The body of the solver.
 boolean satisfy()
          Performs the consistency algorithm until no variables are changed.
 Variable selectVariable()
          Selects a decision variable.
 void setChoice(int choice)
          Sets the option for choosing variable value.
 
Methods inherited from class jp.ac.kobe_u.cs.cream.Solver
clearBest, findAll, findAll, findBest, findBest, findFirst, findFirst, getBestSolution, getBestValue, getCount, getElapsedTime, getID, getMonitor, getOption, getSolution, isAborted, join, resetIDCounter, resume, setMonitor, start, start, start, start, stop, toString, waitNext, waitNext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STEP

public static final int STEP
An option for choosing the value of the selected variable

See Also:
Constant Field Values

ENUM

public static final int ENUM
An option for choosing the value of the selected variable

See Also:
Constant Field Values

BISECT

public static final int BISECT
An option for choosing the value of the selected variable

See Also:
Constant Field Values

RANDOM

public static final int RANDOM
An option for choosing a random value of the selected variable

See Also:
Constant Field Values
Constructor Detail

DefaultSolver

public DefaultSolver(Network network)
Constructs a branch-and-bound solver for the given network. This constructor is equivalent to DefaultSolver(network, DEFAULT, null).

Parameters:
network - the constraint network

DefaultSolver

public DefaultSolver(Network network,
                     int options)
Constructs a branch-and-bound solver for the given network and options. This constructor is equivalent to DefaultSolver(network, options, null).

Parameters:
network - the constraint network
options - the options for search choice

DefaultSolver

public DefaultSolver(Network network,
                     String name)
Constructs a branch-and-bound solver for the given network and name. This constructor is equivalent to DefaultSolver(network, DEFAULT, name).

Parameters:
network - the constraint network
name - the name of the solver

DefaultSolver

public DefaultSolver(Network network,
                     int options,
                     String name)
Constructs a branch-and-bound solver for the given network, options, and name.

Parameters:
network - the constraint network
options - the options for search choice, or DEFAULT for default search choice
name - the name of the solver, or null for a default name
Method Detail

getChoice

public int getChoice()
Returns the option for choosing variable value.

Returns:
the choice

setChoice

public void setChoice(int choice)
Sets the option for choosing variable value.

Parameters:
choice - the choice to set

getTrail

public Trail getTrail()
Returns the trail stack.

Returns:
the trail

satisfy

public boolean satisfy()
Performs the consistency algorithm until no variables are changed.

Returns:
true when the consistency algorithm succeeds

selectVariable

public Variable selectVariable()
Selects a decision variable.

Returns:
the decision variable

run

public void run()
Description copied from class: Solver
The body of the solver. This method is called from Solver.start() methods.

Specified by:
run in interface Runnable
Specified by:
run in class Solver

Cream version 1.06 Core API Specification

Cream: Constraint Programming Class Library for Java