Cream version 1.06 Core API Specification

jp.ac.kobe_u.cs.cream
Class IntArith

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

public class IntArith
extends Constraint

IntArith constraint implements arithmetic binary operations on integers.

Since:
1.0
See Also:
IntFunc, IntComparison

Field Summary
static int ADD
          Addition operation
static int MAX
          Max operation
static int MIN
          Min operation
static int MULTIPLY
          Multiplication operation
static int SUBTRACT
          Subtraction operation
 
Constructor Summary
IntArith(Network net, int op, int x0, Variable v1, Variable v2)
           
IntArith(Network net, int op, Variable v0, int x1, Variable v2)
           
IntArith(Network net, int op, Variable v0, Variable v1, int x2)
           
IntArith(Network net, int op, Variable v0, Variable v1, Variable v2)
          Adds the constraint of v0 == v1 op v2 to the constraint network net.
 
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
 

Field Detail

ADD

public static final int ADD
Addition operation

See Also:
Constant Field Values

SUBTRACT

public static final int SUBTRACT
Subtraction operation

See Also:
Constant Field Values

MULTIPLY

public static final int MULTIPLY
Multiplication operation

See Also:
Constant Field Values

MAX

public static final int MAX
Max operation

See Also:
Constant Field Values

MIN

public static final int MIN
Min operation

See Also:
Constant Field Values
Constructor Detail

IntArith

public IntArith(Network net,
                int op,
                Variable v0,
                Variable v1,
                Variable v2)
Adds the constraint of v0 == v1 op v2 to the constraint network net.

Parameters:
net - the constraint network
op - the operation
v0 - the result
v1 - the first operand
v2 - the second operand

IntArith

public IntArith(Network net,
                int op,
                Variable v0,
                Variable v1,
                int x2)

IntArith

public IntArith(Network net,
                int op,
                Variable v0,
                int x1,
                Variable v2)

IntArith

public IntArith(Network net,
                int op,
                int x0,
                Variable v1,
                Variable v2)
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