载入中...
搜索中...
未找到
GpuAgentSimulation.cpp
浏览该文件的文档.
30 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "unknown EffectKind",
38 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "maxAgents must be positive",
42 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "fixedDt must be positive",
65 Diagnostic::error(DiagnosticCode::InvalidArgument, "solver is null", "solver", {}, "gpuagents"));
69 Diagnostic::error(DiagnosticCode::InvalidArgument, "solver kind mismatch", "solver", {}, "gpuagents"));
75Result<void> GpuAgentSimulation::initialize(int count, const std::function<AgentState(int)>& spawnFn) {
82 Diagnostic::error(DiagnosticCode::InvalidArgument, "spawnFn is empty", "spawnFn", {}, "gpuagents"));
EVEngine assertion entry point, backed by zeroerr.
#define EV_PARAM_CHECK(cond,...)
Validate a function parameter / public API precondition.
Definition Assert.h:30
Stable, structured diagnostics shared by engine modules.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Result< void > setSolver(std::unique_ptr< IAgentSolver > solver)
Replace the solver instance (tests / custom kernels). @ownership Simulation takes ownership.
Definition GpuAgentSimulation.cpp:62
Result< void > initialize(int count, const std::function< AgentState(int)> &spawnFn)
Spawn count alive agents using spawnFn(index) -> AgentState.
Definition GpuAgentSimulation.cpp:75
Result< void > configure(const EffectProfile &profile)
Configure capacity and bind a solver for the profile kind.
Definition GpuAgentSimulation.cpp:36
Result< void > step(float dt, const EnvironmentSnapshot &env)
Advance wall-clock dt via fixed substeps.
Definition GpuAgentSimulation.cpp:121
Definition AgentInstanceRenderer.cpp:5
@ LifeNetwork
@ InvalidArgument
@ PreconditionViolation
Standardized per-agent simulation output shared by all effect kinds.
Definition AgentState.h:12
Type-erased profile bundle owned by an EffectBackend.
Definition EffectProfile.h:130
const EffectProfileBase & base() const
Returns the shared base slice for the active kind.
Definition EffectProfile.h:138
Read-only environment semantics prepared by GpuAgentWorld each tick.
Definition EnvironmentSnapshot.h:26