Show / Hide Table of Contents

Interface IHeuristic

Performs some logical trickery to reduce the number of possible values for a square. Unlike an IRule, this depends on the current possible values in the puzzle, not just the currently set values.

Namespace: SudokuSpice.RuleBased.Heuristics
Assembly: SudokuSpice.dll
Syntax
public interface IHeuristic

Methods

| Improve this Doc View Source

CopyWithNewReferences(IReadOnlyPuzzleWithMutablePossibleValues, ReadOnlySpan<IRule>)

Creates a deep copy of this heuristic, replacing internal references with the ones provided. These references may or may not be used during the copy, depending on the implementation of the heuristic.

Declaration
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
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
void UndoLastUpdate()
| Improve this Doc View Source

UpdateAll()

Updates all the current possible values.

Declaration
bool UpdateAll()
Returns
Type Description
System.Boolean

Returns true if any modifications were made.

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