V
- VariableT
- Valuepublic class ParallelSolver<V extends Variable<V,T>,T extends Value<V,T>> extends Solver<V,T>
DefaultParallelAssignment
, but the best solution
is shared among all of them.DefaultSingleAssignment
is given to the solver, only one solution is used.
A neighbour is assigned to this (shared) solution when it does not create any conflicts
outside of Neighbour.assignments()
.Solver
Modifier and Type | Class and Description |
---|---|
protected class |
ParallelSolver.AssignmentThread
Solver thread
|
protected class |
ParallelSolver.SolverThread
Solver thread
|
protected class |
ParallelSolver.SynchronizationThread
Synchronization thread
|
iCurrentSolution, iLastSolution, iProgress, iSaveBestUnassigned, iSolverListeners, iSolverThread, iStop, sLogger, THREAD_PRIORITY
Constructor and Description |
---|
ParallelSolver(DataProperties properties) |
Modifier and Type | Method and Description |
---|---|
protected Solution<V,T> |
createParallelSolution(int index)
Create a solution that is to be used by a solver thread of the given index
|
Thread |
getSolverThread()
Returns solver's thread
|
protected Solution<V,T> |
getWorkingSolution()
Return a working (parallel) solution that contributed to the best solution last.
|
boolean |
hasSingleSolution()
Returns true if the solver works only with one solution (regardless the number of threads it is using)
|
void |
setInitalSolution(Model<V,T> model)
Sets initial solution
|
void |
start()
Starts solver
|
addExtension, addSolverListener, autoConfigure, clearBest, currentSolution, dispose, getExtensions, getNeighbourSelection, getPerturbationsCounter, getProperties, getSolutionComparator, getSolverListeners, getTerminationCondition, init, initSolver, isRunning, isStop, isUpdateProgress, lastSolution, onAssigned, onFailure, onFinish, onStart, onStop, removeSolverListener, setInitalSolution, setNeighbourSelection, setPerturbationsCounter, setSolutionComparator, setTerminalCondition, setUpdateProgress, stopSolver, stopSolver
public ParallelSolver(DataProperties properties)
public void start()
public Thread getSolverThread()
public void setInitalSolution(Model<V,T> model)
protected Solution<V,T> getWorkingSolution()
protected Solution<V,T> createParallelSolution(int index)
index
- solver thread indexpublic boolean hasSingleSolution()