|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sat4j.reader.Reader
org.sat4j.pb.reader.OPBReader2005
org.sat4j.pb.reader.OPBReader2006
org.sat4j.pb.reader.OPBReader2007
public class OPBReader2007
Reader complying with the PB07 input format. Non-linear to linear translation adapted from the PB07 readers provided by Olivier Roussel and Vasco Manquinho (was available in C++, not in Java) http://www.cril.univ-artois.fr/PB07/parser/SimpleParser.java http://www.cril.univ-artois.fr/PB07/parser/SimpleParser.cc
Field Summary | |
---|---|
protected int |
nbNewSymbols
contains the number of new symbols generated to linearize products |
Fields inherited from class org.sat4j.pb.reader.OPBReader2005 |
---|
coeffs, d, hasObjFunc, hasVariablesExplanation, lits, nbConstr, nbConstraintsRead, nbVars, operator, solver |
Constructor Summary | |
---|---|
OPBReader2007(IPBSolver solver)
|
Method Summary | |
---|---|
protected void |
checkId(StringBuffer s)
|
String |
decode(int[] model)
Produce a model using the reader format. |
void |
decode(int[] model,
PrintWriter out)
Produce a model using the reader format on a provided printwriter. |
protected boolean |
isGoodFirstCharacter(char c)
|
protected void |
literalInAProduct(String var,
IVecInt lits)
callback called when we read a term of a constraint |
protected void |
negateLiteralInAProduct(String var,
IVecInt lits)
callback called when we read a term of a constraint |
protected void |
readMetaData()
read the first comment line to get the number of variables and the number of constraints in the file calls metaData with the data that was read |
protected void |
readTerm(StringBuffer coeff,
StringBuffer var)
read a term into coeff and var |
protected int |
translateVarToId(String var)
|
Methods inherited from class org.sat4j.pb.reader.OPBReader2005 |
---|
beginConstraint, beginObjective, constraintRelOp, constraintRightTerm, endConstraint, endObjective, eof, eol, get, getCoeffs, getListOfVariables, getObjectiveFunction, getVars, isGoodFollowingCharacter, metaData, parse, parseInstance, putback, readConstraint, readIdentifier, readInteger, readObjective, readVariablesExplanation, readWord, skipSpaces |
Methods inherited from class org.sat4j.reader.Reader |
---|
isVerbose, parseInstance, parseInstance, setVerbosity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int nbNewSymbols
Constructor Detail |
---|
public OPBReader2007(IPBSolver solver)
solver
- Method Detail |
---|
protected boolean isGoodFirstCharacter(char c)
isGoodFirstCharacter
in class OPBReader2005
protected void checkId(StringBuffer s) throws ParseFormatException
checkId
in class OPBReader2005
ParseFormatException
protected void readTerm(StringBuffer coeff, StringBuffer var) throws IOException, ParseFormatException
OPBReader2006
readTerm
in class OPBReader2006
coeff
- the coefficient of the variablevar
- the indentifier we read
IOException
ParseFormatException
protected void literalInAProduct(String var, IVecInt lits) throws ParseFormatException
var
- the identifier of the variablelits
- a set of literals in DIMACS format in which var once
translated will be added.
ParseFormatException
protected void negateLiteralInAProduct(String var, IVecInt lits)
var
- the identifier of the variablelits
- a set of literals in DIMACS format in which var once
translated will be added.protected void readMetaData() throws IOException, ParseFormatException
readMetaData
in class OPBReader2005
IOException
ParseException
ParseFormatException
protected int translateVarToId(String var) throws ParseFormatException
translateVarToId
in class OPBReader2005
ParseFormatException
public String decode(int[] model)
Reader
decode
in class OPBReader2005
model
- a model using the Dimacs format.
public void decode(int[] model, PrintWriter out)
Reader
decode
in class OPBReader2005
model
- a model using the Dimacs format.out
- the place where to display the model
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |