Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

FCSBFSSolvingAlgorithm< SolvingAlgorithmType > Class Template Reference

Breadth First Search method solver.

#include <FCSBFSSolvingAlgorithm.h>

Inheritance diagram for FCSBFSSolvingAlgorithm< SolvingAlgorithmType >:

FCSOptimizeSolvingAlgorithm< SolvingAlgorithmType > List of all members.

Public Member Functions

 FCSBFSSolvingAlgorithm (FCCommandLineArguments *CommandLine)
 Constructor with command line interface.
virtual ~FCSBFSSolvingAlgorithm ()
 Destructor.
virtual FCSStateSolvingReturnCodes Solve (FCSStateWithLocations *StateWithLocations, int Depth)
 Solve the game.
virtual FCSStateSolvingReturnCodes Resume (int Depth)
 Resume solving a game.

Protected Member Functions

 FCSBFSSolvingAlgorithm ()
 Default constructor.
void InitFCSBFSSolvingAlgorithm ()
 The "real" default constructor.
void BFSEnqueueState (FCSStateWithLocations *StateWithLocations)
 Initialize the BFS Queue.

Protected Attributes

FCSStateWithLocationsLinkedListm_BFSQueue
 BFS queue.
FCSStateWithLocationsLinkedListm_BFSQueueLastItem
 Last item in the queue.
FCSStateWithLocationsm_FirstStateToCheck
 Saved state for when bfs scan is resumed.

Detailed Description

template<class SolvingAlgorithmType>
class FCSBFSSolvingAlgorithm< SolvingAlgorithmType >

Definition at line 18 of file FCSBFSSolvingAlgorithm.h.


Member Function Documentation

template<class SolvingAlgorithmType>
void FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::BFSEnqueueState FCSStateWithLocations StateWithLocations  )  [protected]
 

Parameters:
StateWithLocations is the start state

Definition at line 304 of file FCSBFSSolvingAlgorithm.h.

References FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::m_BFSQueueLastItem, FCSStateWithLocationsLinkedList::m_Next, and FCSStateWithLocationsLinkedList::m_State.

Referenced by FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::Resume(), FCSOptimizeSolvingAlgorithm< SolvingAlgorithmType >::Solve(), and FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::Solve().

template<class SolvingAlgorithmType>
FCSStateSolvingReturnCodes FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::Resume int  Depth  )  [virtual]
 

Parameters:
Depth to continue at depth
Returns:
Solving return code

Reimplemented in FCSOptimizeSolvingAlgorithm< SolvingAlgorithmType >.

Definition at line 212 of file FCSBFSSolvingAlgorithm.h.

References FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::BFSEnqueueState(), FCSStateWithLocations::GetFreecellCardNumber(), FCSStateWithLocations::GetStackLength(), FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::m_BFSQueue, FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::m_BFSQueueLastItem, FCSStateWithLocations::m_Depth, FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::m_FirstStateToCheck, FCSStateWithLocationsLinkedList::m_Next, FCSDerivedStatesList::m_NumberOfStates, FCSStateWithLocationsLinkedList::m_State, FCSDerivedStatesList::m_States, FCSStateWithLocations::m_Visited, and FCSStateWithLocations::m_VisitIterations.

template<class SolvingAlgorithmType>
FCSStateSolvingReturnCodes FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::Solve FCSStateWithLocations StateWithLocations,
int  Depth
[virtual]
 

Parameters:
StateWithLocations is the start state
Depth is the starting depth
Returns:
Solving return code

Reimplemented in FCSOptimizeSolvingAlgorithm< SolvingAlgorithmType >.

Definition at line 103 of file FCSBFSSolvingAlgorithm.h.

References FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::BFSEnqueueState(), FCSStateWithLocations::GetFreecellCardNumber(), FCSStateWithLocations::GetStackLength(), FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::m_BFSQueue, FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::m_BFSQueueLastItem, FCSStateWithLocations::m_Depth, FCSBFSSolvingAlgorithm< SolvingAlgorithmType >::m_FirstStateToCheck, FCSStateWithLocations::m_MovesToParent, FCSStateWithLocationsLinkedList::m_Next, FCSDerivedStatesList::m_NumberOfStates, FCSStateWithLocations::m_Parent, FCSStateWithLocationsLinkedList::m_State, FCSDerivedStatesList::m_States, FCSStateWithLocations::m_Visited, and FCSStateWithLocations::m_VisitIterations.


The documentation for this class was generated from the following file:
Generated on Sat Nov 5 11:20:17 2005 for Cpp Freecell Solver by  doxygen 1.4.4