Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::AdversarialSearchResult< Move, Score > Struct Template Reference

Result of one adversarial search execution. More...

#include <Negamax.H>

Collaboration diagram for Aleph::AdversarialSearchResult< Move, Score >:
[legend]

Public Types

using Move_Type = Move
 
using Score_Type = Score
 

Public Member Functions

bool exhausted () const noexcept
 True when the search space was fully explored.
 
bool limit_reached () const noexcept
 True when a resource limit was hit before exhaustion.
 
bool has_principal_variation () const noexcept
 True when at least one move is available in the principal variation.
 
const Move & first_move () const
 First move of the principal variation.
 

Public Attributes

SearchStatus status = SearchStatus::NotStarted
 Final execution state.
 
ExplorationPolicy policy
 Exploration policy used during the run.
 
SearchLimits limits
 Limits used for the run.
 
AdversarialSearchStats stats
 Collected adversarial-search statistics.
 
Score value = Score{}
 Root score from the current player's perspective.
 
SearchPath< Move > principal_variation
 Best line found from the root.
 

Detailed Description

template<SearchMove Move, AdversarialScore Score>
struct Aleph::AdversarialSearchResult< Move, Score >

Result of one adversarial search execution.

The returned score is interpreted from the perspective of the side to move at the root state. principal_variation stores the best line found from that root under the configured horizon and limits.

Definition at line 166 of file Negamax.H.

Member Typedef Documentation

◆ Move_Type

template<SearchMove Move, AdversarialScore Score>
using Aleph::AdversarialSearchResult< Move, Score >::Move_Type = Move

Definition at line 168 of file Negamax.H.

◆ Score_Type

template<SearchMove Move, AdversarialScore Score>
using Aleph::AdversarialSearchResult< Move, Score >::Score_Type = Score

Definition at line 169 of file Negamax.H.

Member Function Documentation

◆ exhausted()

template<SearchMove Move, AdversarialScore Score>
bool Aleph::AdversarialSearchResult< Move, Score >::exhausted ( ) const
inlinenoexcept

True when the search space was fully explored.

Definition at line 179 of file Negamax.H.

References Aleph::Exhausted, and Aleph::AdversarialSearchResult< Move, Score >::status.

◆ first_move()

template<SearchMove Move, AdversarialScore Score>
const Move & Aleph::AdversarialSearchResult< Move, Score >::first_move ( ) const
inline

First move of the principal variation.

Exceptions
std::runtime_errorif no move is available at the root.

Definition at line 199 of file Negamax.H.

References ah_runtime_error_unless, Aleph::AdversarialSearchResult< Move, Score >::has_principal_variation(), and Aleph::AdversarialSearchResult< Move, Score >::principal_variation.

◆ has_principal_variation()

template<SearchMove Move, AdversarialScore Score>
bool Aleph::AdversarialSearchResult< Move, Score >::has_principal_variation ( ) const
inlinenoexcept

True when at least one move is available in the principal variation.

Definition at line 191 of file Negamax.H.

References Aleph::divide_and_conquer_partition_dp(), and Aleph::AdversarialSearchResult< Move, Score >::principal_variation.

Referenced by Aleph::AdversarialSearchResult< Move, Score >::first_move().

◆ limit_reached()

template<SearchMove Move, AdversarialScore Score>
bool Aleph::AdversarialSearchResult< Move, Score >::limit_reached ( ) const
inlinenoexcept

True when a resource limit was hit before exhaustion.

Definition at line 185 of file Negamax.H.

References Aleph::LimitReached, and Aleph::AdversarialSearchResult< Move, Score >::status.

Member Data Documentation

◆ limits

template<SearchMove Move, AdversarialScore Score>
SearchLimits Aleph::AdversarialSearchResult< Move, Score >::limits

Limits used for the run.

Definition at line 173 of file Negamax.H.

Referenced by Aleph::Negamax< Domain >::search_impl(), and Aleph::Alpha_Beta< Domain >::search_impl().

◆ policy

template<SearchMove Move, AdversarialScore Score>
ExplorationPolicy Aleph::AdversarialSearchResult< Move, Score >::policy

Exploration policy used during the run.

Definition at line 172 of file Negamax.H.

Referenced by Aleph::Negamax< Domain >::search_impl(), and Aleph::Alpha_Beta< Domain >::search_impl().

◆ principal_variation

template<SearchMove Move, AdversarialScore Score>
SearchPath<Move> Aleph::AdversarialSearchResult< Move, Score >::principal_variation

◆ stats

◆ status

◆ value

template<SearchMove Move, AdversarialScore Score>
Score Aleph::AdversarialSearchResult< Move, Score >::value = Score{}

Root score from the current player's perspective.

Definition at line 175 of file Negamax.H.

Referenced by Aleph::Negamax< Domain >::search_impl(), and Aleph::Alpha_Beta< Domain >::search_impl().


The documentation for this struct was generated from the following file: