Cream version 1.06 Core API Specification

jp.ac.kobe_u.cs.cream
Class IntVariable

java.lang.Object
  extended by jp.ac.kobe_u.cs.cream.Variable
      extended by jp.ac.kobe_u.cs.cream.IntVariable
All Implemented Interfaces:
Cloneable

public class IntVariable
extends Variable

Integer variables.

Since:
1.0
See Also:
IntDomain

Constructor Summary
IntVariable(Network net)
          Constructs an integer variable with full domain and a default name.
IntVariable(Network net, int value)
          Constructs an integer variable of a singleton domain and a default name.
IntVariable(Network net, IntDomain d)
          Constructs an integer variable of the network with an initial integer domain d and a default name.
IntVariable(Network net, IntDomain d, String name)
          Constructs an integer variable of the network with an initial integer domain d and a name specified by the parameter name.
IntVariable(Network net, int lo, int hi)
          Constructs an integer variable of the interval lo..hi and a default name.
IntVariable(Network net, int lo, int hi, String name)
          Constructs an integer variable of the interval lo..hi and the given name.
IntVariable(Network net, int value, String name)
          Constructs an integer variable of a singleton domain and the given name.
IntVariable(Network net, String name)
          Constructs an integer variable with full domain and the given name.
 
Method Summary
 IntVariable abs()
          Returns a new integer variable which is equal to abs(this).
 IntVariable add(int value)
          Returns a new integer variable which is equal to this + value.
 IntVariable add(IntVariable v)
          Returns a new integer variable which is equal to this + v.
 void equals(int value)
          Adds a new constraint this == value.
 void equals(IntVariable v)
          Adds a new constraint this == v.
 void ge(int value)
          Adds a new constraint this >= value.
 void ge(IntVariable v)
          Adds a new constraint this >= v.
 void gt(int value)
          Adds a new constraint this > value.
 void gt(IntVariable v)
          Adds a new constraint this > v.
 void le(int value)
          Adds a new constraint this <= value.
 void le(IntVariable v)
          Adds a new constraint this <= v.
 void lt(int value)
          Adds a new constraint this < value.
 void lt(IntVariable v)
          Adds a new constraint this < v.
 IntVariable max(int value)
          Returns a new integer variable which is equal to max(this, value).
 IntVariable max(IntVariable v)
          Returns a new integer variable which is equal to max(this, v).
 IntVariable min(int value)
          Returns a new integer variable which is equal to min(this, value).
 IntVariable min(IntVariable v)
          Returns a new integer variable which is equal to min(this, v).
 IntVariable multiply(int value)
          Returns a new integer variable which is equal to this * value.
 IntVariable multiply(IntVariable v)
          Returns a new integer variable which is equal to this * v.
 IntVariable negate()
          Returns a new integer variable which is equal to -this.
 void notEquals(int value)
          Adds a new constraint this != value.
 void notEquals(IntVariable v)
          Adds a new constraint this != v.
 IntVariable sign()
          Returns a new integer variable which is equal to sign(this).
 IntVariable subtract(int value)
          Returns a new integer variable which is equal to this - value.
 IntVariable subtract(IntVariable v)
          Returns a new integer variable which is equal to this - v.
 
Methods inherited from class jp.ac.kobe_u.cs.cream.Variable
getDomain, getIndex, getName, getNetwork, isModified, isWatch, setDomain, setIndex, setModified, setName, setWatch, toString, updateDomain
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntVariable

public IntVariable(Network net)
Constructs an integer variable with full domain and a default name.

Parameters:
net - the network

IntVariable

public IntVariable(Network net,
                   String name)
Constructs an integer variable with full domain and the given name.

Parameters:
net - the network
name - the name of this variable

IntVariable

public IntVariable(Network net,
                   IntDomain d)
Constructs an integer variable of the network with an initial integer domain d and a default name. This constructor is equivalent to IntVariable(network, d, null).

Parameters:
net - the network
d - the initial integer domain

IntVariable

public IntVariable(Network net,
                   IntDomain d,
                   String name)
Constructs an integer variable of the network with an initial integer domain d and a name specified by the parameter name. When the parameter name is null, default names (v1, v2, and so on) are used.

Parameters:
net - the network
d - the initial integer domain
name - the name of the variable, or null for a default name

IntVariable

public IntVariable(Network net,
                   int value)
Constructs an integer variable of a singleton domain and a default name.

Parameters:
net - the network
value - the singleton value

IntVariable

public IntVariable(Network net,
                   int value,
                   String name)
Constructs an integer variable of a singleton domain and the given name.

