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是FuzzyAND方法的一个函数,用于清除隶属度。当一些输入变量不再有效时,应该使用此函数来清除其隶属度,以避免对后续分析产生负面影响。

语法

FuzzyAND.clearDegreeOfMembership(fuzzyVariable);

参数说明:

  • fuzzyVariable: 需要清除隶属度的模糊变量。

示例

以下示例演示了如何使用clearDegreeOfMembership来清除模糊变量中的隶属度。

// 创建一个模糊变量
var temperature = new FuzzyVariable("temperature", 0, 100);

// 定义三个隶属函数
var cold = new FuzzySet("cold", [-10, 0], [10, 0.8]);
var medium = new FuzzySet("medium", [0, 0], [10, 1], [20, 0]);
var hot = new FuzzySet("hot", [10, 0.2], [30, 1]);

// 将隶属函数添加到模糊变量中
temperature.addFuzzySet(cold);
temperature.addFuzzySet(medium);
temperature.addFuzzySet(hot);

// 设置模糊变量的值
temperature.setValue(15);

// 清除模糊变量的隶属度
FuzzyAND.clearDegreeOfMembership(temperature);

参考