Cream version 1.06 Core API Specification

jp.ac.kobe_u.cs.cream
Class Relation

java.lang.Object
  extended by jp.ac.kobe_u.cs.cream.Constraint
      extended by jp.ac.kobe_u.cs.cream.Relation

public class Relation
extends Constraint

Relation constraints. Possible combinations of two integer variables can be defined by a two-dimentional array of boolean values.

Since:
1.4

Constructor Summary
Relation(Network net, Variable v0, boolean[][] rel, Variable v1)
          Adds a constraint meaning rel[v0][v1] to the network.
 
Method Summary
 Constraint copy(Network net)
          Creates a copy of this constraint for a new network net.
 boolean isModified()
          Returns true when some argument variable is modified.
 boolean satisfy(Trail trail)
          Performs consistency algorithm.
 String toString()
          Returns the string representation of the constraint.
 
Methods inherited from class jp.ac.kobe_u.cs.cream.Constraint
getIndex, getNetwork, setIndex
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Relation

public Relation(Network net,
                Variable v0,
                boolean[][] rel,
                Variable v1)
Adds a constraint meaning rel[v0][v1] to the network.

Parameters:
net - the network
v0 - the first argument integer variable
v1 - the second argument integer variable
rel - two-dimentional array of boolean values
Method Detail

copy

public Constraint copy(Network net)
Description copied from class: Constraint
Creates a copy of this constraint for a new network net.

Specified by:
copy in class Constraint
Returns:
the copy of this constraint

isModified

public boolean isModified()
Description copied from class: Constraint
Returns true when some argument variable is modified.

Specified by:
isModified in class Constraint
Returns:
true when some argument variable is modified

satisfy

public boolean satisfy(Trail trail)
Description copied from class: Constraint
Performs consistency algorithm. Assignments are saved to the trail stack.

Specified by:
satisfy in class Constraint
Parameters:
trail - the trail stack
Returns:
true when the consistency algorithm succeeds

toString

public String toString()
Description copied from class: Constraint
Returns the string representation of the constraint.

Specified by:
toString in class Constraint
Returns:
the string representation

Cream version 1.06 Core API Specification

Cream: Constraint Programming Class Library for Java