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
f4790fb8
Commit
f4790fb8
authored
Aug 11, 2020
by
Romain Wallon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds a slack based LCDS
parent
a5f75884
Pipeline
#9327
canceled with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
org.sat4j.pb/src/main/java/org/sat4j/pb/lcds/PBGlucoseLCDS.java
...t4j.pb/src/main/java/org/sat4j/pb/lcds/PBGlucoseLCDS.java
+6
-0
org.sat4j.pb/src/main/java/org/sat4j/pb/lcds/SlackLBDComputerStrategy.java
...main/java/org/sat4j/pb/lcds/SlackLBDComputerStrategy.java
+25
-0
org.sat4j.sat/src/main/java/org/sat4j/sat/KTHLauncher.java
org.sat4j.sat/src/main/java/org/sat4j/sat/KTHLauncher.java
+5
-0
No files found.
org.sat4j.pb/src/main/java/org/sat4j/pb/lcds/PBGlucoseLCDS.java
View file @
f4790fb8
...
...
@@ -79,6 +79,12 @@ public class PBGlucoseLCDS<D extends DataStructureFactory>
new
RatioCoefficientsDegreeLBDComputerStrategy
());
}
public
static
<
D
extends
DataStructureFactory
>
LearnedConstraintsDeletionStrategy
newSlack
(
Solver
<
D
>
solver
,
ConflictTimer
timer
)
{
return
new
PBGlucoseLCDS
<
D
>(
solver
,
timer
,
new
SlackLBDComputerStrategy
());
}
@Override
public
void
init
()
{
super
.
init
();
...
...
org.sat4j.pb/src/main/java/org/sat4j/pb/lcds/SlackLBDComputerStrategy.java
0 → 100644
View file @
f4790fb8
package
org.sat4j.pb.lcds
;
import
java.math.BigInteger
;
import
org.sat4j.minisat.core.ILits
;
import
org.sat4j.pb.constraints.pb.PBConstr
;
public
class
SlackLBDComputerStrategy
implements
ILBDComputerStrategy
{
@Override
public
void
init
(
int
howmany
)
{
// TODO Auto-generated method stub
}
@Override
public
int
computeLBD
(
ILits
voc
,
PBConstr
constr
,
int
propagated
)
{
BigInteger
slack
=
constr
.
getSumCoefs
().
subtract
(
constr
.
getDegree
());
if
(
slack
.
bitLength
()
<
Integer
.
SIZE
)
{
return
slack
.
intValue
();
}
return
Integer
.
MAX_VALUE
;
}
}
org.sat4j.sat/src/main/java/org/sat4j/sat/KTHLauncher.java
View file @
f4790fb8
...
...
@@ -502,6 +502,11 @@ public class KTHLauncher {
.
newRatio
(
cpsolver
,
timer
);
cpsolver
.
setLearnedConstraintsDeletionStrategy
(
lcds
);
}
else
if
(
"slack"
.
equals
(
value
))
{
LearnedConstraintsDeletionStrategy
lcds
=
PBGlucoseLCDS
.
newSlack
(
cpsolver
,
timer
);
cpsolver
.
setLearnedConstraintsDeletionStrategy
(
lcds
);
}
else
{
log
(
value
+
" is not a supported value for option deletion-strategy"
);
...
...
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