Show / Hide Table of Contents

Class Objective

A required objective in the ExactCoverGraph. This enforces that one or more IPossibilitys must be selected.

Inheritance
System.Object
Objective
Implements
IObjective
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.ConstraintBased
Assembly: SudokuSpice.dll
Syntax
public sealed class Objective : IObjective

Properties

| Improve this Doc View Source

State

The current state of this node in the ExactCoverGraph.

Declaration
public NodeState State { get; }
Property Value
Type Description
NodeState

Methods

| Improve this Doc View Source

CreateFullyConnected(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 countToSatisfy is less than 1 or is impossible with the given number of possibilities.

| Improve this Doc View Source

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 countToSatisfy is less than 1 or is impossible with the given number of possibilities.

| Improve this Doc View Source

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>

Implements

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