Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
SAT4J
sat4j
Commits
63107adc
Commit
63107adc
authored
Sep 10, 2020
by
Daniel Le Berre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow a more sober CPU consumption in Both PB solver.
parent
c091d768
Pipeline
#9336
passed with stages
in 112 minutes and 26 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
0 deletions
+96
-0
org.sat4j.core/src/main/java/org/sat4j/tools/TimeoutIsolator.java
...j.core/src/main/java/org/sat4j/tools/TimeoutIsolator.java
+42
-0
org.sat4j.pb/src/main/java/org/sat4j/pb/PBTimeoutIsolator.java
...at4j.pb/src/main/java/org/sat4j/pb/PBTimeoutIsolator.java
+40
-0
org.sat4j.pb/src/main/java/org/sat4j/pb/SolverFactory.java
org.sat4j.pb/src/main/java/org/sat4j/pb/SolverFactory.java
+14
-0
No files found.
org.sat4j.core/src/main/java/org/sat4j/tools/TimeoutIsolator.java
0 → 100644
View file @
63107adc
package
org.sat4j.tools
;
import
org.sat4j.specs.ISolver
;
/**
* Solver Decorator to prevent the solver to receive a programmatic timeout
* change.
*
* It is expected to be useful when using {@link org.sat4j.tools.ManyCore} to
* isolate the timeout of a particular solver compared to the general timeout
* given to the other solvers.
*
* @author leberre
*
*/
public
class
TimeoutIsolator
<
T
extends
ISolver
>
extends
SolverDecorator
<
T
>
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
public
TimeoutIsolator
(
T
solver
)
{
super
(
solver
);
}
@Override
public
void
setTimeoutOnConflicts
(
int
count
)
{
// ignore
}
@Override
public
void
setTimeout
(
int
t
)
{
// ignore
}
@Override
public
void
setTimeoutMs
(
long
t
)
{
// ignore
}
}
org.sat4j.pb/src/main/java/org/sat4j/pb/PBTimeoutIsolator.java
0 → 100644
View file @
63107adc
package
org.sat4j.pb
;
/**
* Solver Decorator to prevent the solver to receive a programmatic timeout
* change.
*
* It is expected to be useful when using {@link org.sat4j.tools.ManyCore} to
* isolate the timeout of a particular solver compared to the general timeout
* given to the other solvers.
*
* @author leberre
*
*/
public
class
PBTimeoutIsolator
extends
PBSolverDecorator
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
public
PBTimeoutIsolator
(
IPBSolver
solver
)
{
super
(
solver
);
}
@Override
public
void
setTimeoutOnConflicts
(
int
count
)
{
// ignore
}
@Override
public
void
setTimeout
(
int
t
)
{
// ignore
}
@Override
public
void
setTimeoutMs
(
long
t
)
{
// ignore
}
}
org.sat4j.pb/src/main/java/org/sat4j/pb/SolverFactory.java
View file @
63107adc
...
...
@@ -869,6 +869,20 @@ public final class SolverFactory extends ASolverFactory<IPBSolver> {
return
new
ManyCorePB
<
IPBSolver
>(
newResolution
(),
newCuttingPlanes
());
}
/**
* Resolution and CuttingPlanes based solvers running in parallel. Does only
* make sense if run on a computer with several cores.
*
* @return a parallel solver using both resolution and cutting planes proof
* system.
*/
public
static
IPBSolver
newSoberBoth
()
{
PBSolverCP
cp
=
newCuttingPlanes
();
cp
.
setTimeout
(
60
);
return
new
ManyCorePB
<
IPBSolver
>(
newResolution
(),
new
PBTimeoutIsolator
(
cp
));
}
/**
* Resolution and CuttingPlanesStar based solvers running in parallel. Does
* only make sense if run on a computer with several cores.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment