Cream version 1.2 Core API Specification

jp.ac.kobe_u.cs.cream
Class LocalSearch

java.lang.Object
  extended byjp.ac.kobe_u.cs.cream.Solver
      extended byjp.ac.kobe_u.cs.cream.LocalSearch
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
IBBSearch, SASearch, TabooSearch

public class LocalSearch
extends Solver

A super class of local search solvers, and also an implementation of a random walk solver. Local search is an iterative procedure. It first finds an initial soluttion, and iteratively make a small change

Since:
1.0
See Also:
Solver

Field Summary
 long iterationTimeout
           
 
Fields inherited from class jp.ac.kobe_u.cs.cream.Solver
BETTER, DEFAULT, MAXIMIZE, MINIMIZE, NONE
 
Constructor Summary
LocalSearch(Network network)
          Constructs a random-walk solver for the given network.
LocalSearch(Network network, int option)
          Constructs a random-walk solver for the given network and option.
LocalSearch(Network network, int option, java.lang.String name)
          Constructs a random-walk solver for the given network, option, and name.
LocalSearch(Network network, java.lang.String name)
          Constructs a random-walk solver for the given network and name.
 
Method Summary
 double getExchangeRate()
           
 void run()
          The body of the solver.
 void setCandidate(Solution candidate)
          Sets a candidate solution for a next iteration.
 void setExchangeRate(double rate)
           
 void stop()
          Stops the execution of the solver.
 
Methods inherited from class jp.ac.kobe_u.cs.cream.Solver
clearBest, findAll, findAll, findBest, findBest, findFirst, findFirst, getBestSolution, getBestValue, getID, getOption, getSolution, join, resetIDCounter, resume, setMonitor, start, start, start, start, toString, waitNext, waitNext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

iterationTimeout

public long iterationTimeout
Constructor Detail

LocalSearch

public LocalSearch(Network network)
Constructs a random-walk solver for the given network. This constructor is equivalent to LocalSearch(network, DEFAULT, null).

Parameters:
network - the constraint network

LocalSearch

public LocalSearch(Network network,
                   int option)
Constructs a random-walk solver for the given network and option. This constructor is equivalent to LocalSearch(network, option, null).

Parameters:
network - the constraint network
option - the option for search strategy

LocalSearch

public LocalSearch(Network network,
                   java.lang.String name)
Constructs a random-walk solver for the given network and name. This constructor is equivalent to LocalSearch(network, DEFAULT, name).

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

LocalSearch

public LocalSearch(Network network,
                   int option,
                   java.lang.String name)
Constructs a random-walk solver for the given network, option, and name.

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

setCandidate

public void setCandidate(Solution candidate)
Sets a candidate solution for a next iteration.

Parameters:
candidate - the candidate

setExchangeRate

public void setExchangeRate(double rate)

getExchangeRate

public double getExchangeRate()

stop

public void stop()
Description copied from class: Solver
Stops the execution of the solver.

Overrides:
stop in class Solver

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 java.lang.Runnable
Specified by:
run in class Solver

Cream version 1.2 Core API Specification

Cream: Constraint Programming Class Library for Java