Algorithms_in_C++ 1.0.0
Set of 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.

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
307: state(std::make_shared<Puzzle>(A)) {}

◆ 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
316 : state(std::make_shared<Puzzle>(A)),
317 heuristic_value(h_value),
318 depth(d) {}
size_t depth
stores h score
Definition a_star_search.cpp:296
size_t heuristic_value
Holds the current state.
Definition a_star_search.cpp:295

◆ Info() [4/5]

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

Copy constructor.

Parameters
AInfo object reference
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
334 : state(std::make_shared<Puzzle>(std::move(A.state))),
335 heuristic_value(std::move(A.heuristic_value)),
336 depth(std::move(A.depth)) {}
T move(T... args)

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
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
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 }
Here is the call graph for this function:

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