#include <FCSFreecellSolvingAlgorithm.h>
Inheritance diagram for FCSFreecellSolvingAlgorithm:
Public Member Functions | |
virtual | ~FCSFreecellSolvingAlgorithm () |
Destructor. | |
Static Public Member Functions | |
static FCSFreecellSolvingAlgorithm * | Create (FCCommandLineArguments *CommandLine) |
Create a solving algorithm with CommandLine. | |
Protected Member Functions | |
FCSFreecellSolvingAlgorithm () | |
Default constructor. | |
FCSFreecellSolvingAlgorithm (FCCommandLineArguments *CommandLine) | |
Constructor with command line interface. | |
void | FlipTopCard (FCSStateWithLocations *State, int Stack, FCSMove *Move, FCSMoveStack **MoveStack) |
Check if the top card in the stack is a flipped card and if so flips it so its face is up. | |
virtual FCSStateSolvingReturnCodes | RunTest (int TestNumber, FCSStateWithLocations *StateWithLocations, int Depth, int NumberOfFreeStacks, int NumberOfFreecells, FCSDerivedStatesList *DerivedStateList) |
Function to run each test on a state. | |
FCSStateSolvingReturnCodes | MoveTopStackCardsToFounds (FCSStateWithLocations *StateWithLocations, int Depth, int NumberOfFreeStacks, int NumberOfFreecells, FCSDerivedStatesList *DerivedStateList) |
This function tries to move stack cards that are present at the top of stacks to the foundations. | |
FCSStateSolvingReturnCodes | MoveFreecellCardsToFounds (FCSStateWithLocations *StateWithLocations, int Depth, int NumberOfFreeStacks, int NumberOfFreecells, FCSDerivedStatesList *DerivedStateList) |
This test moves single cards that are present in the freecells to the foundations. | |
FCSStateSolvingReturnCodes | MoveFreecellCardsToTopOfStacks (FCSStateWithLocations *StateWithLocations, int Depth, int NumberOfFreeStacks, int NumberOfFreecells, FCSDerivedStatesList *DerivedStateList) |
This test moves single cards that are present in the freecells to the top of a stack. | |
FCSStateSolvingReturnCodes | MoveNonTopStackCardsToFounds (FCSStateWithLocations *StateWithLocations, int Depth, int NumberOfFreeStacks, int NumberOfFreecells, FCSDerivedStatesList *DerivedStateList) |
This test moves a single card from within a stack to a foundation. | |
FCSStateSolvingReturnCodes | MoveStackCardsToDifferentStacks (FCSStateWithLocations *StateWithLocations, int Depth, int NumberOfFreeStacks, int NumberOfFreecells, FCSDerivedStatesList *DerivedStateList) |
This moves cards from one stack to another. | |
FCSStateSolvingReturnCodes | MoveStackCardsToAParentOnTheSameStack (FCSStateWithLocations *StateWithLocations, int Depth, int NumberOfFreeStacks, int NumberOfFreecells, FCSDerivedStatesList *DerivedStateList) |
This test moves cards on a stack to a parent on the same stack. | |
FCSStateSolvingReturnCodes | MoveSequencesToFreeStacks (FCSStateWithLocations *StateWithLocations, int Depth, int NumberOfFreeStacks, int NumberOfFreecells, FCSDerivedStatesList *DerivedStateList) |
This tests moves a sequence to an empty stack. | |
FCSStateSolvingReturnCodes | MoveFreecellCardsToEmptyStack (FCSStateWithLocations *StateWithLocations, int Depth, int NumberOfFreeStacks, int NumberOfFreecells, FCSDerivedStatesList *DerivedStateList) |
This tests moves a (group of) freecell card(s) to an empty stack. | |
FCSStateSolvingReturnCodes | MoveCardsToADifferentParent (FCSStateWithLocations *StateWithLocations, int Depth, int NumberOfFreeStacks, int NumberOfFreecells, FCSDerivedStatesList *DerivedStateList) |
Move cards to a parent on a different stack. | |
FCSStateSolvingReturnCodes | EmptyStackIntoFreecells (FCSStateWithLocations *StateWithLocations, int Depth, int NumberOfFreeStacks, int NumberOfFreecells, FCSDerivedStatesList *DerivedStateList) |
Put an entire stack into freecell cards. |
Definition at line 16 of file FCSFreecellSolvingAlgorithm.h.
|
It is assumed that CommandLine has already been verified. This includes a valid start state
Reimplemented in FCSTalonSolvingAlgorithm. Definition at line 31 of file FCSFreecellSolvingAlgorithm.cpp. References FCCommandLineArguments::GetSolvingMethodType(). Referenced by MainCreate(). |
|
Definition at line 1400 of file FCSFreecellSolvingAlgorithm.cpp. References FCSFreecellData::CheckStateBegin(), FCSFreecellData::CheckStateEnd(), FCSMove::Create(), FCSCard::Create(), CreateMoveStack(), FCSStateWithLocations::GetFreecellCardNumber(), FCSStateWithLocations::GetStackLength(), FCSFreecellData::m_EmptyStacksFill, FCSFreecellData::m_NumberOfFreecells, FCSFreecellData::m_NumberOfStacks, FCSStateWithLocations::PopStackCard(), FCSMoveStack::Push(), FCSStateWithLocations::PutCardInFreecell(), FCSMove::SetDestFreecell(), FCSMove::SetSourceStack(), and FCSMove::SetType(). Referenced by RunTest(). |
|
Definition at line 62 of file FCSFreecellSolvingAlgorithm.cpp. References FCSCard::GetFlipped(), FCSStateWithLocations::GetStackCard(), FCSStateWithLocations::GetStackLength(), FCSCard::SetFlipped(), FCSMove::SetSourceStack(), and FCSMove::SetType(). Referenced by MoveNonTopStackCardsToFounds(), MoveSequencesToFreeStacks(), MoveStackCardsToDifferentStacks(), and MoveTopStackCardsToFounds(). |
|
|
Definition at line 1158 of file FCSFreecellSolvingAlgorithm.cpp. References FCSFreecellData::CheckStateBegin(), FCSFreecellData::CheckStateEnd(), FCSMove::Create(), CreateMoveStack(), FCSStateWithLocations::EmptyFreecell(), FCSCard::GetCardNumber(), FCSStateWithLocations::GetFreecellCard(), FCSStateWithLocations::GetStackLength(), FCSFreecellData::m_EmptyStacksFill, FCSFreecellData::m_NumberOfFreecells, FCSFreecellData::m_NumberOfStacks, FCSMoveStack::Push(), FCSStateWithLocations::PushCardIntoStack(), FCSMove::SetDestStack(), FCSMove::SetSourceFreecell(), and FCSMove::SetType(). Referenced by RunTest(). |
|
Definition at line 186 of file FCSFreecellSolvingAlgorithm.cpp. References FCSFreecellData::CheckStateBegin(), FCSFreecellData::CheckStateEnd(), FCSMove::Create(), CreateMoveStack(), FCSStateWithLocations::EmptyFreecell(), FCSCard::GetCardNumber(), FCSStateWithLocations::GetFoundation(), FCSStateWithLocations::GetFreecellCard(), FCSCard::GetSuit(), FCSStateWithLocations::IncrementFoundation(), FCSFreecellData::m_NumberOfDecks, FCSFreecellData::m_NumberOfFreecells, FCSMoveStack::Push(), FCSMove::SetFoundation(), FCSMove::SetSourceFreecell(), and FCSMove::SetType(). Referenced by RunTest(). |
|
Definition at line 241 of file FCSFreecellSolvingAlgorithm.cpp. References FCSFreecellData::CheckStateBegin(), FCSFreecellData::CheckStateEnd(), FCSMove::Create(), FCSCard::Create(), CreateMoveStack(), FCSStateWithLocations::EmptyFreecell(), FCSCard::GetCardNumber(), FCSStateWithLocations::GetFreecellCard(), FCSStateWithLocations::GetFreecellCardNumber(), FCSStateWithLocations::GetStackCard(), FCSStateWithLocations::GetStackLength(), FCSFreecellData::IsParentCard(), FCSFreecellData::m_EmptyStacksFill, FCSFreecellData::m_NumberOfFreecells, FCSFreecellData::m_NumberOfStacks, min, FCSStateWithLocations::PopStackCard(), FCSMoveStack::Push(), FCSStateWithLocations::PushCardIntoStack(), FCSStateWithLocations::PutCardInFreecell(), FCSMove::SetDestFreecell(), FCSMove::SetDestStack(), FCSMove::SetNumberOfCardsInSequence(), FCSMove::SetSourceFreecell(), FCSMove::SetSourceStack(), and FCSMove::SetType(). Referenced by RunTest(). |
|
Definition at line 382 of file FCSFreecellSolvingAlgorithm.cpp. References FCSFreecellData::CheckStateBegin(), FCSFreecellData::CheckStateEnd(), FCSMove::Create(), FCSCard::Create(), CreateMoveStack(), FlipTopCard(), FCSCard::GetCardNumber(), FCSStateWithLocations::GetFoundation(), FCSStateWithLocations::GetFreecellCardNumber(), FCSStateWithLocations::GetStackCard(), FCSStateWithLocations::GetStackLength(), FCSCard::GetSuit(), FCSStateWithLocations::IncrementFoundation(), FCSFreecellData::m_EmptyStacksFill, FCSFreecellData::m_NumberOfDecks, FCSFreecellData::m_NumberOfFreecells, FCSFreecellData::m_NumberOfStacks, min, FCSStateWithLocations::PopStackCard(), FCSMoveStack::Push(), FCSStateWithLocations::PushCardIntoStack(), FCSStateWithLocations::PutCardInFreecell(), FCSMove::SetDestFreecell(), FCSMove::SetDestStack(), FCSMove::SetFoundation(), FCSMove::SetNumberOfCardsInSequence(), FCSMove::SetSourceStack(), and FCSMove::SetType(). Referenced by FCSTalonSolvingAlgorithm::RunTest(), and RunTest(). |
|
Definition at line 963 of file FCSFreecellSolvingAlgorithm.cpp. References FCSFreecellData::CalculateMaxSequenceMoves(), FCSFreecellData::CheckStateBegin(), FCSFreecellData::CheckStateEnd(), FCSMove::Create(), FCSCard::Create(), CreateMoveStack(), FlipTopCard(), FCSCard::GetCardNumber(), FCSStateWithLocations::GetFreecellCardNumber(), FCSStateWithLocations::GetStackCard(), FCSStateWithLocations::GetStackCardNumber(), FCSStateWithLocations::GetStackLength(), FCSFreecellData::IsParentCard(), FCSFreecellData::m_EmptyStacksFill, FCSFreecellData::m_NumberOfFreecells, FCSFreecellData::m_NumberOfStacks, min, FCSStateWithLocations::PopStackCard(), FCSMoveStack::Push(), FCSStateWithLocations::PushCardIntoStack(), FCSStateWithLocations::PushStackCardIntoStack(), FCSStateWithLocations::PutCardInFreecell(), FCSMove::SetDestFreecell(), FCSMove::SetDestStack(), FCSMove::SetNumberOfCardsInSequence(), FCSMove::SetSourceStack(), and FCSMove::SetType(). Referenced by FCSTalonSolvingAlgorithm::RunTest(), and RunTest(). |
|
Definition at line 696 of file FCSFreecellSolvingAlgorithm.cpp. References FCSFreecellData::CheckStateBegin(), FCSFreecellData::CheckStateEnd(), FCSCard::Copy(), FCSMove::Create(), FCSCard::Create(), CreateMoveStack(), FCSStateWithLocations::EmptyFreecell(), FCSCard::GetCardNumber(), FCSStateWithLocations::GetFreecellCard(), FCSStateWithLocations::GetFreecellCardNumber(), FCSStateWithLocations::GetStackCard(), FCSStateWithLocations::GetStackLength(), FCSCard::GetSuit(), FCSFreecellData::IsParentCard(), FCSFreecellData::m_EmptyStacksFill, FCSFreecellData::m_NumberOfFreecells, FCSFreecellData::m_NumberOfStacks, min, FCSStateWithLocations::PopStackCard(), FCSMoveStack::Push(), FCSStateWithLocations::PushCardIntoStack(), FCSStateWithLocations::PutCardInFreecell(), FCSMove::SetDestFreecell(), FCSMove::SetDestStack(), FCSMove::SetNumberOfCardsInSequence(), FCSMove::SetSourceFreecell(), FCSMove::SetSourceStack(), and FCSMove::SetType(). Referenced by FCSTalonSolvingAlgorithm::RunTest(), and RunTest(). |
|
Definition at line 504 of file FCSFreecellSolvingAlgorithm.cpp. References FCSFreecellData::CalculateMaxSequenceMoves(), FCSFreecellData::CheckStateBegin(), FCSFreecellData::CheckStateEnd(), FCSMove::Create(), FCSCard::Create(), CreateMoveStack(), FlipTopCard(), FCSCard::GetFlipped(), FCSStateWithLocations::GetFreecellCardNumber(), FCSStateWithLocations::GetStackCard(), FCSStateWithLocations::GetStackLength(), FCSFreecellData::IsParentCard(), FCSFreecellData::m_EmptyStacksFill, FCSFreecellData::m_NumberOfFreecells, FCSFreecellData::m_NumberOfStacks, min, FCSStateWithLocations::PopStackCard(), FCSMoveStack::Push(), FCSStateWithLocations::PushCardIntoStack(), FCSStateWithLocations::PushStackCardIntoStack(), FCSStateWithLocations::PutCardInFreecell(), FCSMove::SetDestFreecell(), FCSMove::SetDestStack(), FCSMove::SetNumberOfCardsInSequence(), FCSMove::SetSourceStack(), and FCSMove::SetType(). Referenced by FCSTalonSolvingAlgorithm::RunTest(), and RunTest(). |
|
Definition at line 119 of file FCSFreecellSolvingAlgorithm.cpp. References FCSFreecellData::CheckStateBegin(), FCSFreecellData::CheckStateEnd(), FCSMove::Create(), FCSCard::Create(), CreateMoveStack(), FlipTopCard(), FCSCard::GetCardNumber(), FCSStateWithLocations::GetFoundation(), FCSStateWithLocations::GetStackCard(), FCSStateWithLocations::GetStackLength(), FCSCard::GetSuit(), FCSStateWithLocations::IncrementFoundation(), FCSFreecellData::m_NumberOfDecks, FCSFreecellData::m_NumberOfStacks, FCSStateWithLocations::PopStackCard(), FCSMoveStack::Push(), FCSMove::SetFoundation(), FCSMove::SetSourceStack(), and FCSMove::SetType(). Referenced by FCSTalonSolvingAlgorithm::RunTest(), and RunTest(). |
|
Implements FCSFreecellAlgorithm. Reimplemented in FCSTalonSolvingAlgorithm. Definition at line 77 of file FCSFreecellSolvingAlgorithm.cpp. References EmptyStackIntoFreecells(), MoveCardsToADifferentParent(), MoveFreecellCardsToEmptyStack(), MoveFreecellCardsToFounds(), MoveFreecellCardsToTopOfStacks(), MoveNonTopStackCardsToFounds(), MoveSequencesToFreeStacks(), MoveStackCardsToAParentOnTheSameStack(), MoveStackCardsToDifferentStacks(), and MoveTopStackCardsToFounds(). |