org.opt4j.satdecoding
Class PooledSolver
java.lang.Object
org.opt4j.satdecoding.PooledSolver
- All Implemented Interfaces:
- Solver
public class PooledSolver
- extends java.lang.Object
- implements Solver
The PooledSolver is a decorator that enables pooling of
Solver instances and, therefore, a parallel execution of the
Solvers.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
solvers
protected final java.util.Set<Solver> solvers
queue
protected final java.util.concurrent.BlockingQueue<Solver> queue
PooledSolver
@Inject
public PooledSolver(com.google.inject.Provider<Solver> solverProvider,
int instances)
- Constructs a
PooledSolver.
- Parameters:
solverProvider - a solver providerinstances - the number of pooled instances
addConstraint
public void addConstraint(Constraint constraint)
- Description copied from interface:
Solver
- Adds a
Constraint to the Solver.
- Specified by:
addConstraint in interface Solver
- Parameters:
constraint - the added constraint
solve
public Model solve(Order order)
throws TimeoutException
- Description copied from interface:
Solver
- Solve the problem defined by the constraints with a given order
(branching strategy).
- Specified by:
solve in interface Solver
- Parameters:
order - the branching strategy
- Returns:
- a model that represents a feasible solution
- Throws:
TimeoutException - if a feasible solution cannot be found within a given amount
of time