Parameters:
net - the network
value - the singleton value
name - the name of the variable

IntVariable

public IntVariable(Network net,
                   int lo,
                   int hi)
Constructs an integer variable of the interval lo..hi and a default name.

Parameters:
net - the network
lo - the lower bound
hi - the upper bound

IntVariable

public IntVariable(Network net,
                   int lo,
                   int hi,
                   String name)
Constructs an integer variable of the interval lo..hi and the given name.

Parameters:
net - the network
lo - the lower bound
hi - the upper bound
name - the name of the variable
Method Detail

add

public IntVariable add(IntVariable v)
Returns a new integer variable which is equal to this + v.

Parameters:
v - the variable to be added
Returns:
the new integer variable
See Also:
IntArith

add

public IntVariable add(int value)
Returns a new integer variable which is equal to this + value.

Parameters:
value - the value to be added
Returns:
the new integer variable
See Also:
IntArith

subtract

public IntVariable subtract(IntVariable v)
Returns a new integer variable which is equal to this - v.

Parameters:
v - the variable to be subtracted
Returns:
the new integer variable
See Also:
IntArith

subtract

public IntVariable subtract(int value)
Returns a new integer variable which is equal to this - value.

Parameters:
value - the value to be subtracted
Returns:
the new integer variable
See Also:
IntArith

multiply

public IntVariable multiply(IntVariable v)
Returns a new integer variable which is equal to this * v.

Parameters:
v - the variable to be multiplied
Returns:
the new integer variable
See Also:
IntArith

multiply

public IntVariable multiply(int value)
Returns a new integer variable which is equal to this * value.

Parameters:
value - the value to be multiplied
Returns:
the new integer variable
See Also:
IntArith

max

public IntVariable max(IntVariable v)
Returns a new integer variable which is equal to max(this, v).

Parameters:
v - the variable
Returns:
the new integer variable
See Also:
IntArith

max

public IntVariable max(int value)
Returns a new integer variable which is equal to max(this, value).

Parameters:
value - the value
Returns:
the new integer variable
See Also:
IntArith

min

public IntVariable min(IntVariable v)
Returns a new integer variable which is equal to min(this, v).

Parameters:
v - the variable
Returns:
the new integer variable
See Also:
IntArith

min

public IntVariable min(int value)
Returns a new integer variable which is equal to min(this, value).

Parameters:
value - the value
Returns:
the new integer variable
See Also:
IntArith

negate

public IntVariable negate()
Returns a new integer variable which is equal to -this.

Returns:
the new integer variable
See Also:
IntFunc

abs

public IntVariable abs()
Returns a new integer variable which is equal to abs(this).

Returns:
the new integer variable
See Also:
IntFunc

sign

public IntVariable sign()
Returns a new integer variable which is equal to sign(this). The function sign(x) gives -1, 0, +1 when x<0, x=0, x>0 respectively.

Returns:
the new integer variable
See Also:
IntFunc

equals

public void equals(IntVariable v)
Adds a new constraint this == v.

Parameters:
v - the variable to be compared
See Also:
Equals

equals

public void equals(int value)
Adds a new constraint this == value.

Parameters:
value - the value to be compared
See Also:
Equals

notEquals

public void notEquals(IntVariable v)
Adds a new constraint this != v.

Parameters:
v - the variable to be compared
See Also:
NotEquals

notEquals

public void notEquals(int value)
Adds a new constraint this != value.

Parameters:
value - the value to be compared
See Also:
NotEquals

le

public void le(IntVariable v)
Adds a new constraint this <= v.

Parameters:
v - the variable to be compared
See Also:
IntComparison

le

public void le(int value)
Adds a new constraint this <= value.

Parameters:
value - the value to be compared
See Also:
IntComparison

lt

public void lt(IntVariable v)
Adds a new constraint this < v.

Parameters:
v - the variable to be compared
See Also:
IntComparison

lt

public void lt(int value)
Adds a new constraint this < value.

Parameters:
value - the value to be compared
See Also:
IntComparison

ge

public void ge(IntVariable v)
Adds a new constraint this >= v.

Parameters:
v - the variable to be compared
See Also:
IntComparison

ge

public void ge(int value)
Adds a new constraint this >= value.

Parameters:
value - the value to be compared
See Also:
IntComparison

gt

public void gt(IntVariable v)
Adds a new constraint this > v.

Parameters:
v - the variable to be compared
See Also:
IntComparison

gt

public void gt(int value)
Adds a new constraint this > value.

Parameters:
value - the value to be compared
See Also:
IntComparison

Cream version 1.06 Core API Specification

Cream: Constraint Programming Class Library for Java