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

representativeValue

简介

representativeValue 是Yuka js库中 LeftSCurveFuzzySet 对象的一个方法,用于计算模糊集的代表值。

语法

LeftSCurveFuzzySet.representativeValue();

参数

无。

返回值

  • representativeValue:模糊集的代表值,类型为一个数字。

示例

const fuzzySet = new YUKA.LeftSCurveFuzzySet(0, 1, 3);
const representativeValue = fuzzySet.representativeValue(); // returns 0.5

实现原理

representativeValue 方法计算模糊集的代表值,经过以下步骤:

  1. 计算模糊集的模糊度(fuzzyDegree),模糊度为模糊集最高隶属度的值。
  2. 计算模糊集的平均值,平均值为隶属度与对应属性值的乘积之和除以模糊度。
  3. 返回平均值作为模糊集的代表值。

注意事项

  • representativeValue 方法仅适用于左S曲线模糊集(LeftSCurveFuzzySet)对象。

参考资料