Show / Hide Table of Contents

Class StandaloneDescriptor

Class that inherits from Descriptor to describe a puzzle's logic through delegate properties called by the base class' overridden methods. Its purpose is to provide a convenient way for describing a puzzle's logic without creating custom classes.

Inheritance
System.Object
Descriptor
StandaloneDescriptor
Implements
IDescriptor
Inherited Members
Descriptor.Transformations
Namespace: TreeProblemFramework.Description

Properties

EntityRetriever

Gets or sets the delegate function that iteratively yields the first/next set of IEntity objects on which transformations are to be executed.

Declaration
public EntityRetriever EntityRetriever { get; set; }
Property Value
Type Description
EntityRetriever

An instance of the EntityRetriever delegate.

EnvironmentValidator

Gets or sets the delegate function that validates whether a given IEnvironment corresponds to the solution to a puzzle.

Declaration
public EnvironmentValidator EnvironmentValidator { get; set; }
Property Value
Type Description
EnvironmentValidator

An instance of the EnvironmentValidator delegate.

Methods

RetrieveNextEntities(IEnvironment)

Method that calls the delegate in EntityRetriever with the provided arguments.

Declaration
public override IEnumerable<EntityCollection> RetrieveNextEntities(IEnvironment env)
Parameters
Type Name Description
IEnvironment env

The current IEnvironment to be passed to the delegate in EntityRetriever.

Returns
Type Description
System.Collections.Generic.IEnumerable<EntityCollection>

The value returned by the delegate in EntityRetriever.

Overrides
Descriptor.RetrieveNextEntities(IEnvironment)
Exceptions
Type Condition
System.NotImplementedException

Thrown if EntityRetriever is set to null.

ValidateSolution(IEnvironment, Double)

Method that calls the delegate in EnvironmentValidator with the provided arguments.

Declaration
public override bool ValidateSolution(IEnvironment env, double heuristicValue)
Parameters
Type Name Description
IEnvironment env

The current IEnvironment to be passed to the delegate in EnvironmentValidator.

System.Double heuristicValue

The current heuristic value to be passed to the delegate in EnvironmentValidator.

Returns
Type Description
System.Boolean

The value returned by the delegate in EnvironmentValidator.

Overrides
Descriptor.ValidateSolution(IEnvironment, Double)
Exceptions
Type Condition
System.NotImplementedException

Thrown if EnvironmentValidator is set to null.

Implements

IDescriptor
Back to top TreeProblemFramework from Ecuador.