Record Class RolloutOptions
java.lang.Object
java.lang.Record
dev.twilite.game.simulation.rollout.RolloutOptions
- Record Components:
maxDepth- maximum number of actions in a branchiterations- number of tree iterations to runexploration- exploration weight used when selecting visited children
Search limits for a rollout simulation.
-
Constructor Summary
ConstructorsConstructorDescriptionRolloutOptions(int maxDepth, int iterations, double exploration) Creates an instance of aRolloutOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic RolloutOptionsdepth(int maxDepth) Creates default rollout options for a maximum branch depth.final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of theexplorationrecord component.exploration(double exploration) Returns a copy with a different exploration weight.final inthashCode()Returns a hash code value for this object.intReturns the value of theiterationsrecord component.iterations(int iterations) Returns a copy with a different number of search iterations.intmaxDepth()Returns the value of themaxDepthrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RolloutOptions
public RolloutOptions(int maxDepth, int iterations, double exploration) Creates an instance of aRolloutOptionsrecord class.- Parameters:
maxDepth- the value for themaxDepthrecord componentiterations- the value for theiterationsrecord componentexploration- the value for theexplorationrecord component
-
-
Method Details
-
depth
Creates default rollout options for a maximum branch depth.The default iteration count is
250and the exploration weight is0.5.- Parameters:
maxDepth- maximum number of actions in a branch
-
iterations
Returns a copy with a different number of search iterations.- Parameters:
iterations- number of tree iterations to run
-
exploration
Returns a copy with a different exploration weight.- Parameters:
exploration- exploration weight used when selecting visited children
-
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 with '=='. -
maxDepth
public int maxDepth()Returns the value of themaxDepthrecord component.- Returns:
- the value of the
maxDepthrecord component
-
iterations
public int iterations()Returns the value of theiterationsrecord component.- Returns:
- the value of the
iterationsrecord component
-
exploration
public double exploration()Returns the value of theexplorationrecord component.- Returns:
- the value of the
explorationrecord component
-