|
Cream version 1.4 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjp.ac.kobe_u.cs.cream.Solver
jp.ac.kobe_u.cs.cream.LocalSearch
public class LocalSearch
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 solution, and iteratively make a small change.
Only useful for the optimization problems containing Serialized
constraints
in the current implementation.
The default exchangeRate value for ParallelSolver
is 0.05.
*
Code
,
Serialized
Field Summary | |
---|---|
long |
initialTimeout
Timeout in milli seconds to find an initial solution for the local search. |
long |
iterationTimeout
Timeout in milli seconds to find the next solution in the iteration. |
DefaultSolver |
solver
Sub-solver used to find the initial solution and the next solution. |
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,
String name)
Constructs a random-walk solver for the given network, option, and name. |
|
LocalSearch(Network network,
String name)
Constructs a random-walk solver for the given network and name. |
Method Summary | |
---|---|
void |
endSearch()
End of the iteration. |
Solution |
getCandidate()
Returns the candidate solution for the next iteration. |
double |
getExchangeRate()
Returns the solution exchange rate for ParallelSolver . |
int |
getIterations()
Returns the iterations count. |
void |
nextSearch()
Finds the next solution. |
void |
run()
The body of the solver. |
void |
setCandidate(Solution candidate)
Sets a candidate solution for the next iteration. |
void |
setExchangeRate(double exchangeRate)
Sets the solution exchange rate used for ParallelSolver . |
void |
startSearch()
Finds the initial solution. |
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, getCount, getElapsedTime, getID, getMonitor, getOption, getSolution, isAborted, 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 |
---|
public long initialTimeout
Solver.findFirst(long)
method.
The default value is 0 (no timeout).
public long iterationTimeout
Solver.findBest(long)
method.
The default value is 5000 (5 seconds).
public DefaultSolver solver
Constructor Detail |
---|
public LocalSearch(Network network)
network
- the constraint networkpublic LocalSearch(Network network, int option)
network
- the constraint networkoption
- the option for search strategypublic LocalSearch(Network network, String name)
network
- the constraint networkname
- the name of the solverpublic LocalSearch(Network network, int option, String name)
network
- the constraint networkoption
- the option for search strategy, or DEFAULT for default search
strategyname
- the name of the solver, or null for a default nameMethod Detail |
---|
public int getIterations()
public Solution getCandidate()
public void setCandidate(Solution candidate)
candidate
- the candidatepublic double getExchangeRate()
ParallelSolver
.
public void setExchangeRate(double exchangeRate)
ParallelSolver
.
exchangeRate
- the exchange rate to setpublic void stop()
Solver
stop
in class Solver
public void startSearch()
public void nextSearch()
public void endSearch()
public void run()
Solver
Solver.start()
methods.
run
in interface Runnable
run
in class Solver
|
Cream version 1.4 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |