Show / Hide Table of Contents

Class StandardHeuristic

Provides the standard UniqueIn* heuristics.

Inheritance
System.Object
StandardHeuristic
Implements
IHeuristic
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: SudokuSpice.RuleBased.Heuristics
Assembly: SudokuSpice.dll
Syntax
public class StandardHeuristic : IHeuristic

Constructors

| Improve this Doc View Source

StandardHeuristic(IMissingRowValuesTracker, IMissingColumnValuesTracker, IMissingBoxValuesTracker)

Creates a standard heuristic that combines the UniqueInRowHeuristic, UniqueInColumnHeuristic, and UniqueInBoxHeuristic.

Declaration
public StandardHeuristic(IMissingRowValuesTracker rowValuesTracker, IMissingColumnValuesTracker columnValuesTracker, IMissingBoxValuesTracker boxValuesTracker)
Parameters
Type Name Description
IMissingRowValuesTracker rowValuesTracker

Something that tracks the possible values for each row.

IMissingColumnValuesTracker columnValuesTracker

Something that tracks the possible values for each column.

IMissingBoxValuesTracker boxValuesTracker

Something that tracks the possible values for each box.

Methods

| Improve this Doc View Source

CopyWithNewReferences(IReadOnlyPuzzleWithMutablePossibleValues, ReadOnlySpan<IRule>)

Creates a deep copy of this heuristic. Requires rules to contain an IMissingBoxValuesTracker, an IMissingColumnValuesTracker, and an IMissingRowValuesTracker.

Declaration
public IHeuristic CopyWithNewReferences(IReadOnlyPuzzleWithMutablePossibleValues puzzle, ReadOnlySpan<IRule> rules)
Parameters
Type Name Description
IReadOnlyPuzzleWithMutablePossibleValues puzzle
System.ReadOnlySpan<IRule> rules
Returns
Type Description
IHeuristic
| Improve this Doc View Source

TryInitFor(IReadOnlyPuzzleWithMutablePossibleValues)

Tries to initialize this heuristic for solving the given puzzle.

Declaration
public bool TryInitFor(IReadOnlyPuzzleWithMutablePossibleValues puzzle)
Parameters
Type Name Description
IReadOnlyPuzzleWithMutablePossibleValues puzzle

The puzzle to solve.

Returns
Type Description
System.Boolean

False if this heuristic cannot be initialized for the given puzzle, else true.

Remarks

In general, it doesn't make sense to want to maintain the previous state if this method fails. Therefore, it is not guaranteed that the heuristic's state is unchanged on failure.

| Improve this Doc View Source

UndoLastUpdate()

Undoes the last modifications made by this heuristic.

Declaration
public void UndoLastUpdate()
| Improve this Doc View Source

UpdateAll()

Updates all the current possible values.

Declaration
public bool UpdateAll()
Returns
Type Description
System.Boolean

Returns true if any modifications were made.

Implements

IHeuristic
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX