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() 方法用于清除LeftShoulderFuzzySet中任意一个元素的隶属度。该方法接收一个参数,代表需要被清除隶属度的元素。如果不传入参数,则默认清除所有元素的隶属度。

语法

LeftShoulderFuzzySet.clearDegreeOfMembership(element)

参数

  • element (可选): 要清除隶属度的元素。如果不传入参数,则默认清除所有元素的隶属度。

返回值

该方法没有返回值。

示例

// 实例化LeftShoulderFuzzySet对象
const set = new Yuka.LeftShoulderFuzzySet(20,40,60);

// 设置元素的隶属度
set.setDegreeOfMembership(50, 0.4);

// 获取元素的隶属度
console.log(set.getDegreeOfMembership(50)); // 0.4

// 清除元素的隶属度
set.clearDegreeOfMembership(50);

// 获取元素的隶属度
console.log(set.getDegreeOfMembership(50)); // 0

// 清除所有元素的隶属度
set.clearDegreeOfMembership();

// 获取元素的隶属度
console.log(set.getDegreeOfMembership(20)); // 0
console.log(set.getDegreeOfMembership(40)); // 0
console.log(set.getDegreeOfMembership(60)); // 0

参考资料