Record Class RolloutSearch.EvaluateBuilder<S,A>
java.lang.Object
java.lang.Record
dev.twilite.game.simulation.rollout.RolloutSearch.EvaluateBuilder<S,A>
- Type Parameters:
S- simulated state typeA- action type- Record Components:
options- search limitsactions- supplies legal actions for a statetransition- applies an action and returns the next branch stateevaluator- scores a branch nodeterminal- returns whether a branch should stop expanding
- Enclosing class:
RolloutSearch<S,A>
public static record RolloutSearch.EvaluateBuilder<S,A> (RolloutOptions options, Function<S,? extends Collection<A>> actions, BiFunction<S,A,S> transition, ToIntFunction<RolloutNode<S,A>> evaluator, Predicate<RolloutNode<S,A>> terminal)
extends Record
Final builder step for optional terminal configuration and construction.
-
Constructor Summary
ConstructorsConstructorDescriptionEvaluateBuilder(RolloutOptions options, Function<S, ? extends Collection<A>> actions, BiFunction<S, A, S> transition, ToIntFunction<RolloutNode<S, A>> evaluator, Predicate<RolloutNode<S, A>> terminal) Creates an instance of aEvaluateBuilderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionFunction<S, ? extends Collection<A>> actions()Returns the value of theactionsrecord component.build()Builds the rollout search.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theevaluatorrecord component.final inthashCode()Returns a hash code value for this object.options()Returns the value of theoptionsrecord component.terminal()Returns the value of theterminalrecord component.terminal(Predicate<RolloutNode<S, A>> terminal) Sets the terminal predicate.final StringtoString()Returns a string representation of this record class.BiFunction<S, A, S> Returns the value of thetransitionrecord component.
-
Constructor Details
-
EvaluateBuilder
public EvaluateBuilder(RolloutOptions options, Function<S, ? extends Collection<A>> actions, BiFunction<S, A, S> transition, ToIntFunction<RolloutNode<S, A>> evaluator, Predicate<RolloutNode<S, A>> terminal) Creates an instance of aEvaluateBuilderrecord class.- Parameters:
options- the value for theoptionsrecord componentactions- the value for theactionsrecord componenttransition- the value for thetransitionrecord componentevaluator- the value for theevaluatorrecord componentterminal- the value for theterminalrecord component
-
-
Method Details
-
terminal
Sets the terminal predicate.- Parameters:
terminal- returns whether a branch should stop expanding
-
build
Builds the rollout search. -
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). -
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-
actions
Returns the value of theactionsrecord component.- Returns:
- the value of the
actionsrecord component
-
transition
Returns the value of thetransitionrecord component.- Returns:
- the value of the
transitionrecord component
-
evaluator
Returns the value of theevaluatorrecord component.- Returns:
- the value of the
evaluatorrecord component
-
terminal
Returns the value of theterminalrecord component.- Returns:
- the value of the
terminalrecord component
-