Cream version 1.06 Core API Specification

jp.ac.kobe_u.cs.cream
Class Constraint

java.lang.Object
  extended by jp.ac.kobe_u.cs.cream.Constraint
Direct Known Subclasses:
Element, Equals, IntArith, IntComparison, IntFunc, NotEquals, Relation, Sequential, Serialized

public abstract class Constraint
extends Object

An abstract class for constraints. A constraint is a component of a constraint network. See Network for example programs to construct constraints and add them to a constraint network.

Since:
1.0
See Also:
Network

Method Summary
abstract  Constraint copy(Network net)
          Creates a copy of this constraint for a new network net.
 int getIndex()
          Returns the index of the constraint in the network.
 Network getNetwork()
          Returns the constraint network.
abstract  boolean isModified()
          Returns true when some argument variable is modified.
abstract  boolean satisfy(Trail trail)
          Performs consistency algorithm.
 void setIndex(int index)
          Sets the index of the constraint in the network.
abstract  String toString()
          Returns the string representation of the constraint.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getNetwork

public Network getNetwork()
Returns the constraint network.

Returns:
the constraint network

setIndex

public void setIndex(int index)
Sets the index of the constraint in the network. This is an internal method.

Parameters:
index - the index

getIndex

public int getIndex()
Returns the index of the constraint in the network. This is an internal method.

Returns:
the index

copy

public abstract Constraint copy(Network net)
Creates a copy of this constraint for a new network net.

Returns:
the copy of this constraint

isModified

public abstract boolean isModified()
Returns true when some argument variable is modified.

Returns:
true when some argument variable is modified

satisfy

public abstract boolean satisfy(Trail trail)
Performs consistency algorithm. Assignments are saved to the trail stack.

Parameters:
trail - the trail stack
Returns:
true when the consistency algorithm succeeds

toString

public abstract String toString()
Returns the string representation of the constraint.

Overrides:
toString in class Object
Returns:
the string representation

Cream version 1.06 Core API Specification

Cream: Constraint Programming Class Library for Java