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 type
A - action type
Record Components:
options - search limits
actions - supplies legal actions for a state
transition - applies an action and returns the next branch state
evaluator - scores a branch node
terminal - 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 Details

  • Method Details

    • terminal

      public RolloutSearch.EvaluateBuilder<S,A> terminal(Predicate<RolloutNode<S,A>> terminal)
      Sets the terminal predicate.
      Parameters:
      terminal - returns whether a branch should stop expanding
    • build

      public RolloutSearch<S,A> build()
      Builds the rollout search.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • options

      public RolloutOptions options()
      Returns the value of the options record component.
      Returns:
      the value of the options record component
    • actions

      public Function<S,? extends Collection<A>> actions()
      Returns the value of the actions record component.
      Returns:
      the value of the actions record component
    • transition

      public BiFunction<S,A,S> transition()
      Returns the value of the transition record component.
      Returns:
      the value of the transition record component
    • evaluator

      public ToIntFunction<RolloutNode<S,A>> evaluator()
      Returns the value of the evaluator record component.
      Returns:
      the value of the evaluator record component
    • terminal

      public Predicate<RolloutNode<S,A>> terminal()
      Returns the value of the terminal record component.
      Returns:
      the value of the terminal record component