public class CSP
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CSP.Objective
Objective types.
|
Constructor and Description |
---|
CSP()
Constructs a new CSP.
|
Modifier and Type | Method and Description |
---|---|
void |
add(BooleanVariable v) |
void |
add(Clause clause)
Adds a clause.
|
void |
add(IntegerVariable v) |
void |
addRelation(Relation relation)
Adds a relation.
|
void |
cancel() |
void |
commit() |
void |
compact() |
BooleanVariable |
getBooleanVariable(java.lang.String name)
Returns the boolean variable of the given name.
|
java.util.List<BooleanVariable> |
getBooleanVariables()
Returns the boolean variables.
|
java.util.List<BooleanVariable> |
getBooleanVariablesDelta() |
java.util.List<Clause> |
getClauses()
Returns the clauses.
|
java.util.List<Clause> |
getClausesDelta() |
int |
getGroups() |
IntegerVariable |
getIntegerVariable(java.lang.String name)
Returns the integer variable of the given name.
|
java.util.List<IntegerVariable> |
getIntegerVariables()
Returns the integer variables.
|
java.util.List<IntegerVariable> |
getIntegerVariablesDelta() |
CSP.Objective |
getObjective()
Returns the objective.
|
java.util.List<IntegerVariable> |
getObjectiveVariables()
Returns the list of objective variables or null.
|
Relation |
getRelation(java.lang.String name) |
java.util.List<Relation> |
getRelations()
Returns the relations.
|
int |
getTopWeight() |
boolean |
isMaximize() |
boolean |
isMinimize() |
boolean |
isSatisfied()
Returns true when the CSP is satisfied.
|
boolean |
isUnsatisfiable() |
void |
output(java.io.PrintStream out,
java.lang.String pre) |
void |
outputValues(java.io.PrintStream out) |
int |
propagate() |
void |
setClauses(java.util.List<Clause> newClauses) |
void |
setGroups(int groups) |
void |
setObjective(CSP.Objective objective) |
void |
setObjectiveVariables(java.util.List<IntegerVariable> objectiveVariables) |
void |
setTopWeight(int topWeight) |
java.lang.String |
summary() |
java.lang.String |
toString()
Returns the string representation of the CSP.
|
public void commit()
public void cancel()
public java.util.List<IntegerVariable> getObjectiveVariables()
public void setObjectiveVariables(java.util.List<IntegerVariable> objectiveVariables)
public CSP.Objective getObjective()
public void setObjective(CSP.Objective objective)
public boolean isMaximize()
public boolean isMinimize()
public int getGroups()
public void setGroups(int groups)
public int getTopWeight()
public void setTopWeight(int topWeight)
public java.util.List<IntegerVariable> getIntegerVariables()
public java.util.List<IntegerVariable> getIntegerVariablesDelta()
public IntegerVariable getIntegerVariable(java.lang.String name)
name
- the name of the integer variablepublic void add(IntegerVariable v) throws SugarException
SugarException
public java.util.List<BooleanVariable> getBooleanVariables()
public java.util.List<BooleanVariable> getBooleanVariablesDelta()
public void add(BooleanVariable v) throws SugarException
SugarException
public BooleanVariable getBooleanVariable(java.lang.String name)
name
- the name of the boolean variablepublic java.util.List<Relation> getRelations()
public Relation getRelation(java.lang.String name)
public java.util.List<Clause> getClauses()
public java.util.List<Clause> getClausesDelta()
public void setClauses(java.util.List<Clause> newClauses)
public void addRelation(Relation relation)
relation
- the relation to be addedpublic void add(Clause clause)
clause
- the clause to be addedpublic boolean isUnsatisfiable() throws SugarException
SugarException
public int propagate() throws SugarException
SugarException
public void compact() throws SugarException
SugarException
public boolean isSatisfied()
public void outputValues(java.io.PrintStream out)
public void output(java.io.PrintStream out, java.lang.String pre)
public java.lang.String summary()
public java.lang.String toString()
toString
in class java.lang.Object