C# 클래스 Accord.Fuzzy.PiecewiseLinearFunction

Membership function composed by several connected linear functions.

The piecewise linear is a generic function used by many specific fuzzy membership functions, like the trappezoidal function. This class must be instantiated with a sequence of points representing the edges of each one of the lines composing the piecewise function.

The x-axis points must be ordered (crescent), so the GetMembership function will use each X value as an ending point for one line and starting point of the next.

While trapezoidal and half trapezoidal are classic functions used in fuzzy functions, this class supports any function or approximation that can be represented as a sequence of lines.

Sample usage:

// creating an array of points representing a typical trapezoidal function /-\ Point [] points = new Point[4]; // point where membership starts to rise points[0] = new Point( 10, 0 ); // maximum membership (1) reached at the second point points[1] = new Point( 20, 1 ); // membership starts to fall at the third point points[2] = new Point( 30, 1 ); // membership gets to zero at the last point points[3] = new Point( 40, 0 ); // creating the instance PiecewiseLinearFunction membershipFunction = new PiecewiseLinearFunction( points ); // getting membership for several points for ( int i = 5; i < 45; i++ ) Console.WriteLine( membershipFunction.GetMembership( i ) );
상속: IMembershipFunction
파일 보기 프로젝트 열기: accord-net/framework

보호된 프로퍼티들

프로퍼티 타입 설명
points System.Point[]

공개 메소드들

메소드 설명
GetMembership ( float x ) : float

Calculate membership of a given value to the piecewise function.

PiecewiseLinearFunction ( System.Point points ) : System

Initializes a new instance of the PiecewiseLinearFunction class.

Specified point must be in crescent order on X axis and their Y value must be in the range of [0, 1].

보호된 메소드들

메소드 설명
PiecewiseLinearFunction ( ) : System

Initializes a new instance of the PiecewiseLinearFunction class.

This constructor must be used only by inherited classes to create the points vector after the instantiation.

메소드 상세

GetMembership() 공개 메소드

Calculate membership of a given value to the piecewise function.
Points of the membership function are not initialized.
public GetMembership ( float x ) : float
x float Value which membership will to be calculated.
리턴 float

PiecewiseLinearFunction() 보호된 메소드

Initializes a new instance of the PiecewiseLinearFunction class.

This constructor must be used only by inherited classes to create the points vector after the instantiation.

protected PiecewiseLinearFunction ( ) : System
리턴 System

PiecewiseLinearFunction() 공개 메소드

Initializes a new instance of the PiecewiseLinearFunction class.

Specified point must be in crescent order on X axis and their Y value must be in the range of [0, 1].

Points must be in crescent order on X axis. Y value of points must be in the range of [0, 1].
public PiecewiseLinearFunction ( System.Point points ) : System
points System.Point Array of (X,Y) coordinates of each start/end of the lines.
리턴 System

프로퍼티 상세

points 보호되어 있는 프로퍼티

Vector of (X,Y) coordinates for end/start of each line.
protected Point[],System points
리턴 System.Point[]