AABB
AlignmentBehavior
ArriveBehavior
AStar
BFS
BoundingSphere
BVH
BVHNode
Cell
CellSpacePartitioning
CohesionBehavior
CompositeGoal
ConvexHull
Corridor
CostTable
DFS
Dijkstra
Edge
EntityManager
EvadeBehavior
EventDispatcher
Behavior
FollowPathBehavior
FuzzyAND
FuzzyCompositeTerm
FuzzyFAIRLY
FuzzyModule
FuzzyOR
FuzzyRule
FuzzySet
FuzzyTerm
FuzzyVariable
FuzzyVERY
GameEntity
Goal
GoalEvaluator
Graph
GraphUtils
HalfEdge
HeuristicPolicyDijkstra
HeuristicPolicyEuclid
HeuristicPolicyEuclidSquared
HeuristicPolicyManhattan
InterposeBehavior
LeftSCurveFuzzySet
LeftShoulderFuzzySet
LineSegment
Logger
MathUtils
Matrix3
Matrix4
MemoryRecord
MemorySystem
MeshGeometry
MessageDispatcher
MovingEntity
NavEdge
NavMesh
NavMeshLoader
NavNode
Node
NormalDistFuzzySet
OBB
ObstacleAvoidanceBehavior
OffsetPursuitBehavior
OnPathBehavior
Path
Plane
Polygon
Polyhedron
PriorityQueue
PursuitBehavior
Quaternion
Ray
RectangleTriggerRegion
Regular
RightSCurveFuzzySet
RightShoulderFuzzySet
SAT
SeekBehavior
SeparationBehavior
SingletonFuzzySet
Smoother
SphericalTriggerRegion
State
StateMachine
SteeringBehavior
SteeringManager
Task
TaskQueue
Telegram
Think
Time
TriangularFuzzySet
Trigger
TriggerRegion
Vector3
Vehicle
Version
WanderBehavior

getDegreeOfMembership

简介

getDegreeOfMembership是TriangularFuzzySet类的一个函数。该函数用于计算给定值的隶属度。三角隶属函数在一个区间内定义出一个标准三角形,该函数在区间两端具有零值,中心具有最大值,是一种常用的模糊函数。

语法

getDegreeOfMembership(value)

参数

  • value (number): 要计算隶属度的值。

返回值

  • 隶属度 (number):在指定三角隶属函数中给定值的隶属度。

示例

const fuzzySet = new TriangularFuzzySet(0, 5, 10);
fuzzySet.getDegreeOfMembership(2.5); // 输出为 0.5
fuzzySet.getDegreeOfMembership(5); // 输出为 1
fuzzySet.getDegreeOfMembership(11); // 输出为 0

注意事项

  • value参数应该在三角隶属函数定义的区间内,否则返回的隶属度为零。

参考文献

  • L.A. Zadeh, “Fuzzy sets,” Information and Control, vol. 8, no. 3, pp. 338-353, 1965.

  • George J. Klir, Bo Yuan. Fuzzy Sets and Fuzzy Logic: Theory and Applications[M]. Prentice Hall, 1995.