Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.drools.planner.core
Interface Solver

All Known Subinterfaces:
  BruteForceSolver, LocalSearchSolver

All Known Implementing Classes:
  AbstractSolver, DefaultBruteForceSolver, DefaultLocalSearchSolver

    public interface Solver

A Solver solves planning problems.

Most methods are not thread-safe and should be called from the same thread.

Method Summary
`void` | `addEventListener(SolverEventListener eventListener)`
`Solution` | `getBestSolution()`
`ScoreDefinition` | `getScoreDefinition()`
`long` | `getTimeMillisSpend()` TODO timeMillisSpend should not continue to increase after the solver has been terminated
`boolean` | `isTerminatedEarly()` This method is thread-safe.
`void` | `removeEventListener(SolverEventListener eventListener)`
`void` | `setStartingSolution(Solution startingSolution)`
`void` | `solve()` Solves the planning problem.
`boolean` | `terminateEarly()` Notifies the solver that it should stop at its earliest convenience.

Method Detail

### setStartingSolution

    void setStartingSolution(Solution startingSolution)

  Parameters:
    `startingSolution` - never null

### getBestSolution

    Solution getBestSolution()

  Returns:
    never null after solving

### getTimeMillisSpend

    long getTimeMillisSpend()

  TODO timeMillisSpend should not continue to increase after the solver has been terminated

  Returns:
    the amount of millis spend since this solver started

### solve

    void solve()

  Solves the planning problem. It can take minutes, even hours or days before this method returns, depending on the termination configuration. To terminate a `Solver` early, call `terminateEarly()`.

  See Also:
    `terminateEarly()`

### terminateEarly

    boolean terminateEarly()

  Notifies the solver that it should stop at its earliest convenience. This method returns immediatly, but it takes an undetermined time for the `solve()` to actually return.

  This method is thread-safe.

  Returns:
    true if successful
  See Also:
    `isTerminatedEarly()`, `Future.cancel(boolean)`

### isTerminatedEarly

    boolean isTerminatedEarly()

  This method is thread-safe.

  Returns:
    true if terminateEarly has been called since the started.
  See Also:
    `Future.isCancelled()`

### addEventListener

    void addEventListener(SolverEventListener eventListener)

  Parameters:
    `eventListener` - never null

### removeEventListener

    void removeEventListener(SolverEventListener eventListener)

  Parameters:
    `eventListener` - never null

### getScoreDefinition

    ScoreDefinition getScoreDefinition()

  Returns:
    never null

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2011 JBoss Inc.. All Rights Reserved.