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() 方法用于计算模糊复合项的隶属度。它使用选择的隶属函数来度量每个单独的条件的隶属度,然后使用运算符(AND或OR)组合这些值来获得最终的隶属度。

语法

fuzzyCompositeTerm.getDegreeOfMembership(x);

参数

  • x:<em>number</em>,单独条件的度量值。

返回值

  • <em>number</em>:模糊复合项的隶属度。

示例

const fct = new FuzzyCompositeTerm(andFunction, [
  new FuzzyTerm(smf, 0, 5),
  new FuzzyTerm(trapezoidFunction, 3, 5, 7, 8),
  new FuzzyTerm(triangleFunction, 5, 7, 9),
]);

const x = 6;

const degreeOfMembership = fct.getDegreeOfMembership(x); // 0.5

注意事项

  • x 的值必须适用于传递给每个单独条件的隶属函数。
  • 确定每个条件的度量值的方法将取决于隶属函数的类型。
  • 如果复合项包含多个条件,则需要指定运算符(AND或OR),以便组合隶属度。默认情况下,FuzzyCompositeTerm 类使用 AND 运算符。