public class SingleEvaluatedMoveCache extends Object implements EvaluatedMoveCache
This is the default cache of any neighbourhood search.
Constructor and Description |
---|
SingleEvaluatedMoveCache()
Create an empty single evaluated move cache.
|
Modifier and Type | Method and Description |
---|---|
void |
cacheMoveEvaluation(Move<?> move,
Evaluation evaluation)
Cache the given evaluation, discarding any previously cached evaluations.
|
void |
cacheMoveValidation(Move<?> move,
Validation validation)
Cache validation of the given move, discarding any previously cached value.
|
void |
clear()
Clear all cached values.
|
Evaluation |
getCachedMoveEvaluation(Move<?> move)
Retrieve a cached evaluation, if still available.
|
Validation |
getCachedMoveValidation(Move<?> move)
Retrieve a cached validation, if still available.
|
public SingleEvaluatedMoveCache()
public final void cacheMoveEvaluation(Move<?> move, Evaluation evaluation)
cacheMoveEvaluation
in interface EvaluatedMoveCache
move
- move applied to the current solutionevaluation
- evaluation of obtained neighbourpublic final Evaluation getCachedMoveEvaluation(Move<?> move)
getCachedMoveEvaluation
in interface EvaluatedMoveCache
move
- move applied to the current solutionnull
if notpublic final void cacheMoveValidation(Move<?> move, Validation validation)
cacheMoveValidation
in interface EvaluatedMoveCache
move
- move applied to the current solutionvalidation
- validation of obtained neighbourpublic final Validation getCachedMoveValidation(Move<?> move)
getCachedMoveValidation
in interface EvaluatedMoveCache
move
- move applied to the current solutionnull
if notpublic final void clear()
clear
in interface EvaluatedMoveCache
Copyright © 2016. All rights reserved.