jopt.csp.spi.arcalgorithm.domain
Class SummationDoubleComputedDomain

java.lang.Object
  extended byjopt.csp.spi.arcalgorithm.domain.AbstractDomain
      extended byjopt.csp.spi.arcalgorithm.domain.SummationDoubleComputedDomain
All Implemented Interfaces:
ChoicePointDataSource, Domain, DomainChangeSource, DoubleDomain, NumDomain

public class SummationDoubleComputedDomain
extends AbstractDomain
implements DoubleDomain


Constructor Summary
SummationDoubleComputedDomain(SummationDoubleDomainExpression aexpr, jopt.csp.variable.CspGenericIndexRestriction idxRestriction)
          Constructor
 
Method Summary
 boolean choicePointStackSet()
          Returns true if a call to setChoicePointStack will fail
 void clearDelta()
          Clears the delta set for this domain
 java.lang.Object clone()
          Returns a copy of this domain
 jopt.csp.util.NumberIterator deltaValues()
          Returns iterator of values in node's delta
 jopt.csp.util.NumSet getDeltaSet()
          Returns the delta set for this domain
 java.lang.Object getDomainState()
          Stores all necessary information for this domain allowing it to be restored to a previous state at a later point in time.
 double getMax()
          Returns the 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 associated with this domain
 int getSize()
          Returns size of domain
 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 vals)
          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 restoreDomainState(java.lang.Object state)
          Restores a domain to a previous state using the information contained in the state parameter.
 void setChoicePointStack(ChoicePointStack cps)
          Sets the choicepoint stack associated with this 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 p)
          Sets precision associated with this domain
 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.
 jopt.csp.util.NumSet toSet()
          Returns set of Numbers and NumIntervals representing domain
 java.lang.String toString()
          Returns string representation of domain
 jopt.csp.util.NumberIterator values()
          Returns iterator of values in node's domain
 
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.Domain
changed
 

Constructor Detail

SummationDoubleComputedDomain

public SummationDoubleComputedDomain(SummationDoubleDomainExpression aexpr,
                                     jopt.csp.variable.CspGenericIndexRestriction idxRestriction)
Constructor

Method Detail

setPrecision

public void setPrecision(double p)
Sets precision associated with this domain

Specified by:
setPrecision in interface DoubleDomain

getPrecision

public double getPrecision()
Returns precision associated with this domain

Specified by:
getPrecision in interface DoubleDomain

getSize

public int getSize()
Returns size of domain

Specified by:
getSize in interface NumDomain

isBound

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

Specified by:
isBound in interface Domain

getMax

public double getMax()
Returns the 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

isInDomain

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

Specified by:
isInDomain in interface DoubleDomain

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

values

public jopt.csp.util.NumberIterator values()
Returns iterator of values in node's domain

Specified by:
values in interface NumDomain

deltaValues

public jopt.csp.util.NumberIterator deltaValues()
Returns iterator of values in node's delta

Specified by:
deltaValues in interface NumDomain

toSet

public jopt.csp.util.NumSet toSet()
Returns set of Numbers and NumIntervals representing domain

Specified by:
toSet in interface NumDomain

getDeltaSet

public jopt.csp.util.NumSet getDeltaSet()
Returns the delta set for this domain

Specified by:
getDeltaSet in interface NumDomain

clearDelta

public void clearDelta()
Clears the delta set for this domain

Specified by:
clearDelta in interface Domain

toString

public java.lang.String toString()
Returns string representation of domain


setChoicePointStack

public void setChoicePointStack(ChoicePointStack cps)
Sets the choicepoint stack associated with this domain. Can only be set once

Specified by:
setChoicePointStack in interface ChoicePointDataSource

choicePointStackSet

public boolean choicePointStackSet()
Returns true if a call to setChoicePointStack will fail

Specified by:
choicePointStackSet in interface ChoicePointDataSource

setMax

public void setMax(double val)
Attempts to reduce domain to a maximum value.

Specified by:
setMax in interface DoubleDomain

setMin

public void setMin(double val)
Attempts to reduce domain to a minimum value.

Specified by:
setMin in interface DoubleDomain

setValue

public void setValue(double val)
Attempts to reduce domain to a single value.

Specified by:
setValue in interface DoubleDomain

removeValue

public void removeValue(double val)
Attempts to remove a single value from the domain

Specified by:
removeValue in interface DoubleDomain

setRange

public void setRange(double start,
                     double end)
Attempts to reduce domain to within a range of values

Specified by:
setRange in interface DoubleDomain

removeRange

public void removeRange(double start,
                        double end)
Attempts to reduce domain by removing a range of values

Specified by:
removeRange in interface DoubleDomain

setDomain

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

Specified by:
setDomain in interface NumDomain

removeDomain

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

Specified by:
removeDomain in interface NumDomain

getDomainState

public java.lang.Object getDomainState()
Stores all necessary information for this domain allowing it to be restored to a previous state at a later point in time.

Specified by:
getDomainState in interface Domain
Returns:
an Object representing the current state information for this domain
See Also:
Domain.restoreDomainState(java.lang.Object)

restoreDomainState

public void restoreDomainState(java.lang.Object state)
Restores a domain to a previous state using the information contained in the state parameter.

Specified by:
restoreDomainState in interface Domain
Parameters:
state - The state information to which this domain should be set
See Also:
Domain.restoreDomainState(java.lang.Object)

clone

public java.lang.Object clone()
Description copied from interface: Domain
Returns a copy of this domain

Specified by:
clone in interface Domain
Specified by:
clone in class AbstractDomain