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

fuzzify

概述

fuzzifyFuzzyVariable类的一个方法,用于将输入的语言变量值(linguistic variable)映射到其隶属函数(membership function)的隶属度(membership degree)。

语法

fuzzify(variableValue)

参数

  • variableValue:输入的语言变量值。

返回值

函数返回一个对象,包含了输入的变量隶属于每个隶属函数的隶属度值。

示例

let speed = new FuzzyVariable();
speed.addTerm(new FuzzyTerm('slow', new LeftShoulderFuzzySet(0, 30, 60)));
speed.addTerm(new FuzzyTerm('medium', new TriangleFuzzySet(30, 60, 90)));
speed.addTerm(new FuzzyTerm('fast', new RightShoulderFuzzySet(60, 90, 120)));

let inputSpeed = 75;
let membershipDegrees = speed.fuzzify(inputSpeed);

console.log(membershipDegrees); // { slow: 0, medium: 0.5, fast: 0.5 }

以上示例展示了如何使用fuzzify方法将输入的速度隶属于slowmediumfast三个隶属函数的隶属度。其中,输入的速度值为75,经过模糊处理后,分别对应了mediumfast两个隶属函数,并分别映射到了这两个隶属函数的隶属度值(成员函数值)0.5。