Class MultiThreadedLocalSearchDecider<Solution_>
- java.lang.Object
-
- org.optaplanner.core.impl.localsearch.decider.LocalSearchDecider<Solution_>
-
- org.optaplanner.core.impl.localsearch.decider.MultiThreadedLocalSearchDecider<Solution_>
-
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
public class MultiThreadedLocalSearchDecider<Solution_> extends LocalSearchDecider<Solution_>
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanassertExpectedStepScoreprotected booleanassertShadowVariablesAreNotStaleAfterStepprotected booleanassertStepScoreFromScratchprotected ExecutorServiceexecutorprotected CyclicBarriermoveThreadBarrierprotected intmoveThreadCountprotected List<MoveThreadRunner<Solution_,?>>moveThreadRunnerListprotected BlockingQueue<MoveThreadOperation<Solution_>>operationQueueprotected OrderByMoveIndexBlockingQueue<Solution_>resultQueueprotected intselectedMoveBufferSizeprotected ThreadFactorythreadFactory-
Fields inherited from class org.optaplanner.core.impl.localsearch.decider.LocalSearchDecider
acceptor, assertExpectedUndoMoveScore, assertMoveScoreFromScratch, forager, logger, logIndentation, moveSelector, termination
-
-
Constructor Summary
Constructors Constructor Description MultiThreadedLocalSearchDecider(String logIndentation, Termination<Solution_> termination, MoveSelector<Solution_> moveSelector, Acceptor<Solution_> acceptor, LocalSearchForager<Solution_> forager, ThreadFactory threadFactory, int moveThreadCount, int selectedMoveBufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ExecutorServicecreateThreadPoolExecutor()voiddecideNextStep(LocalSearchStepScope<Solution_> stepScope)voidphaseEnded(LocalSearchPhaseScope<Solution_> phaseScope)voidphaseStarted(LocalSearchPhaseScope<Solution_> phaseScope)voidsetAssertExpectedStepScore(boolean assertExpectedStepScore)voidsetAssertShadowVariablesAreNotStaleAfterStep(boolean assertShadowVariablesAreNotStaleAfterStep)voidsetAssertStepScoreFromScratch(boolean assertStepScoreFromScratch)-
Methods inherited from class org.optaplanner.core.impl.localsearch.decider.LocalSearchDecider
doMove, getAcceptor, getForager, getMoveSelector, getTermination, pickMove, setAssertExpectedUndoMoveScore, setAssertMoveScoreFromScratch, solvingEnded, solvingStarted, stepEnded, stepStarted
-
-
-
-
Field Detail
-
threadFactory
protected final ThreadFactory threadFactory
-
moveThreadCount
protected final int moveThreadCount
-
selectedMoveBufferSize
protected final int selectedMoveBufferSize
-
assertStepScoreFromScratch
protected boolean assertStepScoreFromScratch
-
assertExpectedStepScore
protected boolean assertExpectedStepScore
-
assertShadowVariablesAreNotStaleAfterStep
protected boolean assertShadowVariablesAreNotStaleAfterStep
-
operationQueue
protected BlockingQueue<MoveThreadOperation<Solution_>> operationQueue
-
resultQueue
protected OrderByMoveIndexBlockingQueue<Solution_> resultQueue
-
moveThreadBarrier
protected CyclicBarrier moveThreadBarrier
-
executor
protected ExecutorService executor
-
moveThreadRunnerList
protected List<MoveThreadRunner<Solution_,?>> moveThreadRunnerList
-
-
Constructor Detail
-
MultiThreadedLocalSearchDecider
public MultiThreadedLocalSearchDecider(String logIndentation, Termination<Solution_> termination, MoveSelector<Solution_> moveSelector, Acceptor<Solution_> acceptor, LocalSearchForager<Solution_> forager, ThreadFactory threadFactory, int moveThreadCount, int selectedMoveBufferSize)
-
-
Method Detail
-
setAssertStepScoreFromScratch
public void setAssertStepScoreFromScratch(boolean assertStepScoreFromScratch)
-
setAssertExpectedStepScore
public void setAssertExpectedStepScore(boolean assertExpectedStepScore)
-
setAssertShadowVariablesAreNotStaleAfterStep
public void setAssertShadowVariablesAreNotStaleAfterStep(boolean assertShadowVariablesAreNotStaleAfterStep)
-
phaseStarted
public void phaseStarted(LocalSearchPhaseScope<Solution_> phaseScope)
- Overrides:
phaseStartedin classLocalSearchDecider<Solution_>
-
phaseEnded
public void phaseEnded(LocalSearchPhaseScope<Solution_> phaseScope)
- Overrides:
phaseEndedin classLocalSearchDecider<Solution_>
-
createThreadPoolExecutor
protected ExecutorService createThreadPoolExecutor()
-
decideNextStep
public void decideNextStep(LocalSearchStepScope<Solution_> stepScope)
- Overrides:
decideNextStepin classLocalSearchDecider<Solution_>
-
-