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

clearDegreeOfMembership

函数 clearDegreeOfMembership 用于清空模糊集合中某一元素的隶属度。

语法

fuzzy.clearDegreeOfMembership(variable, name);

参数

  • variable:模糊变量(FuzzyVariable)对象。
  • name:模糊集合的名称。

返回值

无返回值。

示例

以下示例演示了如何清空模糊集合中的隶属度:

// 创建一个模糊变量对象
let age = new FuzzyVariable();

// 创建一个模糊集合对象并加入到模糊变量中
let young = age.addLeftShoulderSet("Young", 0, 25, 50);
let middle = age.addTriangularSet("Middle", 25, 50, 75);
let old = age.addRightShoulderSet("Old", 50, 75, 100);

// 获取Young集合的隶属度
console.log(young.degreeOfMembership(20)); // 1

// 清空Young集合的隶属度
fuzzy.clearDegreeOfMembership(age, "Young");

// 再次获取Young集合的隶属度(已清空)
console.log(young.degreeOfMembership(20)); // 0

注意事项

  • 如果指定的模糊集合不存在,该函数将不会引起任何影响。
  • 调用该函数将设置模糊集合内所有元素的隶属度为0。