Record Class SearchAlgorithm.SearchResult<N extends GameTreeNode<N,P>, P extends IGamePosition<P>>
java.lang.Object
java.lang.Record
algorithm.SearchAlgorithm.SearchResult<N,P>
- Record Components:
root- a game-tree node at the root position of the original tree. This node should at least contain the updated optimistic and pessimistic values of the root's children nodes, reflecting the updated values as a result of the search.metrics- a list of metrics to be stored as part of this result. The first MetricKeeper in the list is considered the "main" metrics representing the result described by this object.
- Enclosing interface:
SearchAlgorithm
public static record SearchAlgorithm.SearchResult<N extends GameTreeNode<N,P>, P extends IGamePosition<P>> (N extends GameTreeNode<N,P> root, MetricKeeper[] metrics)
extends Record
Encapsulates the results and metrics captured from an adversarial tree search.
-
Constructor Summary
ConstructorsConstructorDescriptionSearchResult(N root, MetricKeeper... metrics) Creates an instance of aSearchResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbestMove()Alias forleastPessimisticNode()followed byGameTreeNode.position().intbooleancomplete()describe()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanThis is the position with the least pessimistic value.intmetrics()Returns the value of themetricsrecord component.This is the position with the most optimistic value.introot()Returns the value of therootrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
intractable
public boolean intractable()- Returns:
trueif the tree resulting from search was terminated for intractability (tree grew too large) rather than for completion of the proof. This is when there is no separation at the root node after search has terminated.falseis returned if search terminated normally.
-
complete
public boolean complete()- Returns:
trueif the tree resulting from search was terminated through separation. This signifies that the proof has been completed and is therefore valid given the assumption of a valid evaluation function and algorithm used to generate this result.falseis returned if the resulting tree has not achieved separation and the proof is likely not (yet) completed.
-
mostOptimisticNodes
-
leastPessimisticNodes
-
mostOptimisticNode
This is the position with the most optimistic value. However, this may not be the proven best value (if the search did not reach separation) as some other node may have the least pessimistic value (which may guarantee a better value, but may have a lower optimistic value).- Returns:
- the position with proven most optimistic value.
-
mostOptimisticNodeIndex
public int mostOptimisticNodeIndex()- Returns:
- the index of the move returned by
mostOptimisticNode()
-
leastPessimisticNode
This is the position with the least pessimistic value. This node guarantees the best minimum return as proven by the search. Some other node may have a higher most optimistic value (if the search did not reach separation), but may not guarantee the same pessimistic value.- Returns:
- the position with the proven least pessimistic value.
-
leastPessimisticNodeIndex
public int leastPessimisticNodeIndex()- Returns:
- the index of the move returned by
leastPessimisticNode()
-
bestMove
Alias forleastPessimisticNode()followed byGameTreeNode.position().the tree is intractable, the best position is the least pessimistic position. If the tree is not intractable,
leastPessimisticNode()andmostOptimisticNode()return the same value: the best position.- Returns:
- the position with the proven least pessimistic value (always) and most optimistic value (if separation was reached during the search).
-
bestMoveIndex
public int bestMoveIndex()- Returns:
- the index of the best move as returned by
bestMove()
-
mainMetrics
-
describe
- Returns:
- A description of the results described by this object. Best used for printing or writing to a file read with a standard text editor.
-
toString
-
hashCode
-
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). -
root
-
metrics
-