S - the type of solver to feed.public class JSONReader<S extends ISolver> extends Reader
[[-1,-2,-3],[[1,-2,3],'>',2],[4,-3,6]] for instance represents
three constraints, two clauses and the cardinality constraint x1 + not x2 +
x3 > 2.| Modifier and Type | Field and Description |
|---|---|
static String |
CARD |
static String |
CLAUSE |
String |
constraint |
String |
formula |
protected S |
solver |
| Constructor and Description |
|---|
JSONReader(S solver) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
constraintRegexp() |
String |
decode(int[] model)
Deprecated.
|
void |
decode(int[] model,
PrintWriter out)
Produce a model using the reader format on a provided printwriter.
|
protected IVecInt |
getLiterals(String constraint) |
protected void |
handleCard(String constraint) |
protected void |
handleNotHandled(String constraint) |
IProblem |
parseInstance(InputStream in)
Read a file from a stream.
|
ISolver |
parseString(String json) |
isVerbose, parseInstance, parseInstance, setVerbositypublic static final String CLAUSE
public static final String CARD
public final String constraint
public final String formula
public JSONReader(S solver)
protected String constraintRegexp()
protected void handleNotHandled(String constraint) throws ParseFormatException, ContradictionException
protected IVecInt getLiterals(String constraint) throws ParseFormatException
ParseFormatExceptionprotected void handleCard(String constraint) throws ParseFormatException, ContradictionException
public IProblem parseInstance(InputStream in) throws ParseFormatException, ContradictionException, IOException
ReaderparseInstance in class Readerin - a stream containing the benchmark.ParseFormatException - if an error occurs during parsing.ContradictionException - if the problem is found trivially inconsistent.IOException - if an I/O error occurs.public ISolver parseString(String json) throws ParseFormatException, ContradictionException
@Deprecated public String decode(int[] model)
Readerpublic void decode(int[] model,
PrintWriter out)
ReaderCopyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.