载入中...
搜索中...
未找到
CrowdInternal.h
浏览该文件的文档.
71 [[nodiscard]] Result<std::reference_wrapper<Entry>> resolve(std::uint64_t owner, const ssq::Table& token);
113 [[nodiscard]] Result<std::vector<FlowCacheEntry>> stageFlowCache(std::uint64_t budget, std::uint64_t bytes,
206 (binding.movement == surfaceStamp.movement && binding.revision == surfaceStamp.movementRevision));
212 if (actions[index] == static_cast<int>(AgentAction::Flow) && !isMovementCompatible(index)) ++count;
248 void forEachNeighbor(float qx, float qy, float radius, Fn&& fn, StepReport* partitionReport = nullptr) const {
255 budgetActive ? activeBudget.maxSpatialVisits - baseSpatial : std::numeric_limits<std::int64_t>::max(),
257 if (budgetActive && counters.candidatesVisited >= activeBudget.maxNeighborVisits - baseCandidates)
bool isBuilt() const
Whether directions were built for the current terrain and goals.
Definition CrowdField.h:104
std::uint64_t inputRevision() const noexcept
Navigation geometry/cost/rule epoch; goal edits and field publications do not change it.
Definition CrowdField.h:108
Owning sparse broadphase workspace; integer cell/row order and stable tie-key bucket order....
Definition CrowdSpatialIndex.h:28
void visit(double x, double y, double radius, std::int64_t maxVisits, std::int64_t &visits, std::int64_t &visitedCells, Fn &&fn) const
Enumerate conservative candidates in a query box with explicit lookup-work charging....
Definition CrowdSpatialIndex.h:71
Move-only navigation workstate; contains no borrowed provider pointers.
Definition Crowd.h:309
Owning immutable field lease; copies pin storage, never the Crowd provider. @thread Copy/release/quer...
Definition CrowdTypes.h:48
Definition Crowd.cpp:14
Result< FlowLease > resolveFlowRequestLease(Crowd &crowd, const ssq::Table &token)
Resolve a checked request-owned lease without retaining script table references.
Definition CrowdNavigationBindings.cpp:61
constexpr std::uint32_t flowBuildAlgorithmVersion
Increment when the navigation construction algorithm changes its observable output.
Definition CrowdTypes.h:41
CrowdExecution
Explicit execution selection; serial does not require a provider.
Definition CrowdWorkScheduler.h:7
MovementBinding parseMovementBinding(const ssq::Table &table)
Decode exact integer movement identities; no floating-point identity coercion.
Definition CrowdBatchBindings.cpp:112
void exposeAgentBatches(ssq::Class &cls)
Compose public numeric identity/batch bindings without accessing private storage.
Definition CrowdBatchBindings.cpp:134
bool validAgentUpdate(const AgentUpdate &update)
Definition CrowdBatch.cpp:41
Result< std::vector< int > > canonicalFlowCoordinates(std::span< const FlowGoal > goals, const CrowdField &field)
Copy validated goals into their unique canonical coordinates.
Definition CrowdFlowCache.cpp:13
bool validInteraction(InteractionPolicy policy)
Check finite mobility and nonnegative filter masks without modifying state.
Definition CrowdInteraction.cpp:12
InteractionPolicy parseInteractionPolicy(ssq::Table table)
Decode a canonical policy at the script boundary; throws on missing or wrongly typed fields.
Definition CrowdBatchBindings.cpp:119
void exposeNavigationRequests(ssq::Class &cls)
Register generation-qualified transient navigation request bindings.
Definition CrowdNavigationBindings.cpp:73
InteractionPolicy canonicalInteraction(AgentInteraction policy)
Normalize a compatibility filter into the canonical two-filter policy.
Definition CrowdInteraction.cpp:8
bool isFlowPointReachable(const CrowdField &field, float x, float y) noexcept
Observe exact containing-cell reachability, independent of interpolation across blocked cells....
Definition CrowdFlowCache.cpp:31
std::uint64_t namedTieValue(std::string_view identity)
Hash UTF-8 identity bytes once at admission; collisions are rejected by the registry.
Definition CrowdRegistry.cpp:23
bool isTerrainClear(const CrowdField &field, bool clamp, float x, float y, float radius)
Shared exact-placement geometry predicate for creation and relocation transactions.
Definition CrowdSpawn.cpp:6
Deterministic operation budgets; exhaustion rejects the entire step before publication.
Definition Crowd.h:71
Agent identity qualified by the Crowd instance that owns its registry. @ownership Value only; it neit...
Definition CrowdTypes.h:90
Owned changes for one live agent. Absent fields keep their existing values.
Definition Crowd.h:161
Optional bounded velocity sampling for RTS local avoidance.
Definition Crowd.h:129
Canonical in-process tie ordering; named identities sort before anonymous admission ordinals.
Definition CrowdSpatialIndex.h:17
std::shared_ptr< const CrowdField > field
Definition CrowdInternal.h:100
std::uint64_t generation
Definition CrowdInternal.h:103
std::weak_ptr< const void > pins
Definition CrowdInternal.h:101
NavigationSurfaceStamp surface
Definition CrowdInternal.h:102
std::uint32_t algorithm
Definition CrowdInternal.h:105
std::vector< float > speeds
Definition CrowdInternal.h:124
std::vector< float > headings
Definition CrowdInternal.h:124
std::vector< float > wanderPhases
Definition CrowdInternal.h:124
std::uint32_t generation
Definition CrowdInternal.h:86
Definition CrowdInternal.h:74
std::uint64_t nextAnonymousTieKey
Definition CrowdInternal.h:182
std::vector< std::size_t > preferredStarts
Definition CrowdInternal.h:236
bool isMovementCompatible(size_t index) const
Definition CrowdInternal.h:199
std::vector< std::size_t > preferredCounts
Definition CrowdInternal.h:236
std::vector< float > xs
SOA agent storage, indexed by compact slot id. @cost Linear in agent count; mutation keeps all owned ...
Definition CrowdInternal.h:167
FlowLease leaseFor(FlowCacheEntry &entry)
Definition CrowdFlowCache.cpp:84
std::vector< float > preferredVys
Definition CrowdInternal.h:169
std::vector< MovementBinding > movements
Definition CrowdInternal.h:174
std::vector< std::size_t > incidentStarts
Definition CrowdInternal.h:195
std::shared_ptr< CrowdWorkScheduler > workScheduler
Definition CrowdInternal.h:79
int navigationMismatchCount() const noexcept
Definition CrowdInternal.h:209
std::vector< float > correctionXs
Definition CrowdInternal.h:168
struct eve::crowd::Crowd::Impl::MotionBackup rollback
float resolveOverlapsPass()
Definition CrowdContactSolver.cpp:4
std::vector< std::size_t > pairStarts
Definition CrowdInternal.h:196
std::vector< std::size_t > pairCounts
Definition CrowdInternal.h:196
std::vector< std::size_t > incidentPairs
Definition CrowdInternal.h:195
void clearAgentIdentities()
Definition CrowdRegistry.cpp:102
std::vector< std::uint32_t > denseToRegistry
Definition CrowdInternal.h:91
void prepareAvoidanceNeighbors()
Definition CrowdAvoidance.cpp:32
std::vector< float > preferredVxs
Definition CrowdInternal.h:169
bool canContact(size_t a, size_t b) const
Definition CrowdInternal.h:227
void spendPreferredWork(std::int64_t amount)
Definition CrowdPreferred.cpp:7
bool canAvoid(size_t a, size_t b) const
Definition CrowdInternal.h:231
void eraseAgentIdentity(int denseIndex)
Definition CrowdRegistry.cpp:85
std::vector< int > preferredNeighbors
Definition CrowdInternal.h:237
NavigationSurfaceStamp surfaceStamp
Definition CrowdInternal.h:98
std::vector< ContactPair > contactPairs
Definition CrowdInternal.h:193
std::uint64_t nextFlowGeneration
Definition CrowdInternal.h:117
std::vector< std::uint32_t > freeRegistry
Definition CrowdInternal.h:91
void dispatchWork(std::size_t items, const std::function< void(std::size_t, std::size_t)> &body)
Definition CrowdScheduler.cpp:17
std::unordered_map< std::string, int > namedAgents
Definition CrowdInternal.h:183
void forEachNeighbor(float qx, float qy, float radius, Fn &&fn, StepReport *partitionReport=nullptr) const
Definition CrowdInternal.h:248
bool isFlowLeaseCurrent(const FlowLease &lease) const noexcept
Definition CrowdInternal.h:118
Result< std::vector< FlowCacheEntry > > stageFlowCache(std::uint64_t budget, std::uint64_t bytes, size_t count) const
Stage cache metadata and deterministic unleased evictions without live mutation. @ownership Returns o...
Definition CrowdFlowCache.cpp:53
std::vector< FlowCacheEntry > flowCache
Definition CrowdInternal.h:116
std::vector< float > correctionYs
Definition CrowdInternal.h:168
std::vector< InteractionPolicy > interactions
Definition CrowdInternal.h:173
void appendAgentIdentity(int denseIndex)
Definition CrowdRegistry.cpp:72
static bool isFlowKeyBefore(const FlowCacheEntry &a, const FlowCacheEntry &b)
Definition CrowdFlowCache.cpp:44
std::vector< float > wanderPhases
Definition CrowdInternal.h:177
int resolveAgent(AgentRef reference) const noexcept
Definition CrowdRegistry.cpp:106
const CrowdField * navigationField(size_t index) const noexcept
Observe the selected compatible built field, or null when unavailable. @ownership Borrowed read-only ...
Definition CrowdInternal.h:221
void preparePreferredVelocities(float dt)
Definition CrowdPreferred.cpp:65
static std::uint64_t retainedFlowBytes(const CrowdField &value)
Definition CrowdFlowCache.cpp:38
std::unordered_map< std::uint64_t, int > namedTieKeys
Definition CrowdInternal.h:181
std::vector< PreferredFlow > preferredFlows
Definition CrowdInternal.h:241
std::vector< float > arriveFactors
Definition CrowdInternal.h:169
std::vector< ContactDelta > contactDeltas
Definition CrowdInternal.h:194
std::vector< int32_t > avoidancePriorities
Definition CrowdInternal.h:171
std::vector< std::vector< AvoidanceNeighbor > > predictionNeighbors
Per-step avoidance neighbor scratch space. @cost Linear in checked neighbors and bounded by avoidance...
Definition CrowdInternal.h:160
void applyAgentUpdate(const AgentUpdate &update, std::size_t slot)
Definition CrowdBatch.cpp:47
void preparePreferredNeighbors()
Definition CrowdPreferred.cpp:12
void selectAvoidanceVelocity(size_t index, float dt, float &vx, float &vy)
Definition CrowdAvoidance.cpp:126
std::vector< std::string > stableIds
Definition CrowdInternal.h:178
Owning observations of one completed advance; simulation-thread only.
Definition Crowd.h:94
std::int64_t cellsVisited
Occupied cells enumerated by all neighborhood queries.
Definition Crowd.h:105
std::int64_t spatialVisits
Query row/cell enumeration and binary-search comparisons.
Definition Crowd.h:108
std::int64_t candidatesVisited
Bucket entries inspected before radius or interaction filtering.
Definition Crowd.h:111
Non-allocating internal unwind signal, translated at the checked simulation boundary.
Definition CrowdSpatialIndex.h:13