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

## org.optaplanner.core.impl.score.director
Interface ScoreDirector

All Known Subinterfaces:
  InnerScoreDirector

All Known Implementing Classes:
  AbstractScoreDirector, DroolsScoreDirector, EasyScoreDirector, IncrementalScoreDirector

    public interface ScoreDirector

The ScoreDirector holds the `workingSolution` and calculates the `Score` for that `Solution`.

Method Summary
`void` | `afterEntityAdded(Object entity)`
`void` | `afterEntityRemoved(Object entity)`
`void` | `afterProblemFactAdded(Object problemFact)`
`void` | `afterProblemFactChanged(Object problemFact)`
`void` | `afterProblemFactRemoved(Object problemFact)`
`void` | `afterVariableChanged(Object entity, String variableName)`
`void` | `beforeEntityAdded(Object entity)`
`void` | `beforeEntityRemoved(Object entity)`
`void` | `beforeProblemFactAdded(Object problemFact)`
`void` | `beforeProblemFactChanged(Object problemFact)`
`void` | `beforeProblemFactRemoved(Object problemFact)`
`void` | `beforeVariableChanged(Object entity, String variableName)`
`Score` | `calculateScore()` Calculates the `Score` and updates the `workingSolution` accordingly.
`void` | `dispose()` Needs to be called after use because some implementations needs to clean up their resources.
`Collection<ConstraintMatchTotal>` | `getConstraintMatchTotals()`
`Solution` | `getWorkingSolution()` The `Solution` that is used to calculate the `Score`.
`boolean` | `isConstraintMatchEnabled()`
`void` | `setWorkingSolution(Solution workingSolution)` The `workingSolution` must never be the same instance as the `bestSolution`, it should be a (un)changed clone.

Method Detail

### getWorkingSolution

    Solution getWorkingSolution()

  The `Solution` that is used to calculate the `Score`.

  Because a `Score` is best calculated incrementally (by delta's), the `ScoreDirector` needs to be notified when it's `workingSolution` changes.

  If the `Solution` has been changed since `calculateScore()` has been called, the `Solution.getScore()` of this `Solution` won't be correct.

  Returns:
    never null

### setWorkingSolution

    void setWorkingSolution(Solution workingSolution)

  The `workingSolution` must never be the same instance as the `bestSolution`, it should be a (un)changed clone.

  Only call this method on a separate `ScoreDirector` instance, build by `Solver.getScoreDirectorFactory()`, not on the one used inside the `Solver` itself.

  Parameters:
    `workingSolution` - never null

### calculateScore

    Score calculateScore()

  Calculates the `Score` and updates the `workingSolution` accordingly.

  Returns:
    never null, the `Score` of the `workingSolution`

### isConstraintMatchEnabled

    boolean isConstraintMatchEnabled()

  Returns:
    true if `getConstraintMatchTotals()` can be called

### getConstraintMatchTotals

    Collection<ConstraintMatchTotal> getConstraintMatchTotals()

  Returns:
    never null
  Throws:
    `IllegalStateException` - if `isConstraintMatchEnabled()` returns false

### beforeEntityAdded

    void beforeEntityAdded(Object entity)

### afterEntityAdded

    void afterEntityAdded(Object entity)

### beforeVariableChanged

    void beforeVariableChanged(Object entity,
                               String variableName)

### afterVariableChanged

    void afterVariableChanged(Object entity,
                              String variableName)

### beforeEntityRemoved

    void beforeEntityRemoved(Object entity)

### afterEntityRemoved

    void afterEntityRemoved(Object entity)

### beforeProblemFactAdded

    void beforeProblemFactAdded(Object problemFact)

### afterProblemFactAdded

    void afterProblemFactAdded(Object problemFact)

### beforeProblemFactChanged

    void beforeProblemFactChanged(Object problemFact)

### afterProblemFactChanged

    void afterProblemFactChanged(Object problemFact)

### beforeProblemFactRemoved

    void beforeProblemFactRemoved(Object problemFact)

### afterProblemFactRemoved

    void afterProblemFactRemoved(Object problemFact)

### dispose

    void dispose()

  Needs to be called after use because some implementations needs to clean up their resources.

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

Copyright © 2006-2014 JBoss by Red Hat. All Rights Reserved.