|
Cream version 1.4 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.cream.Network
public class Network
Constraint networks. A constraint network consists of variables, constraints, and an objective variable (optional). Variables and constraints are added by add methods:
Network net = new Network(); Domain d = new IntDomain(0, IntDomain.MAX_VALUE); Variable x = new Variable(net, d); Variable y = new Variable(net, d); new NotEquals(net, x, y);
Please note that any variable or any constraint can not be added to two different networks. In other words, a network can not share a variable or a constraint with another network.
Variable
,
Constraint
Constructor Summary | |
---|---|
Network()
Constructs an empty constraint network. |
Method Summary | |
---|---|
Object |
clone()
Returns a copy of this network. |
Constraint |
getConstraint(int i)
Returns the i-th constraint of this network. |
List<Constraint> |
getConstraints()
Returns the list of constraints of this network. |
Variable |
getObjective()
Returns the objective variable of this network. |
Variable |
getVariable(int i)
Returns the i-th variable of this network. |
List<Variable> |
getVariables()
Returns the list of variables of this network. |
void |
setObjective(Variable v)
Sets the objective variable of this network. |
String |
toString()
Returns a readable string representation of this network. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Network()
Method Detail |
---|
public void setObjective(Variable v)
v
- the objective variablepublic Variable getObjective()
public List<Variable> getVariables()
public List<Constraint> getConstraints()
public Variable getVariable(int i)
i
- the index value of the variable to be returned
IndexOutOfBoundsException
- if i is out-of-rangepublic Constraint getConstraint(int i)
i
- the index value of the constraint to be returned
IndexOutOfBoundsException
- if i is out-of-rangepublic Object clone()
clone
in class Object
public String toString()
toString
in class Object
|
Cream version 1.4 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |