Class Objective
A required objective in the ExactCoverGraph. This enforces that one or more IPossibilitys must be selected.
Inheritance
Implements
Inherited Members
Namespace: SudokuSpice.ConstraintBased
Assembly: SudokuSpice.dll
Syntax
public sealed class Objective : IObjective
Properties
| Improve this Doc View SourceState
The current state of this node in the ExactCoverGraph.
Declaration
public NodeState State { get; }
Property Value
| Type | Description |
|---|---|
| NodeState |
Methods
| Improve this Doc View SourceCreateFullyConnected(ExactCoverGraph, ReadOnlySpan<IPossibility>, Int32)
Constructs an objective that's fully connected to the given
possibilities and into the given graph.
Declaration
public static Objective CreateFullyConnected(ExactCoverGraph graph, ReadOnlySpan<IPossibility> possibilities, int countToSatisfy)
Parameters
| Type | Name | Description |
|---|---|---|
| ExactCoverGraph | graph | The graph to attach this to. |
| System.ReadOnlySpan<IPossibility> | possibilities | The possibilities that could satisfy this objective. |
| System.Int32 | countToSatisfy | The number of possibilities that must be satisfied in order to satisfy this objective. Once this number of possibilities are selected, all other possibilities on this objective will be dropped. |
Returns
| Type | Description |
|---|---|
| Objective | The newly constructed objective. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | If the |
CreateFullyConnected(ExactCoverGraph, ReadOnlySpan<Possibility>, Int32)
Constructs an objective that's fully connected to the given
possibilities and into the given graph.
Declaration
public static Objective CreateFullyConnected(ExactCoverGraph graph, ReadOnlySpan<Possibility> possibilities, int countToSatisfy)
Parameters
| Type | Name | Description |
|---|---|---|
| ExactCoverGraph | graph | The graph to attach this to. |
| System.ReadOnlySpan<Possibility> | possibilities | The possibilities that could satisfy this objective. |
| System.Int32 | countToSatisfy | The number of possibilities that must be satisfied in order to satisfy this objective. Once this number of possibilities are selected, all other possibilities on this objective will be dropped. |
Returns
| Type | Description |
|---|---|
| Objective | The newly constructed objective. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | If the |
GetUnknownDirectPossibilities()
Retrieves any possibilities that are direct descendents of this objective and whose states are unknown.
Declaration
public IEnumerable<IPossibility> GetUnknownDirectPossibilities()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IPossibility> |