Class MultiThreadedConstructionHeuristicDecider<Solution_>
java.lang.Object
org.optaplanner.core.impl.constructionheuristic.decider.ConstructionHeuristicDecider<Solution_>
org.optaplanner.core.impl.constructionheuristic.decider.MultiThreadedConstructionHeuristicDecider<Solution_>
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotation
public class MultiThreadedConstructionHeuristicDecider<Solution_>
extends ConstructionHeuristicDecider<Solution_>
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
protected boolean
protected ExecutorService
protected CyclicBarrier
protected final int
protected List<MoveThreadRunner<Solution_,
?>> protected BlockingQueue<MoveThreadOperation<Solution_>>
protected OrderByMoveIndexBlockingQueue<Solution_>
protected final int
protected final ThreadFactory
Fields inherited from class org.optaplanner.core.impl.constructionheuristic.decider.ConstructionHeuristicDecider
assertExpectedUndoMoveScore, assertMoveScoreFromScratch, forager, logger, logIndentation, termination
-
Constructor Summary
ConstructorDescriptionMultiThreadedConstructionHeuristicDecider
(String logIndentation, Termination<Solution_> termination, ConstructionHeuristicForager<Solution_> forager, ThreadFactory threadFactory, int moveThreadCount, int selectedMoveBufferSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected ExecutorService
void
decideNextStep
(ConstructionHeuristicStepScope<Solution_> stepScope, Placement<Solution_> placement) void
phaseEnded
(ConstructionHeuristicPhaseScope<Solution_> phaseScope) void
phaseStarted
(ConstructionHeuristicPhaseScope<Solution_> phaseScope) void
setAssertExpectedStepScore
(boolean assertExpectedStepScore) void
setAssertShadowVariablesAreNotStaleAfterStep
(boolean assertShadowVariablesAreNotStaleAfterStep) void
setAssertStepScoreFromScratch
(boolean assertStepScoreFromScratch) void
solvingError
(SolverScope<Solution_> solverScope, Exception exception) Methods inherited from class org.optaplanner.core.impl.constructionheuristic.decider.ConstructionHeuristicDecider
doMove, getForager, pickMove, setAssertExpectedUndoMoveScore, setAssertMoveScoreFromScratch, solvingEnded, solvingStarted, stepEnded, stepStarted
-
Field Details
-
threadFactory
-
moveThreadCount
protected final int moveThreadCount -
selectedMoveBufferSize
protected final int selectedMoveBufferSize -
assertStepScoreFromScratch
protected boolean assertStepScoreFromScratch -
assertExpectedStepScore
protected boolean assertExpectedStepScore -
assertShadowVariablesAreNotStaleAfterStep
protected boolean assertShadowVariablesAreNotStaleAfterStep -
operationQueue
-
resultQueue
-
moveThreadBarrier
-
executor
-
moveThreadRunnerList
-
-
Constructor Details
-
MultiThreadedConstructionHeuristicDecider
public MultiThreadedConstructionHeuristicDecider(String logIndentation, Termination<Solution_> termination, ConstructionHeuristicForager<Solution_> forager, ThreadFactory threadFactory, int moveThreadCount, int selectedMoveBufferSize)
-
-
Method Details
-
setAssertStepScoreFromScratch
public void setAssertStepScoreFromScratch(boolean assertStepScoreFromScratch) -
setAssertExpectedStepScore
public void setAssertExpectedStepScore(boolean assertExpectedStepScore) -
setAssertShadowVariablesAreNotStaleAfterStep
public void setAssertShadowVariablesAreNotStaleAfterStep(boolean assertShadowVariablesAreNotStaleAfterStep) -
phaseStarted
- Overrides:
phaseStarted
in classConstructionHeuristicDecider<Solution_>
-
phaseEnded
- Overrides:
phaseEnded
in classConstructionHeuristicDecider<Solution_>
-
solvingError
- Overrides:
solvingError
in classConstructionHeuristicDecider<Solution_>
-
createThreadPoolExecutor
-
decideNextStep
public void decideNextStep(ConstructionHeuristicStepScope<Solution_> stepScope, Placement<Solution_> placement) - Overrides:
decideNextStep
in classConstructionHeuristicDecider<Solution_>
-