|
Sugar version 1.13 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjp.ac.kobe_u.cs.sugar.csp.CSP
public class CSP
A class for CSP (Constraint Satisfaction Problems). A CSP consists of IntegerVariables, BooleanVariables, Clauses, and an optional objective IntegerVariable with specific objective (MINIMIZE or MAXIMIZE).
Nested Class Summary | |
---|---|
static class |
CSP.Objective
Objective types. |
Field Summary | |
---|---|
static boolean |
simplifyAll
|
Constructor Summary | |
---|---|
CSP()
Constructs a new CSP. |
Method Summary | |
---|---|
void |
add(BooleanVariable v)
|
void |
add(Clause clause)
Adds a clause. |
void |
add(IntegerVariable v)
|
BooleanVariable |
getBooleanVariable(String name)
Returns the boolean variable of the given name. |
List<BooleanVariable> |
getBooleanVariables()
Returns the boolean variables. |
List<Clause> |
getClauses()
Returns the clauses. |
IntegerVariable |
getIntegerVariable(String name)
Returns the integer variable of the given name. |
List<IntegerVariable> |
getIntegerVariables()
Returns the integer variables. |
CSP.Objective |
getObjective()
Returns the objective. |
IntegerVariable |
getObjectiveVariable()
Returns the objective variable or null. |
boolean |
isSatisfied()
Returns true when the CSP is satisfied. |
boolean |
isUnsatisfiable()
|
void |
output(PrintStream out)
|
void |
outputValues(PrintStream out)
|
int |
propagate()
|
void |
setObjective(CSP.Objective objective)
|
void |
setObjectiveVariable(IntegerVariable objectiveVariable)
|
void |
simplify()
|
String |
summary()
|
String |
toString()
Returns the string representation of the CSP. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static boolean simplifyAll
Constructor Detail |
---|
public CSP()
Method Detail |
---|
public IntegerVariable getObjectiveVariable()
public void setObjectiveVariable(IntegerVariable objectiveVariable)
public CSP.Objective getObjective()
public void setObjective(CSP.Objective objective)
public List<IntegerVariable> getIntegerVariables()
public IntegerVariable getIntegerVariable(String name)
name
- the name of the integer variable
public void add(IntegerVariable v) throws SugarException
SugarException
public List<BooleanVariable> getBooleanVariables()
public void add(BooleanVariable v) throws SugarException
SugarException
public BooleanVariable getBooleanVariable(String name)
name
- the name of the boolean variable
public List<Clause> getClauses()
public void add(Clause clause)
clause
- the clause to be addedpublic boolean isUnsatisfiable() throws SugarException
SugarException
public int propagate() throws SugarException
SugarException
public void simplify() throws SugarException
SugarException
public boolean isSatisfied()
public void outputValues(PrintStream out)
public void output(PrintStream out)
public String summary()
public String toString()
toString
in class Object
|
Sugar version 1.13 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |