javax.constraints
Interface VarReal

All Superinterfaces:
ConstrainedVariable

public interface VarReal
extends ConstrainedVariable

This interface represents constrained real variables.


Method Summary
 VarReal abs()
          Adds and returns a new VarReal that is constrained to be the absolute value of this variable.
 VarReal divide(double value)
          Adds and returns a new VarReal that is constrained to be the division of this variable by the given value, i.e.
 VarReal divide(int value)
          Adds and returns a new VarReal that is constrained to be the division of this variable by the given value, i.e.
 VarReal divide(Var var)
          Adds and returns a new VarReal that is constrained to be the division of this variable by the given variable, i.e.
 VarReal divide(VarReal var)
          Adds and returns a new VarReal that is constrained to be the division of this variable by the given variable, i.e.
 java.lang.String getInitialDomain()
          Returns a string representation of the initial domain of this variable.
 double getMax()
          Returns the current maximum value in the domain of this variable.
 double getMin()
          Returns the current minimum value in the domain of this variable.
 double getValue()
          Returns the value to which this variable has been instantiated, throws a RuntimeException if the variable is not instantiated.
 boolean isBound()
          Returns true if the domain of the variable contains only one value.
 VarReal minus(double value)
          Adds and returns a new VarReal that is constrained to be the difference of this variable and the given value, i.e.
 VarReal minus(int value)
          Adds and returns a new VarReal that is constrained to be the difference of this variable and the given value, i.e.
 VarReal minus(Var var)
          Adds and returns a new VarReal that is constrained to be the difference of this variable and the given variable, i.e.
 VarReal minus(VarReal var)
          Adds and returns a new VarReal that is constrained to be the difference of this variable and the given variable, i.e.
 VarReal multiply(double value)
          Adds and returns a new VarReal that is constrained to be the product of this variable and the given value, i.e.
 VarReal multiply(int value)
          Adds and returns a new VarReal that is constrained to be the product of this variable and the given value, i.e.
 VarReal multiply(Var var)
          Adds and returns a new VarReal that is constrained to be the product of this variable and the given variable, i.e.
 VarReal multiply(VarReal var)
          Adds and returns a new VarReal that is constrained to be the product of this variable and the given variable, i.e.
 VarReal negative()
          Adds and returns a new VarReal that is constrained to be the negation of this variable, i.e.
 VarReal plus(double value)
          Adds and returns a new VarReal that is constrained to be the sum of this variable and the given value, i.e.
 VarReal plus(int value)
          Adds and returns a new VarReal that is constrained to be the sum of this variable and the given value, i.e.
 VarReal plus(Var var)
          Adds and returns a new VarReal that is constrained to be the sum of this variable and the given variable, i.e.
 VarReal plus(VarReal var)
          Adds and returns a new VarReal that is constrained to be the sum of this variable and the given variable, i.e.
 VarReal pow(int value)
          Adds and returns a new VarReal that is constrained to be this variable raised to the power of the given value, i.e.
 VarReal power(double value)
          Adds and returns a new VarReal that is constrained to be this variable raised to the power of the given value, i.e.
 VarReal power(Var var)
          Adds and returns a new VarReal that is constrained to be this variable raised to the power of the given variable, i.e.
 VarReal power(VarReal var)
          Adds and returns a new VarReal that is constrained to be this variable raised to the power of the given real variable, i.e.
 void removeRange(double min, double max)
          Removes a range of values from the domain of this variable, throws an exception if unsuccessful.
 VarReal sqr()
          Adds and returns a new VarReal that is constrained to be the product of this variable and itself, i.e.
 
Methods inherited from interface javax.constraints.ConstrainedVariable
getImpl, getName, getObject, getProblem, setImpl, setName, setObject
 

Method Detail

abs

VarReal abs()
Adds and returns a new VarReal that is constrained to be the absolute value of this variable.

Returns:
a VarReal that represents the absolute value of this variable.

divide

VarReal divide(double value)
Adds and returns a new VarReal that is constrained to be the division of this variable by the given value, i.e. this / value.

Parameters:
value - the given value.
Returns:
a VarReal that represents: this / value.

divide

VarReal divide(int value)
Adds and returns a new VarReal that is constrained to be the division of this variable by the given value, i.e. this / value.

Parameters:
value - the given value.
Returns:
a VarReal that represents: this / value.

divide

VarReal divide(Var var)
               throws java.lang.Exception
Adds and returns a new VarReal that is constrained to be the division of this variable by the given variable, i.e. this / var.

Parameters:
var - the given variable.
Returns:
a VarReal that represents: this / var.
Throws:
java.lang.Exception - if dividing by zero.

divide

VarReal divide(VarReal var)
               throws java.lang.Exception
Adds and returns a new VarReal that is constrained to be the division of this variable by the given variable, i.e. this / var.

Parameters:
var - the given variable.
Returns:
a VarReal that represents: this / var.
Throws:
java.lang.Exception - if dividing by zero.

getInitialDomain

