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

computeDegreeOfMembership

作用

计算模糊集合的隶属度。

语法

RightSCurveFuzzySet.computeDegreeOfMembership(x);

参数

  • x:待计算的值。

返回值

  • Number:该值在模糊集合中的隶属度。

描述

RightSCurveFuzzySet.computeDegreeOfMembership()方法计算给定值在右S曲线模糊集合中的隶属度。该方法需要传入待计算的值,结果为该值在模糊集合中的隶属度。

示例

const fuzzySet = new RightSCurveFuzzySet(5, 10);
fuzzySet.computeDegreeOfMembership(6); // 0.5
fuzzySet.computeDegreeOfMembership(9); // 0.9
fuzzySet.computeDegreeOfMembership(3); // 0

在上述示例中,我们创建了一个右S曲线模糊集合,然后用computeDegreeOfMembership()计算了不同值在该模糊集合中的隶属度。

异常

  • TypeError:当传入的参数不是数字类型时,会抛出该异常。

参考