Record Class RolloutOptions

java.lang.Object
java.lang.Record
dev.twilite.game.simulation.rollout.RolloutOptions
Record Components:
maxDepth - maximum number of actions in a branch
iterations - number of tree iterations to run
exploration - exploration weight used when selecting visited children

public record RolloutOptions(int maxDepth, int iterations, double exploration) extends Record
Search limits for a rollout simulation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RolloutOptions(int maxDepth, int iterations, double exploration)
    Creates an instance of a RolloutOptions record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    depth(int maxDepth)
    Creates default rollout options for a maximum branch depth.
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
    Returns the value of the exploration record component.
    exploration(double exploration)
    Returns a copy with a different exploration weight.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the iterations record component.
    iterations(int iterations)
    Returns a copy with a different number of search iterations.
    int
    Returns the value of the maxDepth record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RolloutOptions

      public RolloutOptions(int maxDepth, int iterations, double exploration)
      Creates an instance of a RolloutOptions record class.
      Parameters:
      maxDepth - the value for the maxDepth record component
      iterations - the value for the iterations record component
      exploration - the value for the exploration record component
  • Method Details

    • depth

      public static RolloutOptions depth(int maxDepth)
      Creates default rollout options for a maximum branch depth.

      The default iteration count is 250 and the exploration weight is 0.5.

      Parameters:
      maxDepth - maximum number of actions in a branch
    • iterations

      public RolloutOptions iterations(int iterations)
      Returns a copy with a different number of search iterations.
      Parameters:
      iterations - number of tree iterations to run
    • exploration

      public RolloutOptions exploration(double exploration)
      Returns a copy with a different exploration weight.
      Parameters:
      exploration - exploration weight used when selecting visited children
    • 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 '=='.
      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.
    • maxDepth

      public int maxDepth()
      Returns the value of the maxDepth record component.
      Returns:
      the value of the maxDepth record component
    • iterations

      public int iterations()
      Returns the value of the iterations record component.
      Returns:
      the value of the iterations record component
    • exploration

      public double exploration()
      Returns the value of the exploration record component.
      Returns:
      the value of the exploration record component