Class Descriptor
Class intended to provide the grounding for describing a puzzle's logic by abstractly implementing the IDescriptor interface. It is recommended that custom puzzle descriptors inherit from this class.
Implements
Namespace: TreeProblemFramework.Description
Constructors
Descriptor()
Initializes a new instance of the Descriptor class.
Declaration
protected Descriptor()
Properties
Transformations
Gets the set of ITransformation objects which are to be executed on the IEntity objects of a given IEnvironment object.
Declaration
public TransformationCollection Transformations { get; }
Property Value
| Type | Description |
|---|---|
| TransformationCollection | An automatically initialized instance of the TransformationCollection class. |
Remarks
This property's value is automatically initialized by the Descriptor class' constructor.
Methods
RetrieveNextEntities(IEnvironment)
Method that iteratively yields the first/next set of IEntity objects on which transformations are to be executed.
Declaration
public abstract IEnumerable<EntityCollection> RetrieveNextEntities(IEnvironment env)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnvironment | env | The specified IEnvironment form which to yield sets of IEntity objects. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<EntityCollection> | An enumerator of EntityCollection on whose elements transformations are to be executed. |
Remarks
See the RetrieveNextEntities(IEnvironment) method for details.
ValidateSolution(IEnvironment, Double)
Method that validates whether a given IEnvironment object either meets the constraints required to be considered as a solution to the puzzle, or is in fact equal or equivalent to a previously defined solution IEnvironment object.
Declaration
public abstract bool ValidateSolution(IEnvironment env, double heuristicValue)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnvironment | env | The specified IEnvironment whose correspondence to the solution to the puzzle is to be determined. |
| System.Double | heuristicValue | The heuristic value directly calculated from the specified IEnvironment object, which provides an insight on how far or close such IEnvironment object is to an actual solution to the puzzle. Such value is the result returned by the ComputeHeuristic(IEnvironment) method. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the specified IEnvironment object corresponds to a solution to the puzzle; false if it does not. |
Remarks
See the ValidateSolution(IEnvironment, Double) method for details.