|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectagg.util.csp.CSP
public abstract class CSP
An abstract class for Constraint Satisfaction Problems with only binary constraints.
Field Summary | |
---|---|
protected java.lang.Object |
itsDomain
|
protected SolutionStrategy |
itsSolver
|
protected boolean |
itsTouchedFlag
|
Constructor Summary | |
---|---|
CSP(SolutionStrategy solver)
Construct myself with an initial SolutionStrategy. |
Method Summary | |
---|---|
java.lang.Object |
getDomain()
Return the current global domain of values. |
abstract int |
getSize()
Return the number of variables in the CSP. |
abstract Variable |
getVariable(GraphObject obj)
|
abstract java.util.Enumeration<Variable> |
getVariables()
Return an Enumeration of all my variables. |
boolean |
hasFoundSolution()
|
boolean |
hasMoreSolutions()
|
boolean |
hasQueries()
|
boolean |
nextSolution()
Compute my next solution, and instantiate my variables appropriately. |
protected abstract void |
preprocessDomain(java.lang.Object domain)
Preprocess the given domain for optimization purposes (to get more accurate data for Constraint weights, or to initialize Query databases). |
void |
reinitialize(boolean doUpdateQueries)
|
void |
reset()
|
void |
setDomain(java.lang.Object domain)
Set the global domain of values for the variables, and call preprocessDomain() with the given domain . |
void |
setSolutionStrategy(SolutionStrategy solver)
Set the algorithm which is used to compute my solutions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object itsDomain
protected SolutionStrategy itsSolver
protected boolean itsTouchedFlag
Constructor Detail |
---|
public CSP(SolutionStrategy solver)
Post: getDomain() == null
.
Method Detail |
---|
public abstract java.util.Enumeration<Variable> getVariables()
Variable
.
public abstract Variable getVariable(GraphObject obj)
public abstract int getSize()
public final void setDomain(java.lang.Object domain)
preprocessDomain()
with the given domain
.
Post: getDomain() == domain
.
preprocessDomain(java.lang.Object)
protected abstract void preprocessDomain(java.lang.Object domain)
setDomain()
.
setDomain(java.lang.Object)
public final java.lang.Object getDomain()
public final boolean nextSolution()
Pre: getDomain() != null
.
false
if there are no more solutions.public final void setSolutionStrategy(SolutionStrategy solver)
public boolean hasMoreSolutions()
public boolean hasFoundSolution()
public boolean hasQueries()
public final void reset()
public final void reinitialize(boolean doUpdateQueries)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |