#include <FCState.h>
Inheritance diagram for FCSStateWithLocations:
Public Member Functions | |
virtual | ~FCSStateWithLocations () |
Destructor. | |
virtual void | Copy (FCSStateWithLocations *State) |
Copy StateWithLocations object. | |
virtual int | Compare (const FCSStateWithLocations *State)=0 |
Compare a FCSStateWithLocations to another. | |
virtual void | StateAsString (char *String, FCSDebugDisplayInfo *DebugInfo) |
Represent a FCSStateWithLocations object as a string. | |
virtual int | CheckStateValidity (int NumberOfFreecells, int NumberOfStacks, int NumberOfDecks, FCSCard **MisplacedCard, FCSTalonType TalonType) |
Validiate that this state is valid. | |
virtual FCSCard * | GetStackCard (int Stack, int Card)=0 |
Get a card from the state. | |
virtual char | GetStackCardSuit (int Stack, int Card)=0 |
Get a suit from a card in the state. | |
virtual char | GetStackCardNumber (int Stack, int Card)=0 |
Get a card number from a card in the state. | |
virtual int | GetStackLength (int Stack)=0 |
Get the number of cards in the stack. | |
virtual FCSCard * | GetFreecellCard (int Freecell)=0 |
Get a freecell card from the state. | |
virtual char | GetFreecellCardSuit (int Freecell)=0 |
Get a suit from a freecell card in the state. | |
virtual char | GetFreecellCardNumber (int Freecell)=0 |
Get a card number from a freecell card in the state. | |
virtual char | GetFoundation (int Foundation)=0 |
Get a card number from a foundation in the state. | |
virtual void | IncrementFoundation (int Foundation)=0 |
Add the next card to a foundation in the state. | |
virtual void | SetFoundation (int Foundation, char Value)=0 |
Put a card into a foundation in the state. | |
virtual void | PopStackCard (int Stack, FCSCard *Card)=0 |
Take a card off a stack in the state. | |
virtual void | PushStackCardIntoStack (int DestStack, int SrcStack, int SrcCard)=0 |
Move a card from one stack to another. | |
virtual void | PushCardIntoStack (int DestStack, FCSCard *Card)=0 |
Move a card onto a stack. | |
virtual void | PutCardInFreecell (int Freecell, FCSCard *Card)=0 |
Move a card onto a freecll. | |
virtual void | EmptyFreecell (int Freecell)=0 |
Clear a freecell. | |
virtual void | FlipStackCard (int Stack, int Card)=0 |
Make a stack card flipped over (visible). | |
virtual void | CleanState () |
Clear the state of data. | |
virtual void | CacheStacks (AFCSGenericStackStorage *Storage, int StackNumber) |
Cache the stacks of the state. | |
virtual void | Initialize (int NumberOfStacks) |
Initialize the state of stacks (and talons if applicable). | |
virtual void | CanonizeState (int NumberOfFreecells, int NumberOfStacks)=0 |
Canonize the state - put it into the internal representation. | |
virtual FCSState * | GetState ()=0 |
Get a pointer to the state. | |
Static Public Member Functions | |
static FCSStateWithLocations * | CreateInitialState (const char *String, int NumberOfFreecells, int NumberOfStacks, int NumberOfDecks) |
Convert a string representation of a state into a FCSStateWithLocations object. | |
Public Attributes | |
FCSStateWithLocations * | m_Parent |
State of game before this state. | |
FCSMoveStack * | m_MovesToParent |
How to arrive at this state from parent. | |
int | m_Depth |
Number of states in the path to this state. | |
int | m_Visited |
How this state has been visited. | |
int | m_VisitIterations |
Number of states looked through so far. | |
char | m_StackLocations [MAX_NUM_STACKS] |
Canonized location of the stacks of cards. | |
char | m_FreecellLocations [MAX_NUM_FREECELLS] |
Canonized location of the freecell cards. | |
Protected Member Functions | |
FCSStateWithLocations () | |
Constructor. |
Definition at line 42 of file FCState.h.
|
This is only implemented in the indirect state classes Reimplemented in FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Definition at line 510 of file FCState.cpp. Referenced by FCSTalonSolvingAlgorithm::CheckAndAddState(), and FCSFreecellData::CheckAndAddState(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by ApplyMove(), FCSTalonSolvingAlgorithm::CheckAndAddState(), FCSFreecellData::CheckAndAddState(), main(), and TestEachGame(). |
|
Reimplemented in FCSTalonStateWithLocations. Definition at line 278 of file FCState.cpp. References FCSCard::Create(), GetFoundation(), GetFreecellCardNumber(), GetFreecellCardSuit(), GetStackCardNumber(), GetStackCardSuit(), and GetStackLength(). Referenced by FCSDebugDisplayInfo::Display(), and FCCommandLineArguments::Verify(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. |
|
Reimplemented in FCSIndirectTalonStateWithLocations, FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Definition at line 73 of file FCState.cpp. References m_Depth, m_FreecellLocations, m_MovesToParent, m_Parent, m_StackLocations, m_Visited, and m_VisitIterations. Referenced by main(), FCSMoveStack::Normalize(), TestEachGame(), and FCSFreecellData::TraceSolution(). |
|
Definition at line 84 of file FCState.cpp. References FCSCard::Create(), CreateStateWithLocations(), FCSCard::EmptyCard(), EmptyFreecell(), FoundationsPrefixes, FreecellsPrefixes, Initialize(), PushCardIntoStack(), PutCardInFreecell(), SetFoundation(), FCSCard::User2Perl(), FCSCard::User2PerlCardNumber(), and FCSCard::User2PerlSuit(). Referenced by CreateInitialState(). |
|
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by ApplyMove(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by FCSAStarSolvingAlgorithm< SolvingAlgorithmType >::AStarRateState(), FCSTalonStateWithLocations::CheckStateValidity(), CheckStateValidity(), FCSTalonSolvingAlgorithm::GetCardFromKlondikeTalon(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToFounds(), FCSFreecellSolvingAlgorithm::MoveNonTopStackCardsToFounds(), FCSFreecellSolvingAlgorithm::MoveTopStackCardsToFounds(), FCSTalonStateWithLocations::StateAsString(), and StateAsString(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by ApplyMove(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToEmptyStack(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToFounds(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToTopOfStacks(), FCSFreecellSolvingAlgorithm::MoveStackCardsToAParentOnTheSameStack(), FCSTalonStateWithLocations::StateAsString(), and StateAsString(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by FCSAStarSolvingAlgorithm< SolvingAlgorithmType >::AStarRateState(), FCSTalonStateWithLocations::CheckStateValidity(), CheckStateValidity(), FCSFreecellSolvingAlgorithm::EmptyStackIntoFreecells(), FCSFreecellSolvingAlgorithm::MoveCardsToADifferentParent(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToTopOfStacks(), FCSFreecellSolvingAlgorithm::MoveNonTopStackCardsToFounds(), FCSFreecellSolvingAlgorithm::MoveSequencesToFreeStacks(), FCSFreecellSolvingAlgorithm::MoveStackCardsToAParentOnTheSameStack(), FCSFreecellSolvingAlgorithm::MoveStackCardsToDifferentStacks(), FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::Resume(), FCSAStarSolvingAlgorithm< SolvingAlgorithmType >::Resume(), FCSOptimizeSolvingAlgorithm< SolvingAlgorithmType >::Solve(), FCSDFSSolvingAlgorithm< SolvingAlgorithmType >::Solve(), FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::Solve(), FCSAStarSolvingAlgorithm< SolvingAlgorithmType >::Solve(), FCSSoftDFSSolvingAlgorithm< SolvingAlgorithmType >::SolveOrResume(), and FCSRandomDFSSolvingAlgorithm< SolvingAlgorithmType >::SolveOrResume(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by FCSTalonStateWithLocations::CheckStateValidity(), and CheckStateValidity(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by FCSAStarSolvingAlgorithm< SolvingAlgorithmType >::AStarRateState(), FCSFreecellSolvingAlgorithm::FlipTopCard(), FCSTalonSolvingAlgorithm::GetCardFromKlondikeTalon(), FCSAStarSolvingAlgorithm< SolvingAlgorithmType >::InitAStar(), FCSFreecellSolvingAlgorithm::MoveCardsToADifferentParent(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToTopOfStacks(), FCSFreecellSolvingAlgorithm::MoveNonTopStackCardsToFounds(), FCSFreecellSolvingAlgorithm::MoveSequencesToFreeStacks(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToFalseParent(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToFounds(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToParentOnTheSameStack(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToTrueParent(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToTrueParentWithSomeCardsAbove(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceWithJunkSequenceAboveToTrueParentWithSomeCardsAbove(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceWithSomeCardsAboveToTrueParent(), FCSFreecellSolvingAlgorithm::MoveStackCardsToAParentOnTheSameStack(), FCSFreecellSolvingAlgorithm::MoveStackCardsToDifferentStacks(), FCSFreecellSolvingAlgorithm::MoveTopStackCardsToFounds(), FCSSimpleSimonSolvingAlgorithm::MoveWholeStackSequenceToFalseParent(), FCSSimpleSimonSolvingAlgorithm::MoveWholeStackSequenceToFalseParentWithSomeCardsAbove(), FCSTalonStateWithLocations::StateAsString(), and StateAsString(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by FCSTalonStateWithLocations::CheckStateValidity(), CheckStateValidity(), and FCSFreecellSolvingAlgorithm::MoveSequencesToFreeStacks(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by FCSTalonStateWithLocations::CheckStateValidity(), and CheckStateValidity(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by ApplyMove(), FCSAStarSolvingAlgorithm< SolvingAlgorithmType >::AStarRateState(), FCSTalonStateWithLocations::CheckStateValidity(), CheckStateValidity(), FCSFreecellSolvingAlgorithm::EmptyStackIntoFreecells(), FCSFreecellSolvingAlgorithm::FlipTopCard(), FCSTalonSolvingAlgorithm::GetCardFromKlondikeTalon(), FCSAStarSolvingAlgorithm< SolvingAlgorithmType >::InitAStar(), FCSFreecellSolvingAlgorithm::MoveCardsToADifferentParent(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToEmptyStack(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToTopOfStacks(), FCSFreecellSolvingAlgorithm::MoveNonTopStackCardsToFounds(), FCSFreecellSolvingAlgorithm::MoveSequencesToFreeStacks(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToFalseParent(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToFounds(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToParentOnTheSameStack(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToTrueParent(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToTrueParentWithSomeCardsAbove(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceWithJunkSequenceAboveToTrueParentWithSomeCardsAbove(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceWithSomeCardsAboveToTrueParent(), FCSFreecellSolvingAlgorithm::MoveStackCardsToAParentOnTheSameStack(), FCSFreecellSolvingAlgorithm::MoveStackCardsToDifferentStacks(), FCSFreecellSolvingAlgorithm::MoveTopStackCardsToFounds(), FCSSimpleSimonSolvingAlgorithm::MoveWholeStackSequenceToFalseParent(), FCSSimpleSimonSolvingAlgorithm::MoveWholeStackSequenceToFalseParentWithSomeCardsAbove(), FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::Resume(), FCSAStarSolvingAlgorithm< SolvingAlgorithmType >::Resume(), FCSOptimizeSolvingAlgorithm< SolvingAlgorithmType >::Solve(), FCSDFSSolvingAlgorithm< SolvingAlgorithmType >::Solve(), FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::Solve(), FCSAStarSolvingAlgorithm< SolvingAlgorithmType >::Solve(), FCSSoftDFSSolvingAlgorithm< SolvingAlgorithmType >::SolveOrResume(), FCSRandomDFSSolvingAlgorithm< SolvingAlgorithmType >::SolveOrResume(), FCSTalonStateWithLocations::StateAsString(), and StateAsString(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by ApplyMove(), FCSTalonSolvingAlgorithm::GetCardFromKlondikeTalon(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToFounds(), FCSFreecellSolvingAlgorithm::MoveNonTopStackCardsToFounds(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToFounds(), and FCSFreecellSolvingAlgorithm::MoveTopStackCardsToFounds(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by ApplyMove(), FCSFreecellSolvingAlgorithm::EmptyStackIntoFreecells(), FCSFreecellSolvingAlgorithm::MoveCardsToADifferentParent(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToTopOfStacks(), FCSFreecellSolvingAlgorithm::MoveNonTopStackCardsToFounds(), FCSFreecellData::MoveSequence(), FCSFreecellSolvingAlgorithm::MoveSequencesToFreeStacks(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToFounds(), FCSFreecellSolvingAlgorithm::MoveStackCardsToAParentOnTheSameStack(), FCSFreecellSolvingAlgorithm::MoveStackCardsToDifferentStacks(), and FCSFreecellSolvingAlgorithm::MoveTopStackCardsToFounds(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by ApplyMove(), FCSTalonStateWithLocations::CreateInitialState(), CreateInitialState(), FCSTalonSolvingAlgorithm::GetCardFromKlondikeTalon(), FCSFreecellSolvingAlgorithm::MoveCardsToADifferentParent(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToEmptyStack(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToTopOfStacks(), FCSFreecellSolvingAlgorithm::MoveNonTopStackCardsToFounds(), FCSFreecellSolvingAlgorithm::MoveSequencesToFreeStacks(), FCSFreecellSolvingAlgorithm::MoveStackCardsToAParentOnTheSameStack(), and FCSFreecellSolvingAlgorithm::MoveStackCardsToDifferentStacks(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by ApplyMove(), FCSFreecellSolvingAlgorithm::MoveCardsToADifferentParent(), FCSFreecellData::MoveSequence(), FCSFreecellSolvingAlgorithm::MoveSequencesToFreeStacks(), and FCSFreecellSolvingAlgorithm::MoveStackCardsToDifferentStacks(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by ApplyMove(), FCSTalonStateWithLocations::CreateInitialState(), CreateInitialState(), FCSFreecellSolvingAlgorithm::EmptyStackIntoFreecells(), FCSFreecellSolvingAlgorithm::MoveCardsToADifferentParent(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToTopOfStacks(), FCSFreecellSolvingAlgorithm::MoveNonTopStackCardsToFounds(), FCSFreecellSolvingAlgorithm::MoveSequencesToFreeStacks(), FCSFreecellSolvingAlgorithm::MoveStackCardsToAParentOnTheSameStack(), and FCSFreecellSolvingAlgorithm::MoveStackCardsToDifferentStacks(). |
|
Implemented in FCSCompactStateWithLocations< FCSTalonStateWithLocations >, FCSDebugStateWithLocations< FCSTalonStateWithLocations >, FCSIndirectStateWithLocations< FCSTalonStateWithLocations >, and FCSIndirectStateWithLocations< FCSStateWithLocations >. Referenced by FCSTalonStateWithLocations::CreateInitialState(), and CreateInitialState(). |
|
Reimplemented in FCSTalonStateWithLocations. Definition at line 332 of file FCState.cpp. References DEBUG_CANONIZED_ORDER_OUTPUT, DEBUG_DISPLAY_10_AS_T, DEBUG_IS_OUTPUT_PARSEABLE, GetFoundation(), GetFreecellCard(), GetStackCard(), GetStackLength(), FCSDebugDisplayInfo::m_DisplayDebug, FCSDebugDisplayInfo::m_DisplayDebugOptions, m_FreecellLocations, FCSDebugDisplayInfo::m_NumberOfDecks, FCSDebugDisplayInfo::m_NumberOfFreecells, FCSDebugDisplayInfo::m_NumberOfStacks, m_StackLocations, min, FCSCard::Perl2User(), and FCSCard::Perl2UserCardNumber(). Referenced by FCSDebugDisplayInfo::Display(), and FCSFreecellData::ShowSolution(). |