Class DefaultPartitionedSearchPhase<Solution_>
- java.lang.Object
-
- org.optaplanner.core.impl.phase.AbstractPhase<Solution_>
-
- org.optaplanner.core.impl.partitionedsearch.DefaultPartitionedSearchPhase<Solution_>
-
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
- All Implemented Interfaces:
EventListener,PartitionedSearchPhaseLifecycleListener<Solution_>,PartitionedSearchPhase<Solution_>,PhaseLifecycleListener<Solution_>,Phase<Solution_>,SolverLifecycleListener<Solution_>
public class DefaultPartitionedSearchPhase<Solution_> extends AbstractPhase<Solution_> implements PartitionedSearchPhase<Solution_>, PartitionedSearchPhaseLifecycleListener<Solution_>
Default implementation ofPartitionedSearchPhase.
-
-
Field Summary
Fields Modifier and Type Field Description protected HeuristicConfigPolicy<Solution_>configPolicyprotected List<PhaseConfig>phaseConfigListprotected IntegerrunnablePartThreadLimitprotected SolutionPartitioner<Solution_>solutionPartitionerprotected ThreadFactorythreadFactory-
Fields inherited from class org.optaplanner.core.impl.phase.AbstractPhase
assertExpectedStepScore, assertShadowVariablesAreNotStaleAfterStep, assertStepScoreFromScratch, logger, logIndentation, phaseIndex, phaseLifecycleSupport, phaseTermination, solver, stepScoreMap
-
-
Constructor Summary
Constructors Constructor Description DefaultPartitionedSearchPhase(int phaseIndex, String logIndentation, Termination<Solution_> termination, SolutionPartitioner<Solution_> solutionPartitioner, ThreadFactory threadFactory, Integer runnablePartThreadLimit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PartitionSolver<Solution_>buildPartitionSolver(ChildThreadPlumbingTermination<Solution_> childThreadPlumbingTermination, Semaphore runnablePartThreadSemaphore, SolverScope<Solution_> solverScope)protected voiddoStep(PartitionedSearchStepScope<Solution_> stepScope)StringgetPhaseTypeString()voidphaseEnded(PartitionedSearchPhaseScope<Solution_> phaseScope)voidphaseStarted(PartitionedSearchPhaseScope<Solution_> phaseScope)voidsetConfigPolicy(HeuristicConfigPolicy<Solution_> configPolicy)voidsetPhaseConfigList(List<PhaseConfig> phaseConfigList)voidsolve(SolverScope<Solution_> solverScope)voidstepEnded(PartitionedSearchStepScope<Solution_> stepScope)voidstepStarted(PartitionedSearchStepScope<Solution_> stepScope)-
Methods inherited from class org.optaplanner.core.impl.phase.AbstractPhase
addPhaseLifecycleListener, assertWorkingSolutionInitialized, calculateWorkingStepScore, getPhaseIndex, getPhaseTermination, getSolver, isAssertExpectedStepScore, isAssertShadowVariablesAreNotStaleAfterStep, isAssertStepScoreFromScratch, phaseEnded, phaseStarted, predictWorkingStepScore, removePhaseLifecycleListener, setAssertExpectedStepScore, setAssertShadowVariablesAreNotStaleAfterStep, setAssertStepScoreFromScratch, setSolver, solvingEnded, solvingStarted, stepEnded, stepStarted
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.optaplanner.core.impl.phase.Phase
addPhaseLifecycleListener, removePhaseLifecycleListener
-
Methods inherited from interface org.optaplanner.core.impl.phase.event.PhaseLifecycleListener
phaseEnded, phaseStarted, stepEnded, stepStarted
-
Methods inherited from interface org.optaplanner.core.impl.solver.event.SolverLifecycleListener
solvingEnded, solvingStarted
-
-
-
-
Field Detail
-
solutionPartitioner
protected final SolutionPartitioner<Solution_> solutionPartitioner
-
threadFactory
protected final ThreadFactory threadFactory
-
runnablePartThreadLimit
protected final Integer runnablePartThreadLimit
-
phaseConfigList
protected List<PhaseConfig> phaseConfigList
-
configPolicy
protected HeuristicConfigPolicy<Solution_> configPolicy
-
-
Constructor Detail
-
DefaultPartitionedSearchPhase
public DefaultPartitionedSearchPhase(int phaseIndex, String logIndentation, Termination<Solution_> termination, SolutionPartitioner<Solution_> solutionPartitioner, ThreadFactory threadFactory, Integer runnablePartThreadLimit)
-
-
Method Detail
-
setPhaseConfigList
public void setPhaseConfigList(List<PhaseConfig> phaseConfigList)
-
setConfigPolicy
public void setConfigPolicy(HeuristicConfigPolicy<Solution_> configPolicy)
-
getPhaseTypeString
public String getPhaseTypeString()
- Specified by:
getPhaseTypeStringin classAbstractPhase<Solution_>
-
solve
public void solve(SolverScope<Solution_> solverScope)
-
buildPartitionSolver
public PartitionSolver<Solution_> buildPartitionSolver(ChildThreadPlumbingTermination<Solution_> childThreadPlumbingTermination, Semaphore runnablePartThreadSemaphore, SolverScope<Solution_> solverScope)
-
doStep
protected void doStep(PartitionedSearchStepScope<Solution_> stepScope)
-
phaseStarted
public void phaseStarted(PartitionedSearchPhaseScope<Solution_> phaseScope)
- Specified by:
phaseStartedin interfacePartitionedSearchPhaseLifecycleListener<Solution_>
-
stepStarted
public void stepStarted(PartitionedSearchStepScope<Solution_> stepScope)
- Specified by:
stepStartedin interfacePartitionedSearchPhaseLifecycleListener<Solution_>
-
stepEnded
public void stepEnded(PartitionedSearchStepScope<Solution_> stepScope)
- Specified by:
stepEndedin interfacePartitionedSearchPhaseLifecycleListener<Solution_>
-
phaseEnded
public void phaseEnded(PartitionedSearchPhaseScope<Solution_> phaseScope)
- Specified by:
phaseEndedin interfacePartitionedSearchPhaseLifecycleListener<Solution_>
-
-