Class FromSolutionPropertyValueRangeDescriptor<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.AbstractFromPropertyValueRangeDescriptor
arrayWrapping, collectionWrapping, countable, memberAccessorFields inherited from class ai.timefold.solver.core.impl.domain.valuerange.descriptor.AbstractValueRangeDescriptor
variableDescriptor -
Constructor Summary
ConstructorsConstructorDescriptionFromSolutionPropertyValueRangeDescriptor(int ordinal, GenuineVariableDescriptor<Solution_> variableDescriptor, MemberAccessor memberAccessor) -
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.Methods inherited from class ai.timefold.solver.core.impl.domain.valuerange.descriptor.AbstractFromPropertyValueRangeDescriptor
isCountable, isGenericTypeImmutable, processValueRange, readValueRange, readValueRangeForSolution, transformArrayToListMethods 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
-
FromSolutionPropertyValueRangeDescriptor
public FromSolutionPropertyValueRangeDescriptor(int ordinal, GenuineVariableDescriptor<Solution_> variableDescriptor, MemberAccessor memberAccessor)
-
-
Method Details
-
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. -
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.
-