Class CompositeValueRangeDescriptor<Solution_>
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
- All Implemented Interfaces:
ValueRangeDescriptor<Solution_>
-
Field Summary
Fields inherited from class ai.timefold.solver.core.impl.domain.valuerange.descriptor.AbstractValueRangeDescriptor
variableDescriptor -
Constructor Summary
ConstructorsConstructorDescriptionCompositeValueRangeDescriptor(int ordinal, GenuineVariableDescriptor<Solution_> variableDescriptor, List<ValueRangeDescriptor<Solution_>> childValueRangeDescriptorList) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the value range is defined at the solution level and can be directly extracted from the solution; otherwise, it returns false, as the value range can only be extracted or computed from the entities.<T> ValueRange<T>extractAllValues(Solution_ solution) Extracts theValueRangefrom the solution or, if the value range is defined at the entity level, extracts a compositeValueRangefrom all entities in the solution.<T> ValueRange<T>extractValuesFromEntity(Solution_ solution, Object entity) Extracts theValueRangefrom the planning entity.intbooleanbooleanMethods inherited from class ai.timefold.solver.core.impl.domain.valuerange.descriptor.AbstractValueRangeDescriptor
getOrdinal, getVariableDescriptor, mightContainEntity, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.timefold.solver.core.impl.domain.valuerange.descriptor.ValueRangeDescriptor
acceptsNullInValueRange
-
Constructor Details
-
CompositeValueRangeDescriptor
public CompositeValueRangeDescriptor(int ordinal, GenuineVariableDescriptor<Solution_> variableDescriptor, List<ValueRangeDescriptor<Solution_>> childValueRangeDescriptorList)
-
-
Method Details
-
isGenericTypeImmutable
public boolean isGenericTypeImmutable()- Returns:
- true if the value range generic type is immutable.
-
getValueRangeCount
public int getValueRangeCount() -
canExtractValueRangeFromSolution
public boolean canExtractValueRangeFromSolution()Description copied from interface:ValueRangeDescriptorReturns true if the value range is defined at the solution level and can be directly extracted from the solution; otherwise, it returns false, as the value range can only be extracted or computed from the entities. -
isCountable
public boolean isCountable()- Returns:
- true if the
ValueRangeis countable (for example a double value range between 1.2 and 1.4 is not countable)
-
extractAllValues
Description copied from interface:ValueRangeDescriptorExtracts theValueRangefrom the solution or, if the value range is defined at the entity level, extracts a compositeValueRangefrom all entities in the solution.The method should not be invoked directly by selectors or other components of the solver. The
ValueRangeManager.getFromSolution(ValueRangeDescriptor, Object)andValueRangeManager.getFromEntity(ValueRangeDescriptor, Object)serve as the single source of truth for managing value ranges and should be used by outer components.Calling this method outside
ValueRangeManagermay lead to unnecessary recomputation of ranges. -
extractValuesFromEntity
Description copied from interface:ValueRangeDescriptorExtracts theValueRangefrom the planning entity. If the value range is defined at the solution level instead, this method reads the value range from there.The method should not be invoked directly by selectors or other components of the solver. The
ValueRangeManager.getFromSolution(ValueRangeDescriptor, Object)andValueRangeManager.getFromEntity(ValueRangeDescriptor, Object)serve as the single source of truth for managing value ranges and should be used by outer components.Calling this method outside
ValueRangeManagermay lead to unnecessary recomputation of ranges.
-