Module value_selection

Module value_selection 

Source
Expand description

Provides the ValueSelector trait which is required for value selectors to implement; the main method in this trait relies on ValueSelector::select_value.

Furthermore, it defines several implementations of the ValueSelector trait. Any ValueSelector should only select values which are in the domain of the provided variable.

Structs§

DynamicValueSelector
Similar to [DynamicBrancher], this is a pass-along structure which should be used when a Sized object is required.
InDomainInterval
Reduces the domain (consisting of intervals) to its first interval.
InDomainMax
ValueSelector which chooses to assign the provided variable to its upper-bound.
InDomainMedian
A ValueSelector which selects the median value in the domain (or if this value is already assigned then the closest variable to it in terms of index).
InDomainMiddle
A ValueSelector which selects the middle value in the domain (or if this value is already assigned then the closest variable to it).
InDomainMin
ValueSelector which chooses to assign the provided variable to its lowest-bound.
InDomainRandom
A ValueSelector which assigns to a random value in the domain.
InDomainSplit
A ValueSelector which splits the domain in half (based on the lower-bound and upper-bound, disregarding holes) and removes the upper-half from the domain.
InDomainSplitRandom
A ValueSelector which bisects the domain in the middle (between the lower-bound and lower-bound, disregarding holes), randomly selecting whether to exclude the lower-half or the upper-half.
OutDomainMax
A ValueSelector which excludes the largest value from the domain.
OutDomainMedian
A ValueSelector which excludes the median value from the domain.
OutDomainMin
A ValueSelector which excludes the smallest value from the domain.
OutDomainRandom
A ValueSelector which excludes a random value from the domain.
RandomSplitter
A ValueSelector which splits the domain in a random manner (between the lower-bound and lower-bound, disregarding holes), randomly selecting whether to exclude the lower-half or the upper-half.
ReverseInDomainSplit
A ValueSelector which splits the domain in half (based on the lower-bound and upper-bound, disregarding holes) and removes the lower-half from the domain.

Traits§

ValueSelector
A trait containing the interface for ValueSelectors, specifying the appropriate hooks into the solver and the methods required for selecting a value for a given variable.