jopt.csp.spi.arcalgorithm.domain
Class BaseIntDomain

java.lang.Object
  extended byjopt.csp.spi.arcalgorithm.domain.AbstractDomain
      extended byjopt.csp.spi.arcalgorithm.domain.BaseNumDomain
          extended byjopt.csp.spi.arcalgorithm.domain.BaseIntDomain
All Implemented Interfaces:
ChoicePointDataSource, ChoicePointEntryListener, Domain, DomainChangeSource, IntDomain, NumDomain
Direct Known Subclasses:
IntIntervalDomain, IntSparseDomain

public abstract class BaseIntDomain
extends BaseNumDomain
implements IntDomain

Base class for integer domains


Method Summary
 void dump()
           
 int getMax()
          Returns maximum value of domain
 int getMin()
          Returns minimum value of domain
 int getNextHigher(int val)
          Returns the next higher value in the domain or current value if none exists
 int getNextLower(int val)
          Returns the next lower value in the domain or current value if none exists
 boolean isBound()
          Returns true if domain is bound to a value
 boolean isInDomain(int 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(int start, int end)
          Attempts to reduce domain by removing a range of values
 void removeValue(int 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(int val)
          Attempts to reduce domain by setting a maximum value.
 void setMin(int val)
          Attempts to reduce domain by setting a minimum value.
 void setRange(int start, int end)
          Attempts to reduce domain to within a range of values
 void setValue(int 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 int getMax()
Returns maximum value of domain

Specified by:
getMax in interface IntDomain

getMin

public int getMin()
Returns minimum value of domain

Specified by:
getMin in interface IntDomain

isBound

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

Specified by:
isBound in interface Domain

isInDomain

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

Specified by:
isInDomain in interface IntDomain

setMax

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

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

setMin

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

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

setValue

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

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

removeValue

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

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

setRange

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

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

removeRange

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

Specified by:
removeRange in interface IntDomain
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 int getNextHigher(int val)
Returns the next higher value in the domain or current value if none exists

Specified by:
getNextHigher in interface IntDomain

getNextLower

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

Specified by:
getNextLower in interface IntDomain

dump

public void dump()