Cream version 1.06 Core API Specification

jp.ac.kobe_u.cs.cream
Class Serialized

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

public class Serialized
extends Constraint

Serialized constraints constructed from an array of n integer variables (v[0], ..., v[n-1]) and an array of n positive integer constants (a[0], ..., a[n-1]). This constraint means v[i]+a[i] <= v[j] or v[j]+a[j] <= v[i] for each pair of i and j.

Since:
1.0
See Also:
Sequential, LocalSearch

Nested Class Summary
 class Serialized.SerializedCondition
          This class represents a condition on which the order of variables are chosen for this serialized constraint in the solution.
 class Serialized.Swap
          This class represents an operation of swapping an order of two variables.
 
Constructor Summary
Serialized(Network net, Variable[] v, int[] a)
          Adds a serialized constraint 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

Serialized

public Serialized(Network net,
                  Variable[] v,
                  int[] a)
Adds a serialized constraint to the network. The length of two arrays should be the same. All elements of a should be positive.

Parameters:
net - the network
v - the array of integer variables
a - the array of positive integer constants
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