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.solution.director
Class DefaultSolutionDirector

    java.lang.Object
      org.drools.planner.core.solution.director.DefaultSolutionDirector

All Implemented Interfaces:
  SolutionDirector

    public class DefaultSolutionDirector

extends Object
implements SolutionDirector

Default implementation for `SolutionDirector`.

See Also:
  `SolutionDirector`

Field Summary
`protected long` | `calculateCount`
`static String` | `GLOBAL_SCORE_CALCULATOR_KEY`
`protected org.slf4j.Logger` | `logger`
`protected org.drools.RuleBase` | `ruleBase`
`protected ScoreDefinition` | `scoreDefinition`
`protected SolutionDescriptor` | `solutionDescriptor`
`protected org.drools.StatefulSession` | `workingMemory`
`protected ScoreCalculator` | `workingScoreCalculator`
`protected Solution` | `workingSolution`

Constructor Summary
`DefaultSolutionDirector()`

Method Summary
`void` | `assertWorkingScore(Score presumedScore)`
`String` | `buildConstraintOccurrenceSummary()` Calls `buildConstraintOccurrenceSummary(WorkingMemory)` with the current `workingMemory`.
`String` | `buildConstraintOccurrenceSummary(org.drools.WorkingMemory summaryWorkingMemory)` TODO Refactor this with the ConstraintOccurrenceTotal class: https://jira.jboss.org/jira/browse/JBRULES-2510
`Score` | `calculateScoreFromWorkingMemory()` Calculates the and updates the workingSolution accordingly.
`long` | `getCalculateCount()`
`org.drools.RuleBase` | `getRuleBase()`
`ScoreDefinition` | `getScoreDefinition()`
`SolutionDescriptor` | `getSolutionDescriptor()`
`Collection<Object>` | `getWorkingFacts()`
`org.drools.WorkingMemory` | `getWorkingMemory()`
`List<Object>` | `getWorkingPlanningEntityList()`
`Solution` | `getWorkingSolution()` The `Solution` that is used in the `WorkingMemory`.
`boolean` | `isWorkingSolutionInitialized()`
`void` | `resetCalculateCount()`
`void` | `setRuleBase(org.drools.RuleBase ruleBase)`
`void` | `setScoreDefinition(ScoreDefinition scoreDefinition)`
`void` | `setSolutionDescriptor(SolutionDescriptor solutionDescriptor)`
`void` | `setWorkingSolution(Solution workingSolution)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### GLOBAL_SCORE_CALCULATOR_KEY

    public static final String GLOBAL_SCORE_CALCULATOR_KEY

See Also:
  Constant Field Values

### logger

    protected final transient org.slf4j.Logger logger

### solutionDescriptor

    protected SolutionDescriptor solutionDescriptor

### ruleBase

    protected org.drools.RuleBase ruleBase

### scoreDefinition

    protected ScoreDefinition scoreDefinition

### workingSolution

    protected Solution workingSolution

### workingMemory

    protected org.drools.StatefulSession workingMemory

### workingScoreCalculator

    protected ScoreCalculator workingScoreCalculator

### calculateCount

    protected long calculateCount

Constructor Detail

### DefaultSolutionDirector

    public DefaultSolutionDirector()

Method Detail

### getSolutionDescriptor

    public SolutionDescriptor getSolutionDescriptor()

### setSolutionDescriptor

    public void setSolutionDescriptor(SolutionDescriptor solutionDescriptor)

### getRuleBase

    public org.drools.RuleBase getRuleBase()

### setRuleBase

    public void setRuleBase(org.drools.RuleBase ruleBase)

### getScoreDefinition

    public ScoreDefinition getScoreDefinition()

### setScoreDefinition

    public void setScoreDefinition(ScoreDefinition scoreDefinition)

### getWorkingSolution

    public Solution getWorkingSolution()

  Description copied from interface: `SolutionDirector`
  The `Solution` that is used in the `WorkingMemory`.

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

  Specified by:
    `getWorkingSolution` in interface `SolutionDirector`
  Returns:
    never null

### setWorkingSolution

    public void setWorkingSolution(Solution workingSolution)

### getWorkingMemory

    public org.drools.WorkingMemory getWorkingMemory()

  Specified by:
    `getWorkingMemory` in interface `SolutionDirector`
  Returns:
    never null

### getCalculateCount

    public long getCalculateCount()

### resetCalculateCount

    public void resetCalculateCount()

### getWorkingFacts

    public Collection<Object> getWorkingFacts()

### getWorkingPlanningEntityList

    public List<Object> getWorkingPlanningEntityList()

### isWorkingSolutionInitialized

    public boolean isWorkingSolutionInitialized()

### calculateScoreFromWorkingMemory

    public Score calculateScoreFromWorkingMemory()

  Description copied from interface: `SolutionDirector`
  Calculates the and updates the workingSolution accordingly.

  Specified by:
    `calculateScoreFromWorkingMemory` in interface `SolutionDirector`
  Returns:
    never null, the score of the working solution

### assertWorkingScore

    public void assertWorkingScore(Score presumedScore)

  Parameters:
    `presumedScore` - never null

### buildConstraintOccurrenceSummary

    public String buildConstraintOccurrenceSummary()

  Calls `buildConstraintOccurrenceSummary(WorkingMemory)` with the current `workingMemory`.

  Returns:
    never null

### buildConstraintOccurrenceSummary

    public String buildConstraintOccurrenceSummary(org.drools.WorkingMemory summaryWorkingMemory)

  TODO Refactor this with the ConstraintOccurrenceTotal class: https://jira.jboss.org/jira/browse/JBRULES-2510

  Parameters:
    `summaryWorkingMemory` - sometimes null
  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 by Red Hat. All Rights Reserved.