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

## org.optaplanner.core.impl.solution
Interface Solution<S extends Score>

All Known Implementing Classes:
  CloudBalance, CourseSchedule, Examination, MachineReassignment, Manners2009, NQueens, NurseRoster, PatientAdmissionSchedule, Schedule, TennisSolution, TimeWindowedVehicleRoutingSolution, TravelingSalesmanTour, TravelingTournament, VehicleRoutingSolution

    public interface Solution<S extends Score>

A Solution represents a problem and a possible solution of that problem. A possible solution does not need to optimal or even feasible. A Solution does not even have to be initialized with a possible solution.

A Solution is mutable. For scalability reasons, the same Solution instance will be continuously modified. It's cloned to recall the best solution.

Method Summary
`Collection<? extends Object>` | `getProblemFacts()` Called by the `DroolsScoreDirector` when the `Solution` needs to be inserted into an empty `KieSession`.
`S` | `getScore()` Returns the Score of this Solution.
`void` | `setScore(S score)` Called by the `Solver` when the Score of this Solution has been calculated.

Method Detail

### getScore

    S getScore()

  Returns the Score of this Solution.

  Returns:
    null if the Solution is uninitialized or the last calculated Score is dirty the new Score has not yet been recalculated

### setScore

    void setScore(S score)

  Called by the `Solver` when the Score of this Solution has been calculated.

  Parameters:
    `score` - null if the Solution has changed and the new Score has not yet been recalculated

### getProblemFacts

    Collection<? extends Object> getProblemFacts()

  Called by the `DroolsScoreDirector` when the `Solution` needs to be inserted into an empty `KieSession`. These facts can be used by the score rules. They don't change during planning (except through `ProblemFactChange` events).

  Do not include the planning entities as problem facts: they are automatically inserted into the `KieSession` if and only if they are initialized. When they are initialized later, they are also automatically inserted.

  Returns:
    never null (although an empty collection is allowed), all the facts of this solution except for the planning entities

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

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