jopt.csp.spi.arcalgorithm.domain
Class BaseDoubleDomain

java.lang.Object
  extended byjopt.csp.spi.arcalgorithm.domain.AbstractDomain
      extended byjopt.csp.spi.arcalgorithm.domain.BaseNumDomain
          extended byjopt.csp.spi.arcalgorithm.domain.BaseDoubleDomain
All Implemented Interfaces:
ChoicePointDataSource, ChoicePointEntryListener, Domain, DomainChangeSource, DoubleDomain, NumDomain
Direct Known Subclasses:
DoubleIntervalDomain, DoubleSparseDomain

public abstract class BaseDoubleDomain
extends BaseNumDomain
implements DoubleDomain

Base class for double domains


Method Summary
 void dump()
           
 double getMax()
          Returns maximum value of domain
 double getMin()
          Returns minimum value of domain
 double getNextHigher(double val)
          Returns the next higher value in the domain or current value if none exists
 double getNextLower(double val)
          Returns the next lower value in the domain or current value if none exists
 double getPrecision()
          Returns precision of set
 boolean isBound()
          Returns true if domain is bound to a value
 boolean isInDomain(double val)
          Returns true if value is in domain
 void removeDomain(jopt.csp.util.NumSet s)
          Attempts to reduce a domain by removing a set of values
 void removeRange(double start, double end)
          Attempts to reduce domain by removing a range of values
 void removeValue(double val)
          Attempts to remove a single value from the domain
 void setDomain(jopt.csp.util.NumSet s)
          Attempts to reduce a domain by restricting it to a set of values
 void setMax(double val)
          Attempts to reduce domain to a maximum value.
 void setMin(double val)
          Attempts to reduce domain to a minimum value.
 void setPrecision(double precision)
          Sets precision of set
 void setRange(double start, double end)
          Attempts to reduce domain to within a range of values
 void setValue(double val)
          Attempts to reduce domain to a single value.
 
Methods inherited from class jopt.csp.spi.arcalgorithm.domain.BaseNumDomain
clearDelta, clone, deltaValues, getDeltaSet, getDomainState, getSize, isNestedChild, restoreDomainState, setNestedChild, toSet, toString, values
 
Methods inherited from class jopt.csp.spi.arcalgorithm.domain.AbstractDomain
addDomainChangeListener, addRangeChangeListener, addValueChangeListener, changed, removeDomainChangeListener, removeRangeChangeListener, removeValueChangeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jopt.csp.spi.arcalgorithm.domain.NumDomain
deltaValues, getDeltaSet, getSize, toSet, values
 
Methods inherited from interface jopt.csp.spi.arcalgorithm.domain.Domain
changed, clearDelta, clone, getDomainState, restoreDomainState
 
Methods inherited from interface jopt.csp.spi.solver.ChoicePointEntryListener
afterChoicePointPopEvent, afterChoicePointPushEvent, beforeChoicePointPopEvent, beforeChoicePointPushEvent
 
Methods inherited from interface jopt.csp.spi.solver.ChoicePointDataSource
choicePointStackSet, setChoicePointStack
 

Method Detail

getMax

public double getMax()
Returns maximum value of domain

Specified by:
getMax in interface DoubleDomain

getMin

public double getMin()
Returns minimum value of domain

Specified by:
getMin in interface DoubleDomain

isBound

public boolean isBound()
Returns true if domain is bound to a value

Specified by:
isBound in interface Domain

isInDomain

public boolean isInDomain(double val)
Returns true if value is in domain

Specified by:
isInDomain in interface DoubleDomain

setMax

public void setMax(double val)
            throws jopt.csp.variable.PropagationFailureException
Attempts to reduce domain to a maximum value.

Specified by:
setMax in interface DoubleDomain
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

setMin

public void setMin(double val)
            throws jopt.csp.variable.PropagationFailureException
Attempts to reduce domain to a minimum value.

Specified by:
setMin in interface DoubleDomain
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

setValue

public void setValue(double val)
              throws jopt.csp.variable.PropagationFailureException
Attempts to reduce domain to a single value.

Specified by:
setValue in interface DoubleDomain
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

removeValue

public void removeValue(double val)
                 throws jopt.csp.variable.PropagationFailureException
Attempts to remove a single value from the domain

Specified by:
removeValue in interface DoubleDomain
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

setRange

public void setRange(double start,
                     double end)
              throws jopt.csp.variable.PropagationFailureException
Attempts to reduce domain to within a range of values

Specified by:
setRange in interface DoubleDomain
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

removeRange

public void removeRange(double start,
                        double end)
                 throws jopt.csp.variable.PropagationFailureException
Attempts to reduce domain by removing a range of values

Specified by:
removeRange in interface DoubleDomain
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

setDomain

public void setDomain(jopt.csp.util.NumSet s)
               throws jopt.csp.variable.PropagationFailureException
Attempts to reduce a domain by restricting it to a set of values

Specified by:
setDomain in interface NumDomain
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

removeDomain

public void removeDomain(jopt.csp.util.NumSet s)
                  throws jopt.csp.variable.PropagationFailureException
Attempts to reduce a domain by removing a set of values

Specified by:
removeDomain in interface NumDomain
Throws:
jopt.csp.variable.PropagationFailureException - If domain is empty

getNextHigher

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

Specified by:
getNextHigher in interface DoubleDomain

getNextLower

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

Specified by:
getNextLower in interface DoubleDomain

setPrecision

public final void setPrecision(double precision)
Sets precision of set

Specified by:
setPrecision in interface DoubleDomain

getPrecision

public final double getPrecision()
Returns precision of set

Specified by:
getPrecision in interface DoubleDomain

dump

public void dump()