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

uuid

在Yuka js库的SingletonFuzzySet中,用于唯一标识一个模糊集合(Fuzzy Set)的是uuid,即通用唯一识别码(UUID)。每个uuid都由32个16进制数字字符组成,表示128位二进制数。它可以保证全球范围内的唯一性,因此在分布式系统、数据库索引等场合被广泛应用。

在Yuka js库中,每个SingletonFuzzySet实例都应该具有一个唯一的uuid。可以通过以下方式获取一个新的uuid:

import { v4 as uuidv4 } from 'uuid';

const myUuid = uuidv4(); // 生成一个新的uuid

通过以上方法生成的uuid是一个字符串类型的值,可以直接赋值给SingletonFuzzySet实例的uuid属性,例如:

import { SingletonFuzzySet } from 'yuka';

const myFuzzySet = new SingletonFuzzySet(0.5); // 创建一个值为0.5的单例模糊集合
const myUuid = uuidv4(); // 生成一个新的uuid
myFuzzySet.uuid = myUuid;

但是需要注意的是,每个SingletonFuzzySet实例都应该具有一个唯一的uuid,因此不应该在创建多个实例时重复使用同一个uuid。为此,建议在创建SingletonFuzzySet实例时,立即生成一个新的uuid并将其指定给实例的uuid属性,例如:

import { SingletonFuzzySet } from 'yuka';
import { v4 as uuidv4 } from 'uuid';

const myFuzzySet1 = new SingletonFuzzySet(0.5, uuidv4());
const myFuzzySet2 = new SingletonFuzzySet(0.3, uuidv4());

以上代码中,即使两个SingletonFuzzySet实例的值相同,它们也有不同的uuid,保证了每个实例的唯一性。