java.lang.Objectsat.SATProblem
public class SATProblem
This class is used to capture an instance of the k-SAT problem.
Problem
Field Summary | |
---|---|
int |
C
# Clauses. |
java.lang.String |
errorMessage
If there's an error in the problem instance, a message is written here. |
int |
K
K = #literals/clause. |
int[][] |
literals
This 2D array is used to store the actual clauses. |
int |
N
# Variables. |
int |
T
T=1 if we do NOT allow the same variable appearing more than once in a clause. |
java.lang.String |
topMessage
|
Constructor Summary | |
---|---|
SATProblem(boolean noParameters)
|
|
SATProblem(int K,
int N,
int C,
int T,
int[][] literals)
Problem-instance creators should use this constructor. |
Method Summary | |
---|---|
java.lang.String |
getErrorMessage()
Retrieve error message about an invalid problem. |
void |
readFromFile(java.io.File f)
Read the problem in plain text from the given file. |
java.lang.String |
toString()
Returns a problem description summary. |
void |
writeToFile(java.io.File f)
Write the problem in plain text to the given file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int K
public int N
public int C
public int T
public int[][] literals
public java.lang.String errorMessage
public java.lang.String topMessage
Constructor Detail |
---|
public SATProblem(boolean noParameters)
public SATProblem(int K, int N, int C, int T, int[][] literals)
K
- an int
valueN
- an int
valueC
- an int
valueT
- an int
valueliterals
- an int[][]
valueMethod Detail |
---|
public void writeToFile(java.io.File f)
Problem
writeToFile
in interface Problem
f
- a File
valuepublic void readFromFile(java.io.File f)
Problem
readFromFile
in interface Problem
f
- a File
valuepublic java.lang.String toString()
Problem
toString
in interface Problem
toString
in class java.lang.Object
String
valuepublic java.lang.String getErrorMessage()
Problem
getErrorMessage
in interface Problem
String
value