TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
Loading...
Searching...
No Matches
machine_learning::aystar_search::AyStarSearch< Puzzle >::Info Struct Reference

Struct that handles all the information related to the current state. More...

Collaboration diagram for machine_learning::aystar_search::AyStarSearch< Puzzle >::Info:
[legend]

Public Member Functions

 Info ()=default
 stores g score
 
 Info (const Puzzle &A)
 constructor having Puzzle as parameter
 
 Info (const Puzzle &A, size_t h_value, size_t d)
 constructor having three parameters
 
 Info (const Info &A)
 Copy constructor.
 
 Info (const Info &&A) noexcept
 Move constructor.
 
Infooperator= (const Info &A)
 copy assignment operator
 
Infooperator= (Info &&A) noexcept
 move assignment operator
 
 ~Info ()=default
 Destructor for Info.
 

Public Attributes

std::shared_ptr< Puzzle > state
 
size_t heuristic_value = 0
 Holds the current state.
 
size_t depth = 0
 stores h score
 

Detailed Description

template<typename Puzzle>
struct machine_learning::aystar_search::AyStarSearch< Puzzle >::Info

Struct that handles all the information related to the current state.

Definition at line 293 of file a_star_search.cpp.

Constructor & Destructor Documentation

◆ Info() [1/5]

template<typename Puzzle>
machine_learning::aystar_search::AyStarSearch< Puzzle >::Info::Info ( )
default

stores g score

Default constructor

◆ Info() [2/5]

template<typename Puzzle>
machine_learning::aystar_search::AyStarSearch< Puzzle >::Info::Info ( const Puzzle & A)
inlineexplicit

constructor having Puzzle as parameter

Parameters
Aa puzzle object

Definition at line 307 of file a_star_search.cpp.

307: state(std::make_shared<Puzzle>(A)) {}
A class defining A* search algorithm. for some initial state and final state.

◆ Info() [3/5]

template<typename Puzzle>
machine_learning::aystar_search::AyStarSearch< Puzzle >::Info::Info ( const Puzzle & A,
size_t h_value,
size_t d )
inline

constructor having three parameters

Parameters
Aa puzzle object
h_valueheuristic value of this puzzle object
depththe depth at which this node was found during traversal

Definition at line 315 of file a_star_search.cpp.

◆ Info() [4/5]

template<typename Puzzle>
machine_learning::aystar_search::AyStarSearch< Puzzle >::Info::Info ( const Info & A)
inline

Copy constructor.

Parameters
AInfo object reference

Definition at line 324 of file a_star_search.cpp.

325 : state(std::make_shared<Puzzle>(A.state)),
326 heuristic_value(A.heuristic_value),
327 depth(A.depth) {}

◆ Info() [5/5]

template<typename Puzzle>
machine_learning::aystar_search::AyStarSearch< Puzzle >::Info::Info ( const Info && A)
inlinenoexcept

Move constructor.

Parameters
AInfo object reference

Definition at line 333 of file a_star_search.cpp.

334 : state(std::make_shared<Puzzle>(std::move(A.state))),
335 heuristic_value(std::move(A.heuristic_value)),
336 depth(std::move(A.depth)) {}

Member Function Documentation

◆ operator=() [1/2]

template<typename Puzzle>
Info & machine_learning::aystar_search::AyStarSearch< Puzzle >::Info::operator= ( const Info & A)
inline

copy assignment operator

Parameters
AInfo object reference

Definition at line 342 of file a_star_search.cpp.

342 {
343 state = A.state;
344 heuristic_value = A.heuristic_value;
345 depth = A.depth;
346 return *this;
347 }

◆ operator=() [2/2]

template<typename Puzzle>
Info & machine_learning::aystar_search::AyStarSearch< Puzzle >::Info::operator= ( Info && A)
inlinenoexcept

move assignment operator

Parameters
AInfo object reference

Definition at line 353 of file a_star_search.cpp.

353 {
354 state = std::move(A.state);
355 heuristic_value = std::move(A.heuristic_value);
356 depth = std::move(A.depth);
357 return *this;
358 }

Member Data Documentation

◆ depth

template<typename Puzzle>
size_t machine_learning::aystar_search::AyStarSearch< Puzzle >::Info::depth = 0

stores h score

Definition at line 296 of file a_star_search.cpp.

◆ heuristic_value

template<typename Puzzle>
size_t machine_learning::aystar_search::AyStarSearch< Puzzle >::Info::heuristic_value = 0

Holds the current state.

Definition at line 295 of file a_star_search.cpp.

◆ state

template<typename Puzzle>
std::shared_ptr<Puzzle> machine_learning::aystar_search::AyStarSearch< Puzzle >::Info::state

Definition at line 294 of file a_star_search.cpp.


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