Show / Hide Table of Contents

Interface ISolver

Interface that defines the basic members that a class should implement in order to search for a solution to a puzzle, regardless of puzzle's description or search parameters.

Namespace: TreeProblemFramework.Solver

Properties

Descriptor

Gets the object that contains the description of the puzzle whose solution is to be found.

Declaration
IDescriptor Descriptor { get; }
Property Value
Type Description
IDescriptor

An object that implements the IDescriptor interface.

Parameters

Gets the object that defines which parameters are to be used in order to perform the search for a solution to the puzzle.

Declaration
IParameters Parameters { get; }
Property Value
Type Description
IParameters

An object that implements the IParameters interface.

Methods

FindAllSolutions(IEnvironment)

Method that searches for all possible solutions to the puzzle according to its description and the provided parameters.

Declaration
IEnumerable<Solution> FindAllSolutions(IEnvironment initialEnvironment)
Parameters
Type Name Description
IEnvironment initialEnvironment

The environment from which to begin the search.

Returns
Type Description
System.Collections.Generic.IEnumerable<Solution>

An enumerator that yields each solution as it is found.

FindAllSolutionsAsync(IEnvironment)

Asynchronous method that searches for all possible solutions to the puzzle according to its description and the provided parameters.

Declaration
IAsyncEnumerable<Solution> FindAllSolutionsAsync(IEnvironment initialEnvironment)
Parameters
Type Name Description
IEnvironment initialEnvironment

The environment from which to begin the search.

Returns
Type Description
System.Collections.Generic.IAsyncEnumerable<Solution>

An asynchronous enumerator that yields each solution as it is found.

FindOneSolution(IEnvironment)

Method that searches for one (first) solution to the puzzle according to its description and the provided parameters.

Declaration
Solution FindOneSolution(IEnvironment initialEnvironment)
Parameters
Type Name Description
IEnvironment initialEnvironment

The environment from which to begin the search.

Returns
Type Description
Solution

The one solution found.

FindOneSolutionAsync(IEnvironment)

Asynchronous method that searches for one (first) solution to the puzzle according to its description and the provided parameters.

Declaration
Task<Solution> FindOneSolutionAsync(IEnvironment initialEnvironment)
Parameters
Type Name Description
IEnvironment initialEnvironment

The environment from which to begin the search.

Returns
Type Description
System.Threading.Tasks.Task<Solution>

An asynchronous result that yields the one solution found.

FindSingleSolution(IEnvironment)

Method that searches for a single solution to the puzzle according to its description and the provided parameters, and asserts there is no other solution.

Declaration
Solution FindSingleSolution(IEnvironment initialEnvironment)
Parameters
Type Name Description
IEnvironment initialEnvironment

The environment from which to begin the search.

Returns
Type Description
Solution

The single solution found.

FindSingleSolutionAsync(IEnvironment)

Asynchronous method that searches for a single solution to the puzzle according to its description and the provided parameters, and asserts there is no other solution.

Declaration
Task<Solution> FindSingleSolutionAsync(IEnvironment initialEnvironment)
Parameters
Type Name Description
IEnvironment initialEnvironment

The environment from which to begin the search.

Returns
Type Description
System.Threading.Tasks.Task<Solution>

An asynchronous result that yields the single solution found.

Back to top TreeProblemFramework from Ecuador.