Class BigDecimalValueRange
java.lang.Object
ai.timefold.solver.core.impl.domain.valuerange.AbstractCountableValueRange<BigDecimal>
ai.timefold.solver.core.impl.domain.valuerange.buildin.bigdecimal.BigDecimalValueRange
- All Implemented Interfaces:
CountableValueRange<BigDecimal>,ValueRange<BigDecimal>
-
Constructor Summary
ConstructorsConstructorDescriptionBigDecimalValueRange(BigDecimal from, BigDecimal to) All parameters must have the sameBigDecimal.scale().BigDecimalValueRange(BigDecimal from, BigDecimal to, BigDecimal incrementUnit) All parameters must have the sameBigDecimal.scale(). -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(BigDecimal value) @NonNull Iterator<BigDecimal>Select the elements in original (natural) order.@NonNull Iterator<BigDecimal>createRandomIterator(@NonNull Random workingRandom) Select in random order, but without shuffling the elements.get(long index) Used by uniform random selection in a composite CountableValueRange, or one which includes nulls.longgetSize()Used by uniform random selection in a composite CountableValueRange, or one which includes nulls.toString()Methods inherited from class ai.timefold.solver.core.impl.domain.valuerange.AbstractCountableValueRange
isEmpty
-
Constructor Details
-
BigDecimalValueRange
All parameters must have the sameBigDecimal.scale().- Parameters:
from- never null, inclusive minimumto- never null, exclusive maximum,>= from
-
BigDecimalValueRange
All parameters must have the sameBigDecimal.scale().- Parameters:
from- never null, inclusive minimumto- never null, exclusive maximum,>= fromincrementUnit- never null,> 0
-
-
Method Details
-
getSize
public long getSize()Description copied from interface:CountableValueRangeUsed by uniform random selection in a composite CountableValueRange, or one which includes nulls.- Returns:
- the exact number of elements generated by this
CountableValueRange, always>= 0
-
get
Description copied from interface:CountableValueRangeUsed by uniform random selection in a composite CountableValueRange, or one which includes nulls.- Parameters:
index- always<CountableValueRange.getSize()- Returns:
- sometimes null (if
PlanningVariable.allowsUnassigned()is true)
-
contains
- Parameters:
value- sometimes null- Returns:
- true if the ValueRange contains that value
-
createOriginalIterator
Description copied from interface:CountableValueRangeSelect the elements in original (natural) order. -
createRandomIterator
Description copied from interface:ValueRangeSelect in random order, but without shuffling the elements. Each element might be selected multiple times. Scales well because it does not require caching.- Parameters:
workingRandom- theRandomto use when any random number is needed, so runs are reproducible.
-
toString
-