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

## org.optaplanner.examples.cheaptime.solver.score
Class CheapTimeIncrementalScoreCalculator

    java.lang.Object
      org.optaplanner.core.impl.score.director.incremental.AbstractIncrementalScoreCalculator<CheapTimeSolution>
          org.optaplanner.examples.cheaptime.solver.score.CheapTimeIncrementalScoreCalculator

All Implemented Interfaces:
  ConstraintMatchAwareIncrementalScoreCalculator<CheapTimeSolution>, IncrementalScoreCalculator<CheapTimeSolution>

    public class CheapTimeIncrementalScoreCalculator

extends AbstractIncrementalScoreCalculator<CheapTimeSolution>
implements ConstraintMatchAwareIncrementalScoreCalculator<CheapTimeSolution>

Field Summary
`protected static String` | `CONSTRAINT_PACKAGE`
`protected org.slf4j.Logger` | `logger`

Constructor Summary
`CheapTimeIncrementalScoreCalculator()`

Method Summary
`void` | `afterEntityAdded(Object entity)`
`void` | `afterEntityRemoved(Object entity)`
`void` | `afterVariableChanged(Object entity, String variableName)`
`void` | `beforeEntityAdded(Object entity)`
`void` | `beforeEntityRemoved(Object entity)`
`void` | `beforeVariableChanged(Object entity, String variableName)`
`HardMediumSoftLongScore` | `calculateScore()`
`Collection<ConstraintMatchTotal>` | `getConstraintMatchTotals()`
`void` | `resetWorkingSolution(CheapTimeSolution solution)` There are no `IncrementalScoreCalculator.beforeEntityAdded(Object)` and `IncrementalScoreCalculator.afterEntityAdded(Object)` calls for entities that are already present in the workingSolution.
`void` | `resetWorkingSolution(CheapTimeSolution workingSolution, boolean constraintMatchEnabled)` Allows for increased performance by tracking only if constraintMatchEnabled is true.

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

Field Detail

### CONSTRAINT_PACKAGE

    protected static final String CONSTRAINT_PACKAGE

See Also:
  Constant Field Values

### logger

    protected final transient org.slf4j.Logger logger

Constructor Detail

### CheapTimeIncrementalScoreCalculator

    public CheapTimeIncrementalScoreCalculator()

Method Detail

### resetWorkingSolution

    public void resetWorkingSolution(CheapTimeSolution solution)

  Description copied from interface: `IncrementalScoreCalculator`
  There are no `IncrementalScoreCalculator.beforeEntityAdded(Object)` and `IncrementalScoreCalculator.afterEntityAdded(Object)` calls for entities that are already present in the workingSolution.

  Specified by:
    `resetWorkingSolution` in interface `IncrementalScoreCalculator<CheapTimeSolution>`
  Parameters:
    `solution` - never null

### beforeEntityAdded

    public void beforeEntityAdded(Object entity)

  Specified by:
    `beforeEntityAdded` in interface `IncrementalScoreCalculator<CheapTimeSolution>`

### afterEntityAdded

    public void afterEntityAdded(Object entity)

  Specified by:
    `afterEntityAdded` in interface `IncrementalScoreCalculator<CheapTimeSolution>`

### beforeVariableChanged

    public void beforeVariableChanged(Object entity,
                                      String variableName)

  Specified by:
    `beforeVariableChanged` in interface `IncrementalScoreCalculator<CheapTimeSolution>`

### afterVariableChanged

    public void afterVariableChanged(Object entity,
                                     String variableName)

  Specified by:
    `afterVariableChanged` in interface `IncrementalScoreCalculator<CheapTimeSolution>`

### beforeEntityRemoved

    public void beforeEntityRemoved(Object entity)

  Specified by:
    `beforeEntityRemoved` in interface `IncrementalScoreCalculator<CheapTimeSolution>`

### afterEntityRemoved

    public void afterEntityRemoved(Object entity)

  Specified by:
    `afterEntityRemoved` in interface `IncrementalScoreCalculator<CheapTimeSolution>`

### calculateScore

    public HardMediumSoftLongScore calculateScore()

  Specified by:
    `calculateScore` in interface `IncrementalScoreCalculator<CheapTimeSolution>`
  Returns:
    never null

### resetWorkingSolution

    public void resetWorkingSolution(CheapTimeSolution workingSolution,
                                     boolean constraintMatchEnabled)

  Description copied from interface: `ConstraintMatchAwareIncrementalScoreCalculator`
  Allows for increased performance by tracking only if constraintMatchEnabled is true.

  Every implementation should call `IncrementalScoreCalculator.resetWorkingSolution(Solution)` and only handle the constraintMatchEnabled parameter specifically (or ignore it).

  Specified by:
    `resetWorkingSolution` in interface `ConstraintMatchAwareIncrementalScoreCalculator<CheapTimeSolution>`
  Parameters:
    `workingSolution` - never null, to pass to `IncrementalScoreCalculator.resetWorkingSolution(Solution)`.
    `constraintMatchEnabled` - true if `ConstraintMatchAwareIncrementalScoreCalculator.getConstraintMatchTotals()` might be called.

### getConstraintMatchTotals

    public Collection<ConstraintMatchTotal> getConstraintMatchTotals()

  Specified by:
    `getConstraintMatchTotals` in interface `ConstraintMatchAwareIncrementalScoreCalculator<CheapTimeSolution>`
  Returns:
    never null
  See Also:
    `ScoreDirector.getConstraintMatchTotals()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| OptaPlanner distribution 6.2.0.Beta3
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.