Record Class SessionContext<Solution_>
java.lang.Object
java.lang.Record
ai.timefold.solver.core.impl.score.director.SessionContext<Solution_>
@NullMarked
public record SessionContext<Solution_>(Solution_ workingSolution, SolutionView<Solution_> solutionView, ValueRangeManager<Solution_> valueRangeManager, SupplyManager supplyManager)
extends Record
Used throughout the solver to provide access to some internals of the score director
required for initialization of Bavet nodes and other components.
It is imperative that all of these values come from the same score director instance,
because they are all tied to the same working solution.
These values are only valid during the runtime of the session;
new session requires a new
SessionContext instance.-
Constructor Summary
ConstructorsConstructorDescriptionSessionContext(InnerScoreDirector<Solution_, ?> scoreDirector) SessionContext(Solution_ workingSolution, SolutionView<Solution_> solutionView, ValueRangeManager<Solution_> valueRangeManager, SupplyManager supplyManager) Creates an instance of aSessionContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.<T> CountableValueRange<T>getValueRange(ValueRangeDescriptor<Solution_> valueRangeDescriptor) final inthashCode()Returns a hash code value for this object.Returns the value of thesolutionViewrecord component.Returns the value of thesupplyManagerrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevalueRangeManagerrecord component.Returns the value of theworkingSolutionrecord component.
-
Constructor Details
-
SessionContext
-
SessionContext
public SessionContext(Solution_ workingSolution, SolutionView<Solution_> solutionView, ValueRangeManager<Solution_> valueRangeManager, SupplyManager supplyManager) Creates an instance of aSessionContextrecord class.- Parameters:
workingSolution- the value for theworkingSolutionrecord componentsolutionView- the value for thesolutionViewrecord componentvalueRangeManager- the value for thevalueRangeManagerrecord componentsupplyManager- the value for thesupplyManagerrecord component
-
-
Method Details
-
getValueRange
public <T> CountableValueRange<T> getValueRange(ValueRangeDescriptor<Solution_> valueRangeDescriptor) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
workingSolution
Returns the value of theworkingSolutionrecord component.- Returns:
- the value of the
workingSolutionrecord component
-
solutionView
Returns the value of thesolutionViewrecord component.- Returns:
- the value of the
solutionViewrecord component
-
valueRangeManager
Returns the value of thevalueRangeManagerrecord component.- Returns:
- the value of the
valueRangeManagerrecord component
-
supplyManager
Returns the value of thesupplyManagerrecord component.- Returns:
- the value of the
supplyManagerrecord component
-