Bounds used in Dfpn search. More...
#include <DfpnSolver.hpp>
Public Member Functions | |
DfpnBounds () | |
DfpnBounds (DfpnBoundType p, DfpnBoundType d) | |
bool | GreaterThan (const DfpnBounds &other) const |
Returns true if phi is greater than other's phi and delta is greater than other's delta. | |
bool | IsWinning () const |
Returns true if bounds are winning (phi is 0). | |
bool | IsLosing () const |
Returns true if bounds are losing (delta is 0). | |
bool | IsSolved () const |
Returns true if IsWinning() or IsLosing() is true. | |
void | CheckConsistency () const |
std::string | Print () const |
Print bounds in human readable format. | |
Static Public Member Functions | |
static void | SetToWinning (DfpnBounds &bounds) |
Sets the bounds to (0, INFTY). | |
static void | SetToLosing (DfpnBounds &bounds) |
Sets the bounds to (INFTY, 0). | |
Public Attributes | |
DfpnBoundType | phi |
Proof number. | |
DfpnBoundType | delta |
Disproof number. | |
Static Public Attributes | |
static const DfpnBoundType | INFTY = 2000000000 |
Denotes a proven state. | |
static const DfpnBoundType | MAX_WORK = INFTY / 2 |
Maximum amount of work. |
Bounds used in Dfpn search.
Definition at line 51 of file DfpnSolver.hpp.
DfpnBounds::DfpnBounds | ( | ) | [inline] |
Definition at line 97 of file DfpnSolver.hpp.
DfpnBounds::DfpnBounds | ( | DfpnBoundType | p, | |
DfpnBoundType | d | |||
) | [inline] |
Definition at line 103 of file DfpnSolver.hpp.
void DfpnBounds::CheckConsistency | ( | ) | const |
Definition at line 30 of file DfpnSolver.cpp.
References delta, HexAssert, INFTY, and phi.
Referenced by DfpnSolver::MID(), and DfpnSolver::TTWrite().
bool DfpnBounds::GreaterThan | ( | const DfpnBounds & | other | ) | const [inline] |
Returns true if phi is greater than other's phi and delta is greater than other's delta.
Definition at line 116 of file DfpnSolver.hpp.
Referenced by DfpnSolver::MID().
bool DfpnBounds::IsLosing | ( | ) | const [inline] |
Returns true if bounds are losing (delta is 0).
Definition at line 126 of file DfpnSolver.hpp.
References delta.
Referenced by DfpnCommands::CmdGetBounds(), IsSolved(), DfpnSolver::MID(), DfpnSolver::SelectChild(), and DfpnSolver::UpdateBounds().
bool DfpnBounds::IsSolved | ( | ) | const [inline] |
Returns true if IsWinning() or IsLosing() is true.
Definition at line 131 of file DfpnSolver.hpp.
References IsLosing(), and IsWinning().
Referenced by DfpnSolver::MID(), DfpnSolver::PropagateBackwards(), and DfpnSolver::StartSearch().
bool DfpnBounds::IsWinning | ( | ) | const [inline] |
Returns true if bounds are winning (phi is 0).
Definition at line 121 of file DfpnSolver.hpp.
References phi.
Referenced by DfpnCommands::CmdGetBounds(), IsSolved(), PerfectPlayer::Search(), and DfpnSolver::StartSearch().
std::string DfpnBounds::Print | ( | ) | const [inline] |
Print bounds in human readable format.
Definition at line 109 of file DfpnSolver.hpp.
Referenced by operator<<().
void DfpnBounds::SetToLosing | ( | DfpnBounds & | bounds | ) | [inline, static] |
Sets the bounds to (INFTY, 0).
Definition at line 142 of file DfpnSolver.hpp.
References delta, INFTY, and phi.
Referenced by DfpnSolver::MID().
void DfpnBounds::SetToWinning | ( | DfpnBounds & | bounds | ) | [inline, static] |
Sets the bounds to (0, INFTY).
Definition at line 136 of file DfpnSolver.hpp.
References delta, INFTY, and phi.
Referenced by DfpnSolver::MID(), and DfpnSolver::UpdateBounds().
Disproof number.
Estimated amount of work to prove this state losing.
Definition at line 65 of file DfpnSolver.hpp.
Referenced by CheckConsistency(), DfpnCommands::CmdGetBounds(), GreaterThan(), IsLosing(), DfpnSolver::LookupData(), DfpnSolver::MID(), Print(), DfpnSolver::SelectChild(), SetToLosing(), SetToWinning(), and DfpnSolver::UpdateBounds().
const DfpnBoundType DfpnBounds::INFTY = 2000000000 [static] |
Denotes a proven state.
Definition at line 54 of file DfpnSolver.hpp.
Referenced by CheckConsistency(), DfpnSolver::MID(), DfpnSolver::SelectChild(), SetToLosing(), SetToWinning(), and DfpnSolver::UpdateBounds().
const DfpnBoundType DfpnBounds::MAX_WORK = INFTY / 2 [static] |
Maximum amount of work.
Must be less than INFTY.
Definition at line 57 of file DfpnSolver.hpp.
Referenced by DfpnCommands::CmdSolveState(), and DfpnSolver::StartSearch().
Proof number.
Estimated amount of work to prove this state winning.
Definition at line 61 of file DfpnSolver.hpp.
Referenced by CheckConsistency(), DfpnCommands::CmdGetBounds(), GreaterThan(), IsWinning(), DfpnSolver::LookupData(), DfpnSolver::MID(), Print(), SetToLosing(), SetToWinning(), and DfpnSolver::UpdateBounds().