Table of Contents

Interface IResponseCurve<T>

Namespace
Gamelogic.Extensions.Algorithms
Assembly
Gamelogic.Extensions.dll

This interface represents a piecewise linear curve, with input-output pairs at the bends.

[Version(3, 2, 0)]
public interface IResponseCurve<out T>

Type Parameters

T

The type of the output, usually a type that can be interpolated.

Extension Methods

Remarks

This class is the base of the that described in AI Programming Wisdom 1, "The Beauty of Response Curves", by Bob Alexander.

The inputs need not be spread uniformly.

You can implement this interface directly, or use the ResponseCurveBase<T> class as a base, which is often more convenient for interpolatable types.

It can make sense to implement this interface for discrete types, although often broader concept is needed, making this interface unsuitable. For example, you could implement a class InRange that maps inputs to true if they are in a given range, and false otherwise. But this class would make sense for other inputs than float too, so limiting it by implementing this interface is not good.

Properties

this[float]

Evaluates the curve at the given input and returns the result.

Methods

Evaluate(float)

Evaluates the curve at the given input and returns the result.