java.lang.String getInitialDomain()
Returns a string representation of the initial domain of this variable.

Returns:
a string representation of the initial domain of this variable.

getMax

double getMax()
Returns the current maximum value in the domain of this variable.

Returns:
the current maximum value in the domain of this variable.

getMin

double getMin()
Returns the current minimum value in the domain of this variable.

Returns:
the current minimum value in the domain of this variable.

getValue

double getValue()
Returns the value to which this variable has been instantiated, throws a RuntimeException if the variable is not instantiated.

Returns:
the value of this instantiated variable.
Throws:
java.lang.RuntimeException - if this variable is not instantiated.

isBound

boolean isBound()
Returns true if the domain of the variable contains only one value.

Returns:
true if the domain of the variable contains only one value.

minus

VarReal minus(double value)
Adds and returns a new VarReal that is constrained to be the difference of this variable and the given value, i.e. this - value.

Parameters:
value - the given value.
Returns:
a VarReal that represents: this - value.

minus

VarReal minus(int value)
Adds and returns a new VarReal that is constrained to be the difference of this variable and the given value, i.e. this - value.

Parameters:
value - the given value.
Returns:
a VarReal that represents: this - value.

minus

VarReal minus(Var var)
Adds and returns a new VarReal that is constrained to be the difference of this variable and the given variable, i.e. this - var.

Parameters:
var - the given variable.
Returns:
a VarReal that represents: this - var.

minus

VarReal minus(VarReal var)
Adds and returns a new VarReal that is constrained to be the difference of this variable and the given variable, i.e. this - var.

Parameters:
var - the given variable.
Returns:
a VarReal that represents: this - var.

multiply

VarReal multiply(double value)
Adds and returns a new VarReal that is constrained to be the product of this variable and the given value, i.e. this * value.

Parameters:
value - the given value.
Returns:
a VarReal that represents: this * value.

multiply

VarReal multiply(int value)
Adds and returns a new VarReal that is constrained to be the product of this variable and the given value, i.e. this * value.

Parameters:
value - the given value.
Returns:
a VarReal that represents: this * value.

multiply

VarReal multiply(Var var)
Adds and returns a new VarReal that is constrained to be the product of this variable and the given variable, i.e. this * var.

Parameters:
var - the given variable.
Returns:
a VarReal that represents: this * var.

multiply

VarReal multiply(VarReal var)
Adds and returns a new VarReal that is constrained to be the product of this variable and the given variable, i.e. this * var.

Parameters:
var - the given variable.
Returns:
a VarReal that represents: this * var.

negative

VarReal negative()
Adds and returns a new VarReal that is constrained to be the negation of this variable, i.e. 0 - this.

Returns:
a VarReal that represents: 0 - this.

plus

VarReal plus(double value)
Adds and returns a new VarReal that is constrained to be the sum of this variable and the given value, i.e. this + value.

Parameters:
value - the given value.
Returns:
a VarReal that represents: this + value.

plus

VarReal plus(int value)
Adds and returns a new VarReal that is constrained to be the sum of this variable and the given value, i.e. this + value.

Parameters:
value - the given value.
Returns:
a VarReal that represents: this + value.

plus

VarReal plus(Var var)
Adds and returns a new VarReal that is constrained to be the sum of this variable and the given variable, i.e. this + var.

Parameters:
var - the given variable.
Returns:
a VarReal that represents: this + var.

plus

VarReal plus(VarReal var)
Adds and returns a new VarReal that is constrained to be the sum of this variable and the given variable, i.e. this + var.

Parameters:
var - the given variable.
Returns:
a VarReal that represents: this + var.

pow

VarReal pow(int value)
Adds and returns a new VarReal that is constrained to be this variable raised to the power of the given value, i.e. this^value.

Parameters:
value - the given value.
Returns:
a VarReal that represents: this^value.

power

VarReal power(double value)
Adds and returns a new VarReal that is constrained to be this variable raised to the power of the given value, i.e. this^value.

Parameters:
value - the given value.
Returns:
a VarReal that represents: this^value.

power

VarReal power(Var var)
Adds and returns a new VarReal that is constrained to be this variable raised to the power of the given variable, i.e. this^var.

Parameters:
var - the given variable.
Returns:
a VarReal that represents: this^var.

power

VarReal power(VarReal var)
Adds and returns a new VarReal that is constrained to be this variable raised to the power of the given real variable, i.e. this^var.

Parameters:
var - the given real variable.
Returns:
a VarReal that represents: this^var.

removeRange

void removeRange(double min,
                 double max)
                 throws java.lang.Exception
Removes a range of values from the domain of this variable, throws an exception if unsuccessful.

Parameters:
min - the minimum value of the range to be removed from the domain of this variable.
max - the maximum value of the range to be removed from the domain of this variable.
Throws:
java.lang.Exception - if the value is not present in the domain of this variable.

sqr

VarReal sqr()
Adds and returns a new VarReal that is constrained to be the product of this variable and itself, i.e. this * this.

Returns:
a VarReal that represents: this * this.