jopt.csp.variable
Interface CspDoubleVariable

All Superinterfaces:
CspDoubleCast, CspDoubleExpr, CspNumExpr, CspNumVariable, CspVariable

public interface CspDoubleVariable
extends CspDoubleExpr, CspNumVariable

Interface implemented by double precision floating point variables. The domain associated with this type of variable can be modified unlike CspDoubleExpr objects.


Method Summary
 double getMax()
          Returns the maximum value of this variable's domain
 double getMin()
          Returns the minimum value of this variable's domain
 double getNextHigher(double val)
          Returns the next higher value in this variable's domain or current value if none exists
 double getNextLower(double val)
          Returns the next lower value in this variable's domain or current value if none exists
 boolean isInDomain(double val)
          Returns true if the specified value is in this variable's domain
 void removeAll(DoubleSet set)
          Attempts to reduce this variable's domain by removing a set of values
 void removeRange(double start, double end)
          Attempts to reduce this variable's domain by removing a range of values
 void removeValue(double val)
          Attempts to remove a single value from this variable's domain
 void setMax(double val)
          Attempts to reduce this variable's domain to be less than the specified maximum value.
 void setMin(double val)
          Attempts to reduce this variable's domain to be greater than the specified minimum value.
 void setRange(double start, double end)
          Attempts to reduce this variable's domain to within a range of values
 void setValue(double val)
          Attempts to reduce this variable's domain to a single value.
 
Methods inherited from interface jopt.csp.variable.CspDoubleExpr
add, add, between, between, divide, divide, eq, eq, geq, geq, getPrecision, leq, leq, multiply, multiply, notBetween, notBetween, setPrecision, subtract, subtract
 
Methods inherited from interface jopt.csp.variable.CspNumExpr
between, between, between, between, eq, geq, getName, gt, isBound, leq, lt, neq, notBetween, notBetween, notBetween, notBetween, setName
 
Methods inherited from interface jopt.csp.variable.CspVariable
getName, getSize, isBound
 

Method Detail

getMax

public double getMax()
Returns the maximum value of this variable's domain

Specified by:
getMax in interface CspDoubleExpr
Returns:
the maximum value of this variable's domain

getMin

public double getMin()
Returns the minimum value of this variable's domain

Specified by:
getMin in interface CspDoubleExpr
Returns:
the minimum value of this variable's domain

isInDomain

public boolean isInDomain(double val)
Returns true if the specified value is in this variable's domain

Parameters:
val - value that is to be checked for its presence in the domain
Returns:
boolean representing the presence of the val in the domain

setMax

public void setMax(double val)
            throws PropagationFailureException
Attempts to reduce this variable's domain to be less than the specified maximum value.

Parameters:
val - value to be set as the maximum of the domain
Throws:
PropagationFailureException - If this would cause the domain to become empty

setMin

public void setMin(double val)
            throws PropagationFailureException
Attempts to reduce this variable's domain to be greater than the specified minimum value.

Parameters:
val - value to be set as the minimum of the domain
Throws:
PropagationFailureException - If this would cause the domain to become empty

setValue

public void setValue(double val)
              throws PropagationFailureException
Attempts to reduce this variable's domain to a single value.

Parameters:
val - value to restrict this variable's domain to
Throws:
PropagationFailureException - If this would cause the domain to become empty

removeValue

public void removeValue(double val)
                 throws PropagationFailureException
Attempts to remove a single value from this variable's domain

Throws:
PropagationFailureException - If this would cause the domain to become empty

setRange

public void setRange(double start,
                     double end)
              throws PropagationFailureException
Attempts to reduce this variable's domain to within a range of values

Parameters:
start - value to be set as the minimum of this variable's domain
end - value to be set as the maximum of this variable's domain
Throws:
PropagationFailureException - If this would cause the domain to become empty

removeRange

public void removeRange(double start,
                        double end)
                 throws PropagationFailureException
Attempts to reduce this variable's domain by removing a range of values

Parameters:
start - minimum value of range of values to be removed
end - maximum value of range of values to be removed
Throws:
PropagationFailureException - If this would cause the domain to become empty

removeAll

public void removeAll(DoubleSet set)
               throws PropagationFailureException
Attempts to reduce this variable's domain by removing a set of values

Parameters:
set - set of values to remove from the domain
Throws:
PropagationFailureException - If this would cause the domain to become empty

getNextHigher

public double getNextHigher(double val)
Returns the next higher value in this variable's domain or current value if none exists

Parameters:
val - value of the current value
Returns:
double representing the next higher value

getNextLower

public double getNextLower(double val)
Returns the next lower value in this variable's domain or current value if none exists

Parameters:
val - value of the current value
Returns:
double representing the next lower value