jopt.csp.variable
Interface CspFloatVariable

All Superinterfaces:
CspDoubleCast, CspFloatCast, CspFloatExpr, CspNumExpr, CspNumVariable, CspVariable

public interface CspFloatVariable
extends CspFloatExpr, CspNumVariable

Interface implemented by float precision floating point variables. The domain associated with this type of variable that be modified unlike CspFloatExpr objects.


Method Summary
 float getMax()
          Returns the maximum value of this variable's domain
 float getMin()
          Returns the minimum value of this variable's domain
 float getNextHigher(float val)
          Returns the next higher value in this variable's domain or current value if none exists
 float getNextLower(float val)
          Returns the next lower value in this variable's domain or current value if none exists
 boolean isInDomain(float val)
          Returns true if the specified value is in this variable's domain
 void removeAll(FloatSet set)
          Attempts to reduce this variable's domain by removing a set of values
 void removeRange(float start, float end)
          Attempts to reduce this variable's domain by removing a range of values
 void removeValue(float val)
          Attempts to remove a single value from this variable's domain
 void setMax(float val)
          Attempts to reduce this variable's domain to be less than the specified maximum value.
 void setMin(float val)
          Attempts to reduce this variable's domain to be greater than the specified minimum value.
 void setRange(float start, float end)
          Attempts to reduce this variable's domain to within a range of values
 void setValue(float val)
          Attempts to reduce this variable's domain to a single value.
 
Methods inherited from interface jopt.csp.variable.CspFloatExpr
add, add, add, add, between, between, divide, divide, divide, divide, eq, eq, geq, geq, getPrecision, leq, leq, multiply, multiply, multiply, multiply, notBetween, notBetween, setPrecision, subtract, subtract, 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 float getMax()
Returns the maximum value of this variable's domain

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

getMin

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

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

isInDomain

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

Parameters:
val - value to check if it is in domain
Returns:
returns true if specified value is in this variable's domain

setMax

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

Parameters:
val - value to become the domains new maximum
Throws:
PropagationFailureException - If this would cause the domain to become empty

setMin

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

Parameters:
val - value to become the domains new minimum
Throws:
PropagationFailureException - If this would cause the domain to become empty

setValue

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

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

removeValue

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

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

removeAll

public void removeAll(FloatSet 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

setRange

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

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

removeRange

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

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

getNextHigher

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

Parameters:
val - current value
Returns:
the value of the next higher entry in this variable's domain

getNextLower

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

Parameters:
val - current value
Returns:
the value of the next lower entry in this variable's